Revert of [MemSheriff] Disable tests broken under MSAN (patchset #1 id:1 of https...
[chromium-blink-merge.git] / ash / shell.h
blobc9f4eb0fe3a55afadc1e68e4cd24e133ec0e95d6
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 UserActivityDetector;
61 class UserActivityPowerManagerNotifier;
63 namespace views {
64 class NonClientFrameView;
65 class Widget;
66 namespace corewm {
67 class TooltipController;
71 namespace wm {
72 class AcceleratorFilter;
73 class CompoundEventFilter;
74 class InputMethodEventFilter;
75 class NestedAcceleratorController;
76 class ShadowController;
77 class VisibilityController;
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 UserWallpaperDelegate;
149 class VirtualKeyboardController;
150 class VideoActivityNotifier;
151 class VideoDetector;
152 class WebNotificationTray;
153 class WindowCycleController;
154 class WindowPositioner;
155 class WindowSelectorController;
157 namespace shell {
158 class WindowWatcher;
161 namespace test {
162 class ShellTestApi;
165 // Shell is a singleton object that presents the Shell API and implements the
166 // RootWindow's delegate interface.
168 // Upon creation, the Shell sets itself as the RootWindow's delegate, which
169 // takes ownership of the Shell.
170 class ASH_EXPORT Shell : public SystemModalContainerEventFilterDelegate,
171 public ui::EventTarget,
172 public aura::client::ActivationChangeObserver {
173 public:
174 typedef std::vector<RootWindowController*> RootWindowControllerList;
176 enum Direction {
177 FORWARD,
178 BACKWARD
181 // A shell must be explicitly created so that it can call |Init()| with the
182 // delegate set. |delegate| can be NULL (if not required for initialization).
183 // Takes ownership of |delegate|.
184 static Shell* CreateInstance(const ShellInitParams& init_params);
186 // Should never be called before |CreateInstance()|.
187 static Shell* GetInstance();
189 // Returns true if the ash shell has been instantiated.
190 static bool HasInstance();
192 static void DeleteInstance();
194 // Returns the root window controller for the primary root window.
195 // TODO(oshima): move this to |RootWindowController|
196 static RootWindowController* GetPrimaryRootWindowController();
198 // Returns all root window controllers.
199 // TODO(oshima): move this to |RootWindowController|
200 static RootWindowControllerList GetAllRootWindowControllers();
202 // Returns the primary root Window. The primary root Window is the one that
203 // has a launcher.
204 static aura::Window* GetPrimaryRootWindow();
206 // Returns a root Window when used as a target when creating a new window.
207 // The root window of the active window is used in most cases, but can
208 // be overridden by using ScopedTargetRootWindow().
209 // If you want to get the root Window of the active window, just use
210 // |wm::GetActiveWindow()->GetRootWindow()|.
211 static aura::Window* GetTargetRootWindow();
213 // Returns the global Screen object that's always active in ash.
214 static gfx::Screen* GetScreen();
216 // Returns all root windows.
217 static aura::Window::Windows GetAllRootWindows();
219 static aura::Window* GetContainer(aura::Window* root_window,
220 int container_id);
221 static const aura::Window* GetContainer(const aura::Window* root_window,
222 int container_id);
224 // Returns the list of containers that match |container_id| in
225 // all root windows. If |priority_root| is given, the container
226 // in the |priority_root| will be inserted at the top of the list.
227 static std::vector<aura::Window*> GetContainersFromAllRootWindows(
228 int container_id,
229 aura::Window* priority_root);
231 void set_target_root_window(aura::Window* target_root_window) {
232 target_root_window_ = target_root_window;
235 // Shows the context menu for the background and launcher at
236 // |location_in_screen| (in screen coordinates).
237 void ShowContextMenu(const gfx::Point& location_in_screen,
238 ui::MenuSourceType source_type);
240 // Shows the app list. |window| specifies in which display the app
241 // list should be shown. If this is NULL, the active root window
242 // will be used.
243 void ShowAppList(aura::Window* anchor);
245 // Dismisses the app list.
246 void DismissAppList();
248 // Shows the app list if it's not visible. Dismisses it otherwise.
249 void ToggleAppList(aura::Window* anchor);
251 // Returns app list target visibility.
252 bool GetAppListTargetVisibility() const;
254 // Returns app list window or NULL if it is not visible.
255 aura::Window* GetAppListWindow();
257 // Returns app list view or NULL if it is not visible.
258 app_list::AppListView* GetAppListView();
260 // Returns true if a system-modal dialog window is currently open.
261 bool IsSystemModalWindowOpen() const;
263 // For testing only: set simulation that a modal window is open
264 void SimulateModalWindowOpenForTesting(bool modal_window_open) {
265 simulate_modal_window_open_for_testing_ = modal_window_open;
268 // Creates a default views::NonClientFrameView for use by windows in the
269 // Ash environment.
270 views::NonClientFrameView* CreateDefaultNonClientFrameView(
271 views::Widget* widget);
273 // Rotates focus through containers that can receive focus.
274 void RotateFocus(Direction direction);
276 // Sets the work area insets of the display that contains |window|,
277 // this notifies observers too.
278 // TODO(sky): this no longer really replicates what happens and is unreliable.
279 // Remove this.
280 void SetDisplayWorkAreaInsets(aura::Window* window,
281 const gfx::Insets& insets);
283 // Called when the user logs in.
284 void OnLoginStateChanged(user::LoginStatus status);
286 // Called after the logged-in user's profile is ready.
287 void OnLoginUserProfilePrepared();
289 // Called when the login status changes.
290 // TODO(oshima): Investigate if we can merge this and |OnLoginStateChanged|.
291 void UpdateAfterLoginStatusChange(user::LoginStatus status);
293 // Called when the application is exiting.
294 void OnAppTerminating();
296 // Called when the screen is locked (after the lock window is visible) or
297 // unlocked.
298 void OnLockStateChanged(bool locked);
300 // Called when a casting session is started or stopped.
301 void OnCastingSessionStartedOrStopped(bool started);
303 // Called when the overview mode is about to be started (before the windows
304 // get re-arranged).
305 void OnOverviewModeStarting();
307 // Called before the overview mode is ending (before the windows get arranged
308 // to their final position).
309 void OnOverviewModeEnding();
311 // Called after maximize mode has started, windows might still animate though.
312 void OnMaximizeModeStarted();
314 // Called after maximize mode has ended, windows might still be returning to
315 // their original position.
316 void OnMaximizeModeEnded();
318 // Called when a root window is created.
319 void OnRootWindowAdded(aura::Window* root_window);
321 // Initializes |shelf_|. Does nothing if it's already initialized.
322 void CreateShelf();
324 // Called when the shelf is created for |root_window|.
325 void OnShelfCreatedForRootWindow(aura::Window* root_window);
327 // Creates a virtual keyboard. Deletes the old virtual keyboard if it already
328 // exists.
329 void CreateKeyboard();
331 // Deactivates the virtual keyboard.
332 void DeactivateKeyboard();
334 // Show shelf view if it was created hidden (before session has started).
335 void ShowShelf();
337 // Adds/removes observer.
338 void AddShellObserver(ShellObserver* observer);
339 void RemoveShellObserver(ShellObserver* observer);
341 #if defined(OS_CHROMEOS)
342 // Test if MaximizeModeWindowManager is not enabled, and if
343 // MaximizeModeController is not currently setting a display rotation. Or if
344 // the |resolution_notification_controller_| is not showing its confirmation
345 // dialog. If true then changes to display settings can be saved.
346 bool ShouldSaveDisplaySettings();
347 #endif
349 AcceleratorController* accelerator_controller() {
350 return accelerator_controller_.get();
353 DisplayManager* display_manager() { return display_manager_.get(); }
354 ::wm::InputMethodEventFilter* input_method_filter() {
355 return input_method_filter_.get();
357 ::wm::CompoundEventFilter* env_filter() {
358 return env_filter_.get();
360 views::corewm::TooltipController* tooltip_controller() {
361 return tooltip_controller_.get();
363 OverlayEventFilter* overlay_filter() { return overlay_filter_.get(); }
364 DesktopBackgroundController* desktop_background_controller() {
365 return desktop_background_controller_.get();
367 PowerButtonController* power_button_controller() {
368 return power_button_controller_.get();
370 LockStateController* lock_state_controller() {
371 return lock_state_controller_.get();
373 MruWindowTracker* mru_window_tracker() {
374 return mru_window_tracker_.get();
376 VideoDetector* video_detector() {
377 return video_detector_.get();
379 WindowCycleController* window_cycle_controller() {
380 return window_cycle_controller_.get();
382 WindowSelectorController* window_selector_controller() {
383 return window_selector_controller_.get();
385 FocusCycler* focus_cycler() { return focus_cycler_.get(); }
386 DisplayController* display_controller() {
387 return display_controller_.get();
389 #if defined(OS_CHROMEOS)
390 TouchTransformerController* touch_transformer_controller() {
391 return touch_transformer_controller_.get();
393 #endif // defined(OS_CHROMEOS)
394 MouseCursorEventFilter* mouse_cursor_filter() {
395 return mouse_cursor_filter_.get();
397 EventTransformationHandler* event_transformation_handler() {
398 return event_transformation_handler_.get();
400 ::wm::CursorManager* cursor_manager() { return &cursor_manager_; }
402 ShellDelegate* delegate() { return delegate_.get(); }
404 UserWallpaperDelegate* user_wallpaper_delegate() {
405 return user_wallpaper_delegate_.get();
408 SessionStateDelegate* session_state_delegate() {
409 return session_state_delegate_.get();
412 AccessibilityDelegate* accessibility_delegate() {
413 return accessibility_delegate_.get();
416 NewWindowDelegate* new_window_delegate() {
417 return new_window_delegate_.get();
420 MediaDelegate* media_delegate() {
421 return media_delegate_.get();
424 HighContrastController* high_contrast_controller() {
425 return high_contrast_controller_.get();
428 MagnificationController* magnification_controller() {
429 return magnification_controller_.get();
432 PartialMagnificationController* partial_magnification_controller() {
433 return partial_magnification_controller_.get();
436 AutoclickController* autoclick_controller() {
437 return autoclick_controller_.get();
440 aura::client::ActivationClient* activation_client() {
441 return activation_client_;
444 ShelfItemDelegateManager* shelf_item_delegate_manager() {
445 return shelf_item_delegate_manager_.get();
448 // Force the shelf to query for it's current visibility state.
449 void UpdateShelfVisibility();
451 // TODO(oshima): Define an interface to access shelf/launcher
452 // state, or just use Launcher.
454 // Sets/gets the shelf auto-hide behavior on |root_window|.
455 void SetShelfAutoHideBehavior(ShelfAutoHideBehavior behavior,
456 aura::Window* root_window);
457 ShelfAutoHideBehavior GetShelfAutoHideBehavior(
458 aura::Window* root_window) const;
460 // Sets/gets shelf's alignment on |root_window|.
461 void SetShelfAlignment(ShelfAlignment alignment,
462 aura::Window* root_window);
463 ShelfAlignment GetShelfAlignment(const aura::Window* root_window);
465 // Dims or undims the screen.
466 void SetDimming(bool should_dim);
468 // Notifies |observers_| when entering or exiting fullscreen mode in
469 // |root_window|.
470 void NotifyFullscreenStateChange(bool is_fullscreen,
471 aura::Window* root_window);
473 // Creates a modal background (a partially-opaque fullscreen window)
474 // on all displays for |window|.
475 void CreateModalBackground(aura::Window* window);
477 // Called when a modal window is removed. It will activate
478 // another modal window if any, or remove modal screens
479 // on all displays.
480 void OnModalWindowRemoved(aura::Window* removed);
482 // Returns WebNotificationTray on the primary root window.
483 WebNotificationTray* GetWebNotificationTray();
485 // Does the primary display have status area?
486 bool HasPrimaryStatusArea();
488 // Returns the system tray on primary display.
489 SystemTray* GetPrimarySystemTray();
491 SystemTrayDelegate* system_tray_delegate() {
492 return system_tray_delegate_.get();
495 SystemTrayNotifier* system_tray_notifier() {
496 return system_tray_notifier_.get();
499 static void set_initially_hide_cursor(bool hide) {
500 initially_hide_cursor_ = hide;
503 ResizeShadowController* resize_shadow_controller() {
504 return resize_shadow_controller_.get();
507 // Made available for tests.
508 ::wm::ShadowController* shadow_controller() {
509 return shadow_controller_.get();
512 // Starts the animation that occurs on first login.
513 void DoInitialWorkspaceAnimation();
515 MaximizeModeController* maximize_mode_controller() {
516 return maximize_mode_controller_.get();
519 #if defined(OS_CHROMEOS)
520 chromeos::AccelerometerReader* accelerometer_reader() {
521 return accelerometer_reader_.get();
524 // TODO(oshima): Move these objects to DisplayController.
525 ui::DisplayConfigurator* display_configurator() {
526 return display_configurator_.get();
528 DisplayConfiguratorAnimation* display_configurator_animation() {
529 return display_configurator_animation_.get();
531 DisplayErrorObserver* display_error_observer() {
532 return display_error_observer_.get();
535 ResolutionNotificationController* resolution_notification_controller() {
536 return resolution_notification_controller_.get();
539 LogoutConfirmationController* logout_confirmation_controller() {
540 return logout_confirmation_controller_.get();
543 ScreenOrientationDelegate* screen_orientation_delegate() {
544 return screen_orientation_delegate_.get();
547 VirtualKeyboardController* virtual_keyboard_controller() {
548 return virtual_keyboard_controller_.get();
550 #endif // defined(OS_CHROMEOS)
552 ShelfModel* shelf_model() {
553 return shelf_model_.get();
556 WindowPositioner* window_positioner() {
557 return window_positioner_.get();
560 // Returns the launcher delegate, creating if necesary.
561 ShelfDelegate* GetShelfDelegate();
563 UserMetricsRecorder* metrics() {
564 return user_metrics_recorder_.get();
567 void SetTouchHudProjectionEnabled(bool enabled);
569 bool is_touch_hud_projection_enabled() const {
570 return is_touch_hud_projection_enabled_;
573 #if defined(OS_CHROMEOS)
574 // Creates instance of FirstRunHelper. Caller is responsible for deleting
575 // returned object.
576 ash::FirstRunHelper* CreateFirstRunHelper();
578 // Toggles cursor compositing on/off. Native cursor is disabled when cursor
579 // compositing is enabled, and vice versa.
580 void SetCursorCompositingEnabled(bool enabled);
582 StickyKeysController* sticky_keys_controller() {
583 return sticky_keys_controller_.get();
585 #endif // defined(OS_CHROMEOS)
587 GPUSupport* gpu_support() { return gpu_support_.get(); }
589 private:
590 FRIEND_TEST_ALL_PREFIXES(ExtendedDesktopTest, TestCursor);
591 FRIEND_TEST_ALL_PREFIXES(WindowManagerTest, MouseEventCursors);
592 FRIEND_TEST_ALL_PREFIXES(WindowManagerTest, TransformActivate);
593 friend class RootWindowController;
594 friend class ScopedTargetRootWindow;
595 friend class test::ShellTestApi;
596 friend class shell::WindowWatcher;
598 typedef std::pair<aura::Window*, gfx::Rect> WindowAndBoundsPair;
600 // Takes ownership of |delegate|.
601 explicit Shell(ShellDelegate* delegate);
602 ~Shell() override;
604 void Init(const ShellInitParams& init_params);
606 // Initializes virtual keyboard controller.
607 void InitKeyboard();
609 // Initializes the root window so that it can host browser windows.
610 void InitRootWindow(aura::Window* root_window);
612 // ash::SystemModalContainerEventFilterDelegate overrides:
613 bool CanWindowReceiveEvents(aura::Window* window) override;
615 // Overridden from ui::EventTarget:
616 bool CanAcceptEvent(const ui::Event& event) override;
617 EventTarget* GetParentTarget() override;
618 scoped_ptr<ui::EventTargetIterator> GetChildIterator() const override;
619 ui::EventTargeter* GetEventTargeter() override;
620 void OnEvent(ui::Event* event) override;
622 // Overridden from aura::client::ActivationChangeObserver:
623 void OnWindowActivated(aura::Window* gained_active,
624 aura::Window* lost_active) override;
626 static Shell* instance_;
628 // If set before the Shell is initialized, the mouse cursor will be hidden
629 // when the screen is initially created.
630 static bool initially_hide_cursor_;
632 // When no explicit target display/RootWindow is given, new windows are
633 // created on |scoped_target_root_window_| , unless NULL in
634 // which case they are created on |target_root_window_|.
635 // |target_root_window_| never becomes NULL during the session.
636 aura::Window* target_root_window_;
637 aura::Window* scoped_target_root_window_;
639 // The CompoundEventFilter owned by aura::Env object.
640 scoped_ptr< ::wm::CompoundEventFilter> env_filter_;
642 std::vector<WindowAndBoundsPair> to_restore_;
644 scoped_ptr<UserMetricsRecorder> user_metrics_recorder_;
645 scoped_ptr< ::wm::NestedAcceleratorController> nested_accelerator_controller_;
646 scoped_ptr<AcceleratorController> accelerator_controller_;
647 scoped_ptr<ShellDelegate> delegate_;
648 scoped_ptr<SystemTrayDelegate> system_tray_delegate_;
649 scoped_ptr<SystemTrayNotifier> system_tray_notifier_;
650 scoped_ptr<UserWallpaperDelegate> user_wallpaper_delegate_;
651 scoped_ptr<SessionStateDelegate> session_state_delegate_;
652 scoped_ptr<AccessibilityDelegate> accessibility_delegate_;
653 scoped_ptr<NewWindowDelegate> new_window_delegate_;
654 scoped_ptr<MediaDelegate> media_delegate_;
655 scoped_ptr<ShelfDelegate> shelf_delegate_;
656 scoped_ptr<ShelfItemDelegateManager> shelf_item_delegate_manager_;
657 scoped_ptr<ShelfWindowWatcher> shelf_window_watcher_;
659 scoped_ptr<ShelfModel> shelf_model_;
660 scoped_ptr<WindowPositioner> window_positioner_;
662 scoped_ptr<AppListController> app_list_controller_;
664 scoped_ptr<DragDropController> drag_drop_controller_;
665 scoped_ptr<ResizeShadowController> resize_shadow_controller_;
666 scoped_ptr< ::wm::ShadowController> shadow_controller_;
667 scoped_ptr< ::wm::VisibilityController> visibility_controller_;
668 scoped_ptr< ::wm::WindowModalityController> window_modality_controller_;
669 scoped_ptr<views::corewm::TooltipController> tooltip_controller_;
670 scoped_ptr<DesktopBackgroundController> desktop_background_controller_;
671 scoped_ptr<PowerButtonController> power_button_controller_;
672 scoped_ptr<LockStateController> lock_state_controller_;
673 scoped_ptr<MruWindowTracker> mru_window_tracker_;
674 scoped_ptr<ui::UserActivityDetector> user_activity_detector_;
675 scoped_ptr<VideoDetector> video_detector_;
676 scoped_ptr<WindowCycleController> window_cycle_controller_;
677 scoped_ptr<WindowSelectorController> window_selector_controller_;
678 scoped_ptr<FocusCycler> focus_cycler_;
679 scoped_ptr<DisplayController> display_controller_;
680 scoped_ptr<HighContrastController> high_contrast_controller_;
681 scoped_ptr<MagnificationController> magnification_controller_;
682 scoped_ptr<PartialMagnificationController> partial_magnification_controller_;
683 scoped_ptr<AutoclickController> autoclick_controller_;
684 scoped_ptr<aura::client::FocusClient> focus_client_;
685 aura::client::ActivationClient* activation_client_;
687 scoped_ptr<MouseCursorEventFilter> mouse_cursor_filter_;
688 scoped_ptr<ScreenPositionController> screen_position_controller_;
689 scoped_ptr<SystemModalContainerEventFilter> modality_filter_;
690 scoped_ptr<EventClientImpl> event_client_;
691 scoped_ptr<EventTransformationHandler> event_transformation_handler_;
693 // An event filter that pre-handles key events while the partial
694 // screenshot UI or the keyboard overlay is active.
695 scoped_ptr<OverlayEventFilter> overlay_filter_;
697 // An event filter for logging keyboard-related metrics.
698 scoped_ptr<KeyboardUMAEventFilter> keyboard_metrics_filter_;
700 // An event filter which handles moving and resizing windows.
701 scoped_ptr<ToplevelWindowEventHandler> toplevel_window_event_handler_;
703 // An event filter which handles system level gestures
704 scoped_ptr<SystemGestureEventFilter> system_gesture_filter_;
706 // An event filter that pre-handles global accelerators.
707 scoped_ptr< ::wm::AcceleratorFilter> accelerator_filter_;
709 // An event filter that pre-handles all key events to send them to an IME.
710 scoped_ptr< ::wm::InputMethodEventFilter> input_method_filter_;
712 scoped_ptr<DisplayManager> display_manager_;
714 scoped_ptr<LocaleNotificationController> locale_notification_controller_;
716 #if defined(OS_CHROMEOS)
717 scoped_ptr<chromeos::AccelerometerReader> accelerometer_reader_;
718 scoped_ptr<PowerEventObserver> power_event_observer_;
719 scoped_ptr<ui::UserActivityPowerManagerNotifier> user_activity_notifier_;
720 scoped_ptr<VideoActivityNotifier> video_activity_notifier_;
721 scoped_ptr<StickyKeysController> sticky_keys_controller_;
722 scoped_ptr<ResolutionNotificationController>
723 resolution_notification_controller_;
724 scoped_ptr<BluetoothNotificationController>
725 bluetooth_notification_controller_;
726 scoped_ptr<LogoutConfirmationController> logout_confirmation_controller_;
727 scoped_ptr<LastWindowClosedLogoutReminder>
728 last_window_closed_logout_reminder_;
729 scoped_ptr<VirtualKeyboardController> virtual_keyboard_controller_;
730 // Controls video output device state.
731 scoped_ptr<ui::DisplayConfigurator> display_configurator_;
732 scoped_ptr<DisplayConfiguratorAnimation> display_configurator_animation_;
733 scoped_ptr<DisplayErrorObserver> display_error_observer_;
734 scoped_ptr<ProjectingObserver> projecting_observer_;
736 // Listens for output changes and updates the display manager.
737 scoped_ptr<DisplayChangeObserver> display_change_observer_;
739 // Implements content::ScreenOrientationDelegate for ChromeOS
740 scoped_ptr<ScreenOrientationDelegate> screen_orientation_delegate_;
742 scoped_ptr<TouchTransformerController> touch_transformer_controller_;
744 scoped_ptr<ui::EventHandler> magnifier_key_scroll_handler_;
745 scoped_ptr<ui::EventHandler> speech_feedback_handler_;
746 #endif // defined(OS_CHROMEOS)
748 scoped_ptr<MaximizeModeController> maximize_mode_controller_;
750 // |native_cursor_manager_| is owned by |cursor_manager_|, but we keep a
751 // pointer to vend to test code.
752 AshNativeCursorManager* native_cursor_manager_;
754 // Cursor may be hidden on certain key events in ChromeOS, whereas we never hide
755 // the cursor on Windows.
756 #if defined(OS_CHROMEOS)
757 CursorManager cursor_manager_;
758 #else // !defined(OS_CHROMEOS)
759 ::wm::CursorManager cursor_manager_;
760 #endif // defined(OS_CHROMEOS)
762 ObserverList<ShellObserver> observers_;
764 // For testing only: simulate that a modal window is open
765 bool simulate_modal_window_open_for_testing_;
767 bool is_touch_hud_projection_enabled_;
769 // Injected content::GPUDataManager support.
770 scoped_ptr<GPUSupport> gpu_support_;
772 DISALLOW_COPY_AND_ASSIGN(Shell);
775 } // namespace ash
777 #endif // ASH_SHELL_H_