[GCM] Add the dummy app handler when there is at least one handler.
[chromium-blink-merge.git] / ash / shell.h
blob9850afefb4298bcdf6af07a2e38fd316907c5768
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef ASH_SHELL_H_
6 #define ASH_SHELL_H_
8 #include <utility>
9 #include <vector>
11 #include "ash/ash_export.h"
12 #include "ash/metrics/user_metrics_recorder.h"
13 #include "ash/shelf/shelf_types.h"
14 #include "ash/system/user/login_status.h"
15 #include "ash/wm/cursor_manager_chromeos.h"
16 #include "ash/wm/system_modal_container_event_filter_delegate.h"
17 #include "base/basictypes.h"
18 #include "base/compiler_specific.h"
19 #include "base/gtest_prod_util.h"
20 #include "base/memory/scoped_ptr.h"
21 #include "base/memory/weak_ptr.h"
22 #include "base/observer_list.h"
23 #include "ui/aura/window.h"
24 #include "ui/base/ui_base_types.h"
25 #include "ui/events/event_target.h"
26 #include "ui/gfx/geometry/insets.h"
27 #include "ui/gfx/geometry/size.h"
28 #include "ui/gfx/screen.h"
29 #include "ui/wm/core/cursor_manager.h"
30 #include "ui/wm/public/activation_change_observer.h"
32 namespace app_list {
33 class AppListView;
35 namespace aura {
36 class EventFilter;
37 class RootWindow;
38 class Window;
39 namespace client {
40 class ActivationClient;
41 class FocusClient;
45 #if defined(OS_CHROMEOS)
46 namespace chromeos {
47 class AccelerometerReader;
49 #endif
51 namespace gfx {
52 class ImageSkia;
53 class Point;
54 class Rect;
57 namespace ui {
58 class DisplayConfigurator;
59 class Layer;
60 class UserActivityPowerManagerNotifier;
62 namespace views {
63 class NonClientFrameView;
64 class Widget;
65 namespace corewm {
66 class TooltipController;
70 namespace wm {
71 class AcceleratorFilter;
72 class CompoundEventFilter;
73 class InputMethodEventFilter;
74 class NestedAcceleratorController;
75 class ShadowController;
76 class VisibilityController;
77 class UserActivityDetector;
78 class WindowModalityController;
81 namespace ash {
83 class AcceleratorController;
84 class AccessibilityDelegate;
85 class AppListController;
86 class AshNativeCursorManager;
87 class AutoclickController;
88 class BluetoothNotificationController;
89 class CaptureController;
90 class DesktopBackgroundController;
91 class DisplayChangeObserver;
92 class DisplayConfiguratorAnimation;
93 class DisplayController;
94 class DisplayErrorObserver;
95 class DisplayManager;
96 class DragDropController;
97 class EventClientImpl;
98 class EventRewriterEventFilter;
99 class EventTransformationHandler;
100 class FirstRunHelper;
101 class FocusCycler;
102 class GPUSupport;
103 class HighContrastController;
104 class KeyboardUMAEventFilter;
105 class LastWindowClosedLogoutReminder;
106 class LocaleNotificationController;
107 class LockStateController;
108 class LogoutConfirmationController;
109 class MagnificationController;
110 class MaximizeModeController;
111 class MaximizeModeWindowManager;
112 class MediaDelegate;
113 class MouseCursorEventFilter;
114 class MruWindowTracker;
115 class NewWindowDelegate;
116 class OverlayEventFilter;
117 class PartialMagnificationController;
118 class PowerButtonController;
119 class PowerEventObserver;
120 class ProjectingObserver;
121 class ResizeShadowController;
122 class ResolutionNotificationController;
123 class RootWindowController;
124 class ScopedTargetRootWindow;
125 class ScreenAsh;
126 class ScreenOrientationDelegate;
127 class ScreenPositionController;
128 class SessionStateDelegate;
129 class Shelf;
130 class ShelfDelegate;
131 class ShelfItemDelegateManager;
132 class ShelfModel;
133 class ShelfWindowWatcher;
134 class ShellDelegate;
135 struct ShellInitParams;
136 class ShellObserver;
137 class SlowAnimationEventFilter;
138 class StatusAreaWidget;
139 class StickyKeysController;
140 class SystemGestureEventFilter;
141 class SystemModalContainerEventFilter;
142 class SystemTray;
143 class SystemTrayDelegate;
144 class SystemTrayNotifier;
145 class ToplevelWindowEventHandler;
146 class TouchTransformerController;
147 class TouchObserverHUD;
148 class UserActivityDetector;
149 class UserWallpaperDelegate;
150 class VirtualKeyboardController;
151 class VideoActivityNotifier;
152 class VideoDetector;
153 class WebNotificationTray;
154 class WindowCycleController;
155 class WindowPositioner;
156 class WindowSelectorController;
158 namespace shell {
159 class WindowWatcher;
162 namespace test {
163 class ShellTestApi;
166 // Shell is a singleton object that presents the Shell API and implements the
167 // RootWindow's delegate interface.
169 // Upon creation, the Shell sets itself as the RootWindow's delegate, which
170 // takes ownership of the Shell.
171 class ASH_EXPORT Shell : public SystemModalContainerEventFilterDelegate,
172 public ui::EventTarget,
173 public aura::client::ActivationChangeObserver {
174 public:
175 typedef std::vector<RootWindowController*> RootWindowControllerList;
177 enum Direction {
178 FORWARD,
179 BACKWARD
182 // A shell must be explicitly created so that it can call |Init()| with the
183 // delegate set. |delegate| can be NULL (if not required for initialization).
184 // Takes ownership of |delegate|.
185 static Shell* CreateInstance(const ShellInitParams& init_params);
187 // Should never be called before |CreateInstance()|.
188 static Shell* GetInstance();
190 // Returns true if the ash shell has been instantiated.
191 static bool HasInstance();
193 static void DeleteInstance();
195 // Returns the root window controller for the primary root window.
196 // TODO(oshima): move this to |RootWindowController|
197 static RootWindowController* GetPrimaryRootWindowController();
199 // Returns all root window controllers.
200 // TODO(oshima): move this to |RootWindowController|
201 static RootWindowControllerList GetAllRootWindowControllers();
203 // Returns the primary root Window. The primary root Window is the one that
204 // has a launcher.
205 static aura::Window* GetPrimaryRootWindow();
207 // Returns a root Window when used as a target when creating a new window.
208 // The root window of the active window is used in most cases, but can
209 // be overridden by using ScopedTargetRootWindow().
210 // If you want to get the root Window of the active window, just use
211 // |wm::GetActiveWindow()->GetRootWindow()|.
212 static aura::Window* GetTargetRootWindow();
214 // Returns the global Screen object that's always active in ash.
215 static gfx::Screen* GetScreen();
217 // Returns all root windows.
218 static aura::Window::Windows GetAllRootWindows();
220 static aura::Window* GetContainer(aura::Window* root_window,
221 int container_id);
222 static const aura::Window* GetContainer(const aura::Window* root_window,
223 int container_id);
225 // Returns the list of containers that match |container_id| in
226 // all root windows. If |priority_root| is given, the container
227 // in the |priority_root| will be inserted at the top of the list.
228 static std::vector<aura::Window*> GetContainersFromAllRootWindows(
229 int container_id,
230 aura::Window* priority_root);
232 void set_target_root_window(aura::Window* target_root_window) {
233 target_root_window_ = target_root_window;
236 // Shows the context menu for the background and launcher at
237 // |location_in_screen| (in screen coordinates).
238 void ShowContextMenu(const gfx::Point& location_in_screen,
239 ui::MenuSourceType source_type);
241 // Shows the app list. |window| specifies in which display the app
242 // list should be shown. If this is NULL, the active root window
243 // will be used.
244 void ShowAppList(aura::Window* anchor);
246 // Dismisses the app list.
247 void DismissAppList();
249 // Shows the app list if it's not visible. Dismisses it otherwise.
250 void ToggleAppList(aura::Window* anchor);
252 // Returns app list target visibility.
253 bool GetAppListTargetVisibility() const;
255 // Returns app list window or NULL if it is not visible.
256 aura::Window* GetAppListWindow();
258 // Returns app list view or NULL if it is not visible.
259 app_list::AppListView* GetAppListView();
261 // Returns true if a system-modal dialog window is currently open.
262 bool IsSystemModalWindowOpen() const;
264 // For testing only: set simulation that a modal window is open
265 void SimulateModalWindowOpenForTesting(bool modal_window_open) {
266 simulate_modal_window_open_for_testing_ = modal_window_open;
269 // Creates a default views::NonClientFrameView for use by windows in the
270 // Ash environment.
271 views::NonClientFrameView* CreateDefaultNonClientFrameView(
272 views::Widget* widget);
274 // Rotates focus through containers that can receive focus.
275 void RotateFocus(Direction direction);
277 // Sets the work area insets of the display that contains |window|,
278 // this notifies observers too.
279 // TODO(sky): this no longer really replicates what happens and is unreliable.
280 // Remove this.
281 void SetDisplayWorkAreaInsets(aura::Window* window,
282 const gfx::Insets& insets);
284 // Called when the user logs in.
285 void OnLoginStateChanged(user::LoginStatus status);
287 // Called after the logged-in user's profile is ready.
288 void OnLoginUserProfilePrepared();
290 // Called when the login status changes.
291 // TODO(oshima): Investigate if we can merge this and |OnLoginStateChanged|.
292 void UpdateAfterLoginStatusChange(user::LoginStatus status);
294 // Called when the application is exiting.
295 void OnAppTerminating();
297 // Called when the screen is locked (after the lock window is visible) or
298 // unlocked.
299 void OnLockStateChanged(bool locked);
301 // Called when a casting session is started or stopped.
302 void OnCastingSessionStartedOrStopped(bool started);
304 // Called when the overview mode is about to be started (before the windows
305 // get re-arranged).
306 void OnOverviewModeStarting();
308 // Called before the overview mode is ending (before the windows get arranged
309 // to their final position).
310 void OnOverviewModeEnding();
312 // Called after maximize mode has started, windows might still animate though.
313 void OnMaximizeModeStarted();
315 // Called after maximize mode has ended, windows might still be returning to
316 // their original position.
317 void OnMaximizeModeEnded();
319 // Called when a root window is created.
320 void OnRootWindowAdded(aura::Window* root_window);
322 // Initializes |shelf_|. Does nothing if it's already initialized.
323 void CreateShelf();
325 // Called when the shelf is created for |root_window|.
326 void OnShelfCreatedForRootWindow(aura::Window* root_window);
328 // Creates a virtual keyboard. Deletes the old virtual keyboard if it already
329 // exists.
330 void CreateKeyboard();
332 // Deactivates the virtual keyboard.
333 void DeactivateKeyboard();
335 // Show shelf view if it was created hidden (before session has started).
336 void ShowShelf();
338 // Adds/removes observer.
339 void AddShellObserver(ShellObserver* observer);
340 void RemoveShellObserver(ShellObserver* observer);
342 #if defined(OS_CHROMEOS)
343 // Test if MaximizeModeWindowManager is not enabled, and if
344 // MaximizeModeController is not currently setting a display rotation. Or if
345 // the |resolution_notification_controller_| is not showing its confirmation
346 // dialog. If true then changes to display settings can be saved.
347 bool ShouldSaveDisplaySettings();
348 #endif
350 AcceleratorController* accelerator_controller() {
351 return accelerator_controller_.get();
354 DisplayManager* display_manager() { return display_manager_.get(); }
355 ::wm::InputMethodEventFilter* input_method_filter() {
356 return input_method_filter_.get();
358 ::wm::CompoundEventFilter* env_filter() {
359 return env_filter_.get();
361 views::corewm::TooltipController* tooltip_controller() {
362 return tooltip_controller_.get();
364 OverlayEventFilter* overlay_filter() { return overlay_filter_.get(); }
365 DesktopBackgroundController* desktop_background_controller() {
366 return desktop_background_controller_.get();
368 PowerButtonController* power_button_controller() {
369 return power_button_controller_.get();
371 LockStateController* lock_state_controller() {
372 return lock_state_controller_.get();
374 MruWindowTracker* mru_window_tracker() {
375 return mru_window_tracker_.get();
377 VideoDetector* video_detector() {
378 return video_detector_.get();
380 WindowCycleController* window_cycle_controller() {
381 return window_cycle_controller_.get();
383 WindowSelectorController* window_selector_controller() {
384 return window_selector_controller_.get();
386 FocusCycler* focus_cycler() { return focus_cycler_.get(); }
387 DisplayController* display_controller() {
388 return display_controller_.get();
390 #if defined(OS_CHROMEOS)
391 TouchTransformerController* touch_transformer_controller() {
392 return touch_transformer_controller_.get();
394 #endif // defined(OS_CHROMEOS)
395 MouseCursorEventFilter* mouse_cursor_filter() {
396 return mouse_cursor_filter_.get();
398 EventTransformationHandler* event_transformation_handler() {
399 return event_transformation_handler_.get();
401 ::wm::CursorManager* cursor_manager() { return &cursor_manager_; }
403 ShellDelegate* delegate() { return delegate_.get(); }
405 UserWallpaperDelegate* user_wallpaper_delegate() {
406 return user_wallpaper_delegate_.get();
409 SessionStateDelegate* session_state_delegate() {
410 return session_state_delegate_.get();
413 AccessibilityDelegate* accessibility_delegate() {
414 return accessibility_delegate_.get();
417 NewWindowDelegate* new_window_delegate() {
418 return new_window_delegate_.get();
421 MediaDelegate* media_delegate() {
422 return media_delegate_.get();
425 HighContrastController* high_contrast_controller() {
426 return high_contrast_controller_.get();
429 MagnificationController* magnification_controller() {
430 return magnification_controller_.get();
433 PartialMagnificationController* partial_magnification_controller() {
434 return partial_magnification_controller_.get();
437 AutoclickController* autoclick_controller() {
438 return autoclick_controller_.get();
441 aura::client::ActivationClient* activation_client() {
442 return activation_client_;
445 ShelfItemDelegateManager* shelf_item_delegate_manager() {
446 return shelf_item_delegate_manager_.get();
449 // Force the shelf to query for it's current visibility state.
450 void UpdateShelfVisibility();
452 // TODO(oshima): Define an interface to access shelf/launcher
453 // state, or just use Launcher.
455 // Sets/gets the shelf auto-hide behavior on |root_window|.
456 void SetShelfAutoHideBehavior(ShelfAutoHideBehavior behavior,
457 aura::Window* root_window);
458 ShelfAutoHideBehavior GetShelfAutoHideBehavior(
459 aura::Window* root_window) const;
461 // Sets/gets shelf's alignment on |root_window|.
462 void SetShelfAlignment(ShelfAlignment alignment,
463 aura::Window* root_window);
464 ShelfAlignment GetShelfAlignment(const aura::Window* root_window);
466 // Dims or undims the screen.
467 void SetDimming(bool should_dim);
469 // Notifies |observers_| when entering or exiting fullscreen mode in
470 // |root_window|.
471 void NotifyFullscreenStateChange(bool is_fullscreen,
472 aura::Window* root_window);
474 // Creates a modal background (a partially-opaque fullscreen window)
475 // on all displays for |window|.
476 void CreateModalBackground(aura::Window* window);
478 // Called when a modal window is removed. It will activate
479 // another modal window if any, or remove modal screens
480 // on all displays.
481 void OnModalWindowRemoved(aura::Window* removed);
483 // Returns WebNotificationTray on the primary root window.
484 WebNotificationTray* GetWebNotificationTray();
486 // Does the primary display have status area?
487 bool HasPrimaryStatusArea();
489 // Returns the system tray on primary display.
490 SystemTray* GetPrimarySystemTray();
492 SystemTrayDelegate* system_tray_delegate() {
493 return system_tray_delegate_.get();
496 SystemTrayNotifier* system_tray_notifier() {
497 return system_tray_notifier_.get();
500 static void set_initially_hide_cursor(bool hide) {
501 initially_hide_cursor_ = hide;
504 ResizeShadowController* resize_shadow_controller() {
505 return resize_shadow_controller_.get();
508 // Made available for tests.
509 ::wm::ShadowController* shadow_controller() {
510 return shadow_controller_.get();
513 // Starts the animation that occurs on first login.
514 void DoInitialWorkspaceAnimation();
516 MaximizeModeController* maximize_mode_controller() {
517 return maximize_mode_controller_.get();
520 #if defined(OS_CHROMEOS)
521 chromeos::AccelerometerReader* accelerometer_reader() {
522 return accelerometer_reader_.get();
525 // TODO(oshima): Move these objects to DisplayController.
526 ui::DisplayConfigurator* display_configurator() {
527 return display_configurator_.get();
529 DisplayConfiguratorAnimation* display_configurator_animation() {
530 return display_configurator_animation_.get();
532 DisplayErrorObserver* display_error_observer() {
533 return display_error_observer_.get();
536 ResolutionNotificationController* resolution_notification_controller() {
537 return resolution_notification_controller_.get();
540 LogoutConfirmationController* logout_confirmation_controller() {
541 return logout_confirmation_controller_.get();
544 ScreenOrientationDelegate* screen_orientation_delegate() {
545 return screen_orientation_delegate_.get();
548 VirtualKeyboardController* virtual_keyboard_controller() {
549 return virtual_keyboard_controller_.get();
551 #endif // defined(OS_CHROMEOS)
553 ShelfModel* shelf_model() {
554 return shelf_model_.get();
557 WindowPositioner* window_positioner() {
558 return window_positioner_.get();
561 // Returns the launcher delegate, creating if necesary.
562 ShelfDelegate* GetShelfDelegate();
564 UserMetricsRecorder* metrics() {
565 return user_metrics_recorder_.get();
568 void SetTouchHudProjectionEnabled(bool enabled);
570 bool is_touch_hud_projection_enabled() const {
571 return is_touch_hud_projection_enabled_;
574 #if defined(OS_CHROMEOS)
575 // Creates instance of FirstRunHelper. Caller is responsible for deleting
576 // returned object.
577 ash::FirstRunHelper* CreateFirstRunHelper();
579 // Toggles cursor compositing on/off. Native cursor is disabled when cursor
580 // compositing is enabled, and vice versa.
581 void SetCursorCompositingEnabled(bool enabled);
583 StickyKeysController* sticky_keys_controller() {
584 return sticky_keys_controller_.get();
586 #endif // defined(OS_CHROMEOS)
588 GPUSupport* gpu_support() { return gpu_support_.get(); }
590 private:
591 FRIEND_TEST_ALL_PREFIXES(ExtendedDesktopTest, TestCursor);
592 FRIEND_TEST_ALL_PREFIXES(WindowManagerTest, MouseEventCursors);
593 FRIEND_TEST_ALL_PREFIXES(WindowManagerTest, TransformActivate);
594 friend class RootWindowController;
595 friend class ScopedTargetRootWindow;
596 friend class test::ShellTestApi;
597 friend class shell::WindowWatcher;
599 typedef std::pair<aura::Window*, gfx::Rect> WindowAndBoundsPair;
601 // Takes ownership of |delegate|.
602 explicit Shell(ShellDelegate* delegate);
603 ~Shell() override;
605 void Init(const ShellInitParams& init_params);
607 // Initializes virtual keyboard controller.
608 void InitKeyboard();
610 // Initializes the root window so that it can host browser windows.
611 void InitRootWindow(aura::Window* root_window);
613 // ash::SystemModalContainerEventFilterDelegate overrides:
614 bool CanWindowReceiveEvents(aura::Window* window) override;
616 // Overridden from ui::EventTarget:
617 bool CanAcceptEvent(const ui::Event& event) override;
618 EventTarget* GetParentTarget() override;
619 scoped_ptr<ui::EventTargetIterator> GetChildIterator() const override;
620 ui::EventTargeter* GetEventTargeter() override;
621 void OnEvent(ui::Event* event) override;
623 // Overridden from aura::client::ActivationChangeObserver:
624 void OnWindowActivated(aura::Window* gained_active,
625 aura::Window* lost_active) override;
627 static Shell* instance_;
629 // If set before the Shell is initialized, the mouse cursor will be hidden
630 // when the screen is initially created.
631 static bool initially_hide_cursor_;
633 // When no explicit target display/RootWindow is given, new windows are
634 // created on |scoped_target_root_window_| , unless NULL in
635 // which case they are created on |target_root_window_|.
636 // |target_root_window_| never becomes NULL during the session.
637 aura::Window* target_root_window_;
638 aura::Window* scoped_target_root_window_;
640 // The CompoundEventFilter owned by aura::Env object.
641 scoped_ptr< ::wm::CompoundEventFilter> env_filter_;
643 std::vector<WindowAndBoundsPair> to_restore_;
645 scoped_ptr<UserMetricsRecorder> user_metrics_recorder_;
646 scoped_ptr< ::wm::NestedAcceleratorController> nested_accelerator_controller_;
647 scoped_ptr<AcceleratorController> accelerator_controller_;
648 scoped_ptr<ShellDelegate> delegate_;
649 scoped_ptr<SystemTrayDelegate> system_tray_delegate_;
650 scoped_ptr<SystemTrayNotifier> system_tray_notifier_;
651 scoped_ptr<UserWallpaperDelegate> user_wallpaper_delegate_;
652 scoped_ptr<SessionStateDelegate> session_state_delegate_;
653 scoped_ptr<AccessibilityDelegate> accessibility_delegate_;
654 scoped_ptr<NewWindowDelegate> new_window_delegate_;
655 scoped_ptr<MediaDelegate> media_delegate_;
656 scoped_ptr<ShelfDelegate> shelf_delegate_;
657 scoped_ptr<ShelfItemDelegateManager> shelf_item_delegate_manager_;
658 scoped_ptr<ShelfWindowWatcher> shelf_window_watcher_;
660 scoped_ptr<ShelfModel> shelf_model_;
661 scoped_ptr<WindowPositioner> window_positioner_;
663 scoped_ptr<AppListController> app_list_controller_;
665 scoped_ptr<DragDropController> drag_drop_controller_;
666 scoped_ptr<ResizeShadowController> resize_shadow_controller_;
667 scoped_ptr< ::wm::ShadowController> shadow_controller_;
668 scoped_ptr< ::wm::VisibilityController> visibility_controller_;
669 scoped_ptr< ::wm::WindowModalityController> window_modality_controller_;
670 scoped_ptr<views::corewm::TooltipController> tooltip_controller_;
671 scoped_ptr<DesktopBackgroundController> desktop_background_controller_;
672 scoped_ptr<PowerButtonController> power_button_controller_;
673 scoped_ptr<LockStateController> lock_state_controller_;
674 scoped_ptr<MruWindowTracker> mru_window_tracker_;
675 scoped_ptr< ::wm::UserActivityDetector> user_activity_detector_;
676 scoped_ptr<VideoDetector> video_detector_;
677 scoped_ptr<WindowCycleController> window_cycle_controller_;
678 scoped_ptr<WindowSelectorController> window_selector_controller_;
679 scoped_ptr<FocusCycler> focus_cycler_;
680 scoped_ptr<DisplayController> display_controller_;
681 scoped_ptr<HighContrastController> high_contrast_controller_;
682 scoped_ptr<MagnificationController> magnification_controller_;
683 scoped_ptr<PartialMagnificationController> partial_magnification_controller_;
684 scoped_ptr<AutoclickController> autoclick_controller_;
685 scoped_ptr<aura::client::FocusClient> focus_client_;
686 aura::client::ActivationClient* activation_client_;
688 scoped_ptr<MouseCursorEventFilter> mouse_cursor_filter_;
689 scoped_ptr<ScreenPositionController> screen_position_controller_;
690 scoped_ptr<SystemModalContainerEventFilter> modality_filter_;
691 scoped_ptr<EventClientImpl> event_client_;
692 scoped_ptr<EventTransformationHandler> event_transformation_handler_;
694 // An event filter that pre-handles key events while the partial
695 // screenshot UI or the keyboard overlay is active.
696 scoped_ptr<OverlayEventFilter> overlay_filter_;
698 // An event filter for logging keyboard-related metrics.
699 scoped_ptr<KeyboardUMAEventFilter> keyboard_metrics_filter_;
701 // An event filter which handles moving and resizing windows.
702 scoped_ptr<ToplevelWindowEventHandler> toplevel_window_event_handler_;
704 // An event filter which handles system level gestures
705 scoped_ptr<SystemGestureEventFilter> system_gesture_filter_;
707 // An event filter that pre-handles global accelerators.
708 scoped_ptr< ::wm::AcceleratorFilter> accelerator_filter_;
710 // An event filter that pre-handles all key events to send them to an IME.
711 scoped_ptr< ::wm::InputMethodEventFilter> input_method_filter_;
713 scoped_ptr<DisplayManager> display_manager_;
715 scoped_ptr<LocaleNotificationController> locale_notification_controller_;
717 #if defined(OS_CHROMEOS)
718 scoped_ptr<chromeos::AccelerometerReader> accelerometer_reader_;
719 scoped_ptr<PowerEventObserver> power_event_observer_;
720 scoped_ptr<ui::UserActivityPowerManagerNotifier> user_activity_notifier_;
721 scoped_ptr<VideoActivityNotifier> video_activity_notifier_;
722 scoped_ptr<StickyKeysController> sticky_keys_controller_;
723 scoped_ptr<ResolutionNotificationController>
724 resolution_notification_controller_;
725 scoped_ptr<BluetoothNotificationController>
726 bluetooth_notification_controller_;
727 scoped_ptr<LogoutConfirmationController> logout_confirmation_controller_;
728 scoped_ptr<LastWindowClosedLogoutReminder>
729 last_window_closed_logout_reminder_;
730 scoped_ptr<VirtualKeyboardController> virtual_keyboard_controller_;
731 // Controls video output device state.
732 scoped_ptr<ui::DisplayConfigurator> display_configurator_;
733 scoped_ptr<DisplayConfiguratorAnimation> display_configurator_animation_;
734 scoped_ptr<DisplayErrorObserver> display_error_observer_;
735 scoped_ptr<ProjectingObserver> projecting_observer_;
737 // Listens for output changes and updates the display manager.
738 scoped_ptr<DisplayChangeObserver> display_change_observer_;
740 // Implements content::ScreenOrientationDelegate for ChromeOS
741 scoped_ptr<ScreenOrientationDelegate> screen_orientation_delegate_;
743 scoped_ptr<TouchTransformerController> touch_transformer_controller_;
745 scoped_ptr<ui::EventHandler> magnifier_key_scroll_handler_;
746 scoped_ptr<ui::EventHandler> speech_feedback_handler_;
747 #endif // defined(OS_CHROMEOS)
749 scoped_ptr<MaximizeModeController> maximize_mode_controller_;
751 // |native_cursor_manager_| is owned by |cursor_manager_|, but we keep a
752 // pointer to vend to test code.
753 AshNativeCursorManager* native_cursor_manager_;
755 // Cursor may be hidden on certain key events in ChromeOS, whereas we never hide
756 // the cursor on Windows.
757 #if defined(OS_CHROMEOS)
758 CursorManager cursor_manager_;
759 #else // !defined(OS_CHROMEOS)
760 ::wm::CursorManager cursor_manager_;
761 #endif // defined(OS_CHROMEOS)
763 ObserverList<ShellObserver> observers_;
765 // For testing only: simulate that a modal window is open
766 bool simulate_modal_window_open_for_testing_;
768 bool is_touch_hud_projection_enabled_;
770 // Injected content::GPUDataManager support.
771 scoped_ptr<GPUSupport> gpu_support_;
773 DISALLOW_COPY_AND_ASSIGN(Shell);
776 } // namespace ash
778 #endif // ASH_SHELL_H_