Upstream version 7.35.139.0
[platform/framework/web/crosswalk.git] / src / ash / shell.h
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.
4
5 #ifndef ASH_SHELL_H_
6 #define ASH_SHELL_H_
7
8 #include <utility>
9 #include <vector>
10
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/system_modal_container_event_filter_delegate.h"
16 #include "base/basictypes.h"
17 #include "base/compiler_specific.h"
18 #include "base/gtest_prod_util.h"
19 #include "base/memory/scoped_ptr.h"
20 #include "base/memory/weak_ptr.h"
21 #include "base/observer_list.h"
22 #include "ui/aura/window.h"
23 #include "ui/base/ui_base_types.h"
24 #include "ui/events/event_target.h"
25 #include "ui/gfx/insets.h"
26 #include "ui/gfx/screen.h"
27 #include "ui/gfx/size.h"
28 #include "ui/wm/core/cursor_manager.h"
29 #include "ui/wm/public/activation_change_observer.h"
30
31 namespace app_list {
32 class AppListView;
33 }
34 namespace aura {
35 class EventFilter;
36 class RootWindow;
37 class Window;
38 namespace client {
39 class ActivationClient;
40 class FocusClient;
41 }
42 }
43
44 namespace gfx {
45 class ImageSkia;
46 class Point;
47 class Rect;
48 }
49
50 namespace keyboard {
51 class KeyboardController;
52 }
53
54 namespace ui {
55 class Layer;
56 class OutputConfigurator;
57 }
58 namespace views {
59 class NonClientFrameView;
60 class Widget;
61 namespace corewm {
62 class TooltipController;
63 }
64 }
65
66 namespace wm {
67 class CompoundEventFilter;
68 class InputMethodEventFilter;
69 class ShadowController;
70 class VisibilityController;
71 class WindowModalityController;
72 }
73
74 namespace ash {
75
76 class AcceleratorController;
77 class AccelerometerController;
78 class AccessibilityDelegate;
79 class AshNativeCursorManager;
80 class AutoclickController;
81 class DesktopBackgroundController;
82 class DisplayController;
83 class FirstRunHelper;
84 class GPUSupport;
85 class HighContrastController;
86 class LockStateController;
87 class MagnificationController;
88 class MaximizeModeController;
89 class MediaDelegate;
90 class MruWindowTracker;
91 class NestedDispatcherController;
92 class NewWindowDelegate;
93 class PartialMagnificationController;
94 class PowerButtonController;
95 class WindowTreeHostFactory;
96 class ScreenAsh;
97 class SessionStateDelegate;
98 class Shelf;
99 class ShelfDelegate;
100 class ShelfItemDelegateManager;
101 class ShelfModel;
102 class ShellDelegate;
103 class ShellObserver;
104 class StickyKeysController;
105 class SystemTray;
106 class SystemTrayDelegate;
107 class SystemTrayNotifier;
108 class ToplevelWindowEventHandler;
109 class UserActivityDetector;
110 class UserWallpaperDelegate;
111 class VideoDetector;
112 class WebNotificationTray;
113 class WindowCycleController;
114 class WindowPositioner;
115 class WindowSelectorController;
116
117 namespace internal {
118 class AcceleratorFilter;
119 class AppListController;
120 class BluetoothNotificationController;
121 class CaptureController;
122 class DisplayChangeObserver;
123 class DisplayErrorObserver;
124 class DisplayManager;
125 class DragDropController;
126 class EventClientImpl;
127 class EventRewriterEventFilter;
128 class EventTransformationHandler;
129 class FocusCycler;
130 class KeyboardUMAEventFilter;
131 class LastWindowClosedLogoutReminder;
132 class LocaleNotificationController;
133 class LogoutConfirmationController;
134 class MaximizeModeWindowManager;
135 class MouseCursorEventFilter;
136 class OutputConfiguratorAnimation;
137 class OverlayEventFilter;
138 class PowerEventObserver;
139 class ProjectingObserver;
140 class ResizeShadowController;
141 class ResolutionNotificationController;
142 class RootWindowController;
143 class ScopedTargetRootWindow;
144 class ScreenPositionController;
145 class ShelfWindowWatcher;
146 class SlowAnimationEventFilter;
147 class StatusAreaWidget;
148 class SystemGestureEventFilter;
149 class SystemModalContainerEventFilter;
150 class TouchObserverHUD;
151 class UserActivityNotifier;
152 class VideoActivityNotifier;
153 }
154
155 namespace shell {
156 class WindowWatcher;
157 }
158
159 namespace test {
160 class ShellTestApi;
161 }
162
163 // Shell is a singleton object that presents the Shell API and implements the
164 // RootWindow's delegate interface.
165 //
166 // Upon creation, the Shell sets itself as the RootWindow's delegate, which
167 // takes ownership of the Shell.
168 class ASH_EXPORT Shell
169     : public internal::SystemModalContainerEventFilterDelegate,
170       public ui::EventTarget,
171       public aura::client::ActivationChangeObserver {
172  public:
173   typedef std::vector<internal::RootWindowController*> RootWindowControllerList;
174
175   enum Direction {
176     FORWARD,
177     BACKWARD
178   };
179
180   // A shell must be explicitly created so that it can call |Init()| with the
181   // delegate set. |delegate| can be NULL (if not required for initialization).
182   // Takes ownership of |delegate|.
183   static Shell* CreateInstance(ShellDelegate* delegate);
184
185   // Should never be called before |CreateInstance()|.
186   static Shell* GetInstance();
187
188   // Returns true if the ash shell has been instantiated.
189   static bool HasInstance();
190
191   static void DeleteInstance();
192
193   // Returns the root window controller for the primary root window.
194   // TODO(oshima): move this to |RootWindowController|
195   static internal::RootWindowController* GetPrimaryRootWindowController();
196
197   // Returns all root window controllers.
198   // TODO(oshima): move this to |RootWindowController|
199   static RootWindowControllerList GetAllRootWindowControllers();
200
201   // Returns the primary root Window. The primary root Window is the one that
202   // has a launcher.
203   static aura::Window* GetPrimaryRootWindow();
204
205   // Returns a root Window when used as a target when creating a new window.
206   // The root window of the active window is used in most cases, but can
207   // be overridden by using ScopedTargetRootWindow().
208   // If you want to get the root Window of the active window, just use
209   // |wm::GetActiveWindow()->GetRootWindow()|.
210   static aura::Window* GetTargetRootWindow();
211
212   // Returns the global Screen object that's always active in ash.
213   static gfx::Screen* GetScreen();
214
215   // Returns all root windows.
216   static aura::Window::Windows GetAllRootWindows();
217
218   static aura::Window* GetContainer(aura::Window* root_window,
219                                     int container_id);
220   static const aura::Window* GetContainer(const aura::Window* root_window,
221                                           int container_id);
222
223   // Returns the list of containers that match |container_id| in
224   // all root windows. If |priority_root| is given, the container
225   // in the |priority_root| will be inserted at the top of the list.
226   static std::vector<aura::Window*> GetContainersFromAllRootWindows(
227       int container_id,
228       aura::Window* priority_root);
229
230   void set_target_root_window(aura::Window* target_root_window) {
231     target_root_window_ = target_root_window;
232   }
233
234   // Shows the context menu for the background and launcher at
235   // |location_in_screen| (in screen coordinates).
236   void ShowContextMenu(const gfx::Point& location_in_screen,
237                        ui::MenuSourceType source_type);
238
239   // Toggles the app list. |window| specifies in which display the app
240   // list should be shown. If this is NULL, the active root window
241   // will be used.
242   void ToggleAppList(aura::Window* anchor);
243
244   // Returns app list target visibility.
245   bool GetAppListTargetVisibility() const;
246
247   // Returns app list window or NULL if it is not visible.
248   aura::Window* GetAppListWindow();
249
250   // Returns app list view or NULL if it is not visible.
251   app_list::AppListView* GetAppListView();
252
253   // Returns true if a system-modal dialog window is currently open.
254   bool IsSystemModalWindowOpen() const;
255
256   // For testing only: set simulation that a modal window is open
257   void SimulateModalWindowOpenForTesting(bool modal_window_open) {
258     simulate_modal_window_open_for_testing_ = modal_window_open;
259   }
260
261   // Creates a default views::NonClientFrameView for use by windows in the
262   // Ash environment.
263   views::NonClientFrameView* CreateDefaultNonClientFrameView(
264       views::Widget* widget);
265
266   // Rotates focus through containers that can receive focus.
267   void RotateFocus(Direction direction);
268
269   // Sets the work area insets of the display that contains |window|,
270   // this notifies observers too.
271   // TODO(sky): this no longer really replicates what happens and is unreliable.
272   // Remove this.
273   void SetDisplayWorkAreaInsets(aura::Window* window,
274                                 const gfx::Insets& insets);
275
276   // Called when the user logs in.
277   void OnLoginStateChanged(user::LoginStatus status);
278
279   // Called after the logged-in user's profile is ready.
280   void OnLoginUserProfilePrepared();
281
282   // Called when the login status changes.
283   // TODO(oshima): Investigate if we can merge this and |OnLoginStateChanged|.
284   void UpdateAfterLoginStatusChange(user::LoginStatus status);
285
286   // Called when the application is exiting.
287   void OnAppTerminating();
288
289   // Called when the screen is locked (after the lock window is visible) or
290   // unlocked.
291   void OnLockStateChanged(bool locked);
292
293   // Called when a casting session is started or stopped.
294   void OnCastingSessionStartedOrStopped(bool started);
295
296   // Called when the overview mode is about to be started (before the windows
297   // get re-arranged).
298   void OnOverviewModeStarting();
299
300   // Called before the overview mode is ending (before the windows get arranged
301   // to their final position).
302   void OnOverviewModeEnding();
303
304   // Called after maximize mode has started, windows might still animate though.
305   void OnMaximizeModeStarted();
306
307   // Called after maximize mode has ended, windows might still be returning to
308   // their original position.
309   void OnMaximizeModeEnded();
310
311   // Initializes |shelf_|.  Does nothing if it's already initialized.
312   void CreateShelf();
313
314   // Creates a virtual keyboard. Deletes the old virtual keyboard if it already
315   // exists.
316   void CreateKeyboard();
317
318   // Deactivates the virtual keyboard.
319   void DeactivateKeyboard();
320
321   // Show shelf view if it was created hidden (before session has started).
322   void ShowShelf();
323
324   // Adds/removes observer.
325   void AddShellObserver(ShellObserver* observer);
326   void RemoveShellObserver(ShellObserver* observer);
327
328   // Turn the always maximize mode window manager on or off.
329   void EnableMaximizeModeWindowManager(bool enable);
330
331   // Test if the MaximizeModeWindowManager is enabled or not.
332   bool IsMaximizeModeWindowManagerEnabled();
333
334   keyboard::KeyboardController* keyboard_controller() {
335     return keyboard_controller_.get();
336   }
337
338   AcceleratorController* accelerator_controller() {
339     return accelerator_controller_.get();
340   }
341
342   internal::DisplayManager* display_manager() {
343     return display_manager_.get();
344   }
345   ::wm::InputMethodEventFilter* input_method_filter() {
346     return input_method_filter_.get();
347   }
348   ::wm::CompoundEventFilter* env_filter() {
349     return env_filter_.get();
350   }
351   views::corewm::TooltipController* tooltip_controller() {
352     return tooltip_controller_.get();
353   }
354   internal::OverlayEventFilter* overlay_filter() {
355     return overlay_filter_.get();
356   }
357   DesktopBackgroundController* desktop_background_controller() {
358     return desktop_background_controller_.get();
359   }
360   PowerButtonController* power_button_controller() {
361     return power_button_controller_.get();
362   }
363   LockStateController* lock_state_controller() {
364     return lock_state_controller_.get();
365   }
366   MruWindowTracker* mru_window_tracker() {
367     return mru_window_tracker_.get();
368   }
369   UserActivityDetector* user_activity_detector() {
370     return user_activity_detector_.get();
371   }
372   VideoDetector* video_detector() {
373     return video_detector_.get();
374   }
375   WindowSelectorController* window_selector_controller() {
376     return window_selector_controller_.get();
377   }
378   internal::FocusCycler* focus_cycler() {
379     return focus_cycler_.get();
380   }
381   DisplayController* display_controller() {
382     return display_controller_.get();
383   }
384   internal::MouseCursorEventFilter* mouse_cursor_filter() {
385     return mouse_cursor_filter_.get();
386   }
387   internal::EventTransformationHandler* event_transformation_handler() {
388     return event_transformation_handler_.get();
389   }
390   ::wm::CursorManager* cursor_manager() { return &cursor_manager_; }
391
392   ShellDelegate* delegate() { return delegate_.get(); }
393
394   UserWallpaperDelegate* user_wallpaper_delegate() {
395     return user_wallpaper_delegate_.get();
396   }
397
398   SessionStateDelegate* session_state_delegate() {
399     return session_state_delegate_.get();
400   }
401
402   AccessibilityDelegate* accessibility_delegate() {
403     return accessibility_delegate_.get();
404   }
405
406   NewWindowDelegate* new_window_delegate() {
407     return new_window_delegate_.get();
408   }
409
410   MediaDelegate* media_delegate() {
411     return media_delegate_.get();
412   }
413
414   HighContrastController* high_contrast_controller() {
415     return high_contrast_controller_.get();
416   }
417
418   MagnificationController* magnification_controller() {
419     return magnification_controller_.get();
420   }
421
422   PartialMagnificationController* partial_magnification_controller() {
423     return partial_magnification_controller_.get();
424   }
425
426   AutoclickController* autoclick_controller() {
427     return autoclick_controller_.get();
428   }
429
430   aura::client::ActivationClient* activation_client() {
431     return activation_client_;
432   }
433
434   ShelfItemDelegateManager* shelf_item_delegate_manager() {
435     return shelf_item_delegate_manager_.get();
436   }
437
438   // Force the shelf to query for it's current visibility state.
439   void UpdateShelfVisibility();
440
441   // TODO(oshima): Define an interface to access shelf/launcher
442   // state, or just use Launcher.
443
444   // Sets/gets the shelf auto-hide behavior on |root_window|.
445   void SetShelfAutoHideBehavior(ShelfAutoHideBehavior behavior,
446                                 aura::Window* root_window);
447   ShelfAutoHideBehavior GetShelfAutoHideBehavior(
448       aura::Window* root_window) const;
449
450   // Sets/gets shelf's alignment on |root_window|.
451   void SetShelfAlignment(ShelfAlignment alignment,
452                          aura::Window* root_window);
453   ShelfAlignment GetShelfAlignment(aura::Window* root_window);
454
455   // Dims or undims the screen.
456   void SetDimming(bool should_dim);
457
458   // Notifies |observers_| when entering or exiting fullscreen mode in
459   // |root_window|.
460   void NotifyFullscreenStateChange(bool is_fullscreen,
461                                    aura::Window* root_window);
462
463   // Creates a modal background (a partially-opaque fullscreen window)
464   // on all displays for |window|.
465   void CreateModalBackground(aura::Window* window);
466
467   // Called when a modal window is removed. It will activate
468   // another modal window if any, or remove modal screens
469   // on all displays.
470   void OnModalWindowRemoved(aura::Window* removed);
471
472   // Returns WebNotificationTray on the primary root window.
473   WebNotificationTray* GetWebNotificationTray();
474
475   // Does the primary display have status area?
476   bool HasPrimaryStatusArea();
477
478   // Returns the system tray on primary display.
479   SystemTray* GetPrimarySystemTray();
480
481   SystemTrayDelegate* system_tray_delegate() {
482     return system_tray_delegate_.get();
483   }
484
485   SystemTrayNotifier* system_tray_notifier() {
486     return system_tray_notifier_.get();
487   }
488
489   static void set_initially_hide_cursor(bool hide) {
490     initially_hide_cursor_ = hide;
491   }
492
493   internal::ResizeShadowController* resize_shadow_controller() {
494     return resize_shadow_controller_.get();
495   }
496
497   // Made available for tests.
498   ::wm::ShadowController* shadow_controller() {
499     return shadow_controller_.get();
500   }
501
502   // Starts the animation that occurs on first login.
503   void DoInitialWorkspaceAnimation();
504
505   AccelerometerController* accelerometer_controller() {
506     return accelerometer_controller_.get();
507   }
508
509   MaximizeModeController* maximize_mode_controller() {
510     return maximize_mode_controller_.get();
511   }
512
513 #if defined(OS_CHROMEOS)
514 #if defined(USE_X11)
515   // TODO(oshima): Move these objects to DisplayController.
516   ui::OutputConfigurator* output_configurator() {
517     return output_configurator_.get();
518   }
519   internal::OutputConfiguratorAnimation* output_configurator_animation() {
520     return output_configurator_animation_.get();
521   }
522   internal::DisplayErrorObserver* display_error_observer() {
523     return display_error_observer_.get();
524   }
525 #endif  // defined(USE_X11)
526
527   internal::ResolutionNotificationController*
528       resolution_notification_controller() {
529     return resolution_notification_controller_.get();
530   }
531
532   internal::LogoutConfirmationController* logout_confirmation_controller() {
533     return logout_confirmation_controller_.get();
534   }
535 #endif  // defined(OS_CHROMEOS)
536
537   WindowTreeHostFactory* window_tree_host_factory() {
538     return window_tree_host_factory_.get();
539   }
540
541   ShelfModel* shelf_model() {
542     return shelf_model_.get();
543   }
544
545   WindowPositioner* window_positioner() {
546     return window_positioner_.get();
547   }
548
549   // Returns the launcher delegate, creating if necesary.
550   ShelfDelegate* GetShelfDelegate();
551
552   UserMetricsRecorder* metrics() {
553     return user_metrics_recorder_.get();
554   }
555
556   void SetTouchHudProjectionEnabled(bool enabled);
557
558   bool is_touch_hud_projection_enabled() const {
559     return is_touch_hud_projection_enabled_;
560   }
561
562 #if defined(OS_CHROMEOS)
563   // Creates instance of FirstRunHelper. Caller is responsible for deleting
564   // returned object.
565   ash::FirstRunHelper* CreateFirstRunHelper();
566
567   // Toggles cursor compositing on/off. Native cursor is disabled when cursor
568   // compositing is enabled, and vice versa.
569   void SetCursorCompositingEnabled(bool enabled);
570
571   StickyKeysController* sticky_keys_controller() {
572     return sticky_keys_controller_.get();
573   }
574 #endif  // defined(OS_CHROMEOS)
575
576   GPUSupport* gpu_support() { return gpu_support_.get(); }
577
578  private:
579   FRIEND_TEST_ALL_PREFIXES(ExtendedDesktopTest, TestCursor);
580   FRIEND_TEST_ALL_PREFIXES(WindowManagerTest, MouseEventCursors);
581   FRIEND_TEST_ALL_PREFIXES(WindowManagerTest, TransformActivate);
582   friend class internal::RootWindowController;
583   friend class internal::ScopedTargetRootWindow;
584   friend class test::ShellTestApi;
585   friend class shell::WindowWatcher;
586
587   typedef std::pair<aura::Window*, gfx::Rect> WindowAndBoundsPair;
588
589   // Takes ownership of |delegate|.
590   explicit Shell(ShellDelegate* delegate);
591   virtual ~Shell();
592
593   void Init();
594
595   // Initializes virtual keyboard controller.
596   void InitKeyboard();
597
598   // Initializes the root window so that it can host browser windows.
599   void InitRootWindow(aura::Window* root_window);
600
601   // ash::internal::SystemModalContainerEventFilterDelegate overrides:
602   virtual bool CanWindowReceiveEvents(aura::Window* window) OVERRIDE;
603
604   // Overridden from ui::EventTarget:
605   virtual bool CanAcceptEvent(const ui::Event& event) OVERRIDE;
606   virtual EventTarget* GetParentTarget() OVERRIDE;
607   virtual scoped_ptr<ui::EventTargetIterator> GetChildIterator() const OVERRIDE;
608   virtual ui::EventTargeter* GetEventTargeter() OVERRIDE;
609   virtual void OnEvent(ui::Event* event) OVERRIDE;
610
611   // Overridden from aura::client::ActivationChangeObserver:
612   virtual void OnWindowActivated(aura::Window* gained_active,
613                                  aura::Window* lost_active) OVERRIDE;
614
615   static Shell* instance_;
616
617   // If set before the Shell is initialized, the mouse cursor will be hidden
618   // when the screen is initially created.
619   static bool initially_hide_cursor_;
620
621   // When no explicit target display/RootWindow is given, new windows are
622   // created on |scoped_target_root_window_| , unless NULL in
623   // which case they are created on |target_root_window_|.
624   // |target_root_window_| never becomes NULL during the session.
625   aura::Window* target_root_window_;
626   aura::Window* scoped_target_root_window_;
627
628   // The CompoundEventFilter owned by aura::Env object.
629   scoped_ptr< ::wm::CompoundEventFilter> env_filter_;
630
631   std::vector<WindowAndBoundsPair> to_restore_;
632
633   scoped_ptr<UserMetricsRecorder> user_metrics_recorder_;
634   scoped_ptr<keyboard::KeyboardController> keyboard_controller_;
635   scoped_ptr<NestedDispatcherController> nested_dispatcher_controller_;
636   scoped_ptr<AcceleratorController> accelerator_controller_;
637   scoped_ptr<ShellDelegate> delegate_;
638   scoped_ptr<SystemTrayDelegate> system_tray_delegate_;
639   scoped_ptr<SystemTrayNotifier> system_tray_notifier_;
640   scoped_ptr<UserWallpaperDelegate> user_wallpaper_delegate_;
641   scoped_ptr<SessionStateDelegate> session_state_delegate_;
642   scoped_ptr<AccessibilityDelegate> accessibility_delegate_;
643   scoped_ptr<NewWindowDelegate> new_window_delegate_;
644   scoped_ptr<MediaDelegate> media_delegate_;
645   scoped_ptr<ShelfDelegate> shelf_delegate_;
646   scoped_ptr<ShelfItemDelegateManager> shelf_item_delegate_manager_;
647   scoped_ptr<internal::ShelfWindowWatcher> shelf_window_watcher_;
648
649   scoped_ptr<ShelfModel> shelf_model_;
650   scoped_ptr<WindowPositioner> window_positioner_;
651
652   scoped_ptr<internal::AppListController> app_list_controller_;
653
654   scoped_ptr<internal::DragDropController> drag_drop_controller_;
655   scoped_ptr<internal::ResizeShadowController> resize_shadow_controller_;
656   scoped_ptr< ::wm::ShadowController> shadow_controller_;
657   scoped_ptr< ::wm::VisibilityController> visibility_controller_;
658   scoped_ptr< ::wm::WindowModalityController> window_modality_controller_;
659   scoped_ptr<views::corewm::TooltipController> tooltip_controller_;
660   scoped_ptr<DesktopBackgroundController> desktop_background_controller_;
661   scoped_ptr<PowerButtonController> power_button_controller_;
662   scoped_ptr<LockStateController> lock_state_controller_;
663   scoped_ptr<MruWindowTracker> mru_window_tracker_;
664   scoped_ptr<UserActivityDetector> user_activity_detector_;
665   scoped_ptr<VideoDetector> video_detector_;
666   scoped_ptr<WindowSelectorController> window_selector_controller_;
667   scoped_ptr<internal::FocusCycler> focus_cycler_;
668   scoped_ptr<DisplayController> display_controller_;
669   scoped_ptr<HighContrastController> high_contrast_controller_;
670   scoped_ptr<MagnificationController> magnification_controller_;
671   scoped_ptr<PartialMagnificationController> partial_magnification_controller_;
672   scoped_ptr<AutoclickController> autoclick_controller_;
673   scoped_ptr<aura::client::FocusClient> focus_client_;
674   aura::client::ActivationClient* activation_client_;
675   scoped_ptr<internal::MouseCursorEventFilter> mouse_cursor_filter_;
676   scoped_ptr<internal::ScreenPositionController> screen_position_controller_;
677   scoped_ptr<internal::SystemModalContainerEventFilter> modality_filter_;
678   scoped_ptr<internal::EventClientImpl> event_client_;
679   scoped_ptr<internal::EventTransformationHandler>
680       event_transformation_handler_;
681   scoped_ptr<WindowTreeHostFactory> window_tree_host_factory_;
682
683   // An event filter that pre-handles key events while the partial
684   // screenshot UI or the keyboard overlay is active.
685   scoped_ptr<internal::OverlayEventFilter> overlay_filter_;
686
687   // An event filter for logging keyboard-related metrics.
688   scoped_ptr<internal::KeyboardUMAEventFilter> keyboard_metrics_filter_;
689
690   // An event filter which handles moving and resizing windows.
691   scoped_ptr<ToplevelWindowEventHandler> toplevel_window_event_handler_;
692
693   // An event filter which handles system level gestures
694   scoped_ptr<internal::SystemGestureEventFilter> system_gesture_filter_;
695
696   // An event filter that pre-handles global accelerators.
697   scoped_ptr<internal::AcceleratorFilter> accelerator_filter_;
698
699   // An event filter that pre-handles all key events to send them to an IME.
700   scoped_ptr< ::wm::InputMethodEventFilter> input_method_filter_;
701
702   scoped_ptr<internal::DisplayManager> display_manager_;
703   scoped_ptr<base::WeakPtrFactory<internal::DisplayManager> >
704       weak_display_manager_factory_;
705
706   scoped_ptr<internal::LocaleNotificationController>
707       locale_notification_controller_;
708
709   // The maximized window manager (if enabled).
710   scoped_ptr<internal::MaximizeModeWindowManager> maximize_mode_window_manager_;
711
712   scoped_ptr<AccelerometerController> accelerometer_controller_;
713
714 #if defined(OS_CHROMEOS)
715   scoped_ptr<internal::PowerEventObserver> power_event_observer_;
716   scoped_ptr<internal::UserActivityNotifier> user_activity_notifier_;
717   scoped_ptr<internal::VideoActivityNotifier> video_activity_notifier_;
718   scoped_ptr<StickyKeysController> sticky_keys_controller_;
719   scoped_ptr<internal::ResolutionNotificationController>
720       resolution_notification_controller_;
721   scoped_ptr<internal::BluetoothNotificationController>
722       bluetooth_notification_controller_;
723   scoped_ptr<internal::LogoutConfirmationController>
724       logout_confirmation_controller_;
725   scoped_ptr<internal::LastWindowClosedLogoutReminder>
726       last_window_closed_logout_reminder_;
727 #if defined(USE_X11)
728   // Controls video output device state.
729   scoped_ptr<ui::OutputConfigurator> output_configurator_;
730   scoped_ptr<internal::OutputConfiguratorAnimation>
731       output_configurator_animation_;
732   scoped_ptr<internal::DisplayErrorObserver> display_error_observer_;
733   scoped_ptr<internal::ProjectingObserver> projecting_observer_;
734
735   // Listens for output changes and updates the display manager.
736   scoped_ptr<internal::DisplayChangeObserver> display_change_observer_;
737
738   scoped_ptr<ui::EventHandler> magnifier_key_scroll_handler_;
739   scoped_ptr<ui::EventHandler> speech_feedback_handler_;
740 #endif  // defined(USE_X11)
741 #endif  // defined(OS_CHROMEOS)
742
743   scoped_ptr<MaximizeModeController> maximize_mode_controller_;
744
745   // |native_cursor_manager_| is owned by |cursor_manager_|, but we keep a
746   // pointer to vend to test code.
747   AshNativeCursorManager* native_cursor_manager_;
748   ::wm::CursorManager cursor_manager_;
749
750   ObserverList<ShellObserver> observers_;
751
752   // For testing only: simulate that a modal window is open
753   bool simulate_modal_window_open_for_testing_;
754
755   bool is_touch_hud_projection_enabled_;
756
757   // Injected content::GPUDataManager support.
758   scoped_ptr<GPUSupport> gpu_support_;
759
760   DISALLOW_COPY_AND_ASSIGN(Shell);
761 };
762
763 }  // namespace ash
764
765 #endif  // ASH_SHELL_H_