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