blob: 7e3fab3ca17ebb50bfc4a13fbbc439acedc0feae [file] [log] [blame]
Torne (Richard Coles)58218062012-11-14 11:43:16 +00001// 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"
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +000012#include "ash/shelf/shelf_types.h"
Torne (Richard Coles)58218062012-11-14 11:43:16 +000013#include "ash/system/user/login_status.h"
Torne (Richard Coles)58218062012-11-14 11:43:16 +000014#include "ash/wm/system_modal_container_event_filter_delegate.h"
15#include "base/basictypes.h"
16#include "base/compiler_specific.h"
17#include "base/gtest_prod_util.h"
18#include "base/memory/scoped_ptr.h"
19#include "base/observer_list.h"
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +000020#include "ui/aura/client/activation_change_observer.h"
Torne (Richard Coles)58218062012-11-14 11:43:16 +000021#include "ui/base/events/event_target.h"
22#include "ui/gfx/insets.h"
23#include "ui/gfx/screen.h"
24#include "ui/gfx/size.h"
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +000025#include "ui/views/corewm/cursor_manager.h"
Torne (Richard Coles)58218062012-11-14 11:43:16 +000026
27class CommandLine;
28
29namespace aura {
30class EventFilter;
Torne (Richard Coles)58218062012-11-14 11:43:16 +000031class RootWindow;
32class Window;
33namespace client {
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +000034class ActivationClient;
35class FocusClient;
Torne (Richard Coles)58218062012-11-14 11:43:16 +000036class UserActionClient;
37}
Torne (Richard Coles)58218062012-11-14 11:43:16 +000038}
39namespace chromeos {
40class OutputConfigurator;
41}
42namespace content {
43class BrowserContext;
44}
45
46namespace gfx {
47class ImageSkia;
48class Point;
49class Rect;
50}
51namespace ui {
52class Layer;
53}
54namespace views {
55class NonClientFrameView;
56class Widget;
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +000057namespace corewm {
58class CompoundEventFilter;
59class InputMethodEventFilter;
60class ShadowController;
61class TooltipController;
62class VisibilityController;
63class WindowModalityController;
64}
Torne (Richard Coles)58218062012-11-14 11:43:16 +000065}
66
67namespace ash {
68
69class AcceleratorController;
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +000070class AshNativeCursorManager;
Torne (Richard Coles)58218062012-11-14 11:43:16 +000071class CapsLockDelegate;
72class DesktopBackgroundController;
73class DisplayController;
74class HighContrastController;
75class Launcher;
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +000076class LauncherDelegate;
77class LauncherModel;
78class MagnificationController;
Torne (Richard Coles)58218062012-11-14 11:43:16 +000079class NestedDispatcherController;
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +000080class PartialMagnificationController;
Torne (Richard Coles)58218062012-11-14 11:43:16 +000081class PowerButtonController;
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +000082class RootWindowHostFactory;
Torne (Richard Coles)58218062012-11-14 11:43:16 +000083class ScreenAsh;
84class SessionStateController;
85class ShellDelegate;
86class ShellObserver;
87class SystemTray;
88class SystemTrayDelegate;
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +000089class SystemTrayNotifier;
Torne (Richard Coles)58218062012-11-14 11:43:16 +000090class UserActivityDetector;
91class UserWallpaperDelegate;
92class VideoDetector;
93class WebNotificationTray;
94class WindowCycleController;
95
96namespace internal {
97class AcceleratorFilter;
98class ActivationController;
99class AppListController;
100class CaptureController;
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000101class DisplayChangeObserverX11;
102class DisplayErrorObserver;
103class DisplayManager;
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000104class DragDropController;
105class EventClientImpl;
106class EventRewriterEventFilter;
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000107class EventTransformationHandler;
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000108class FocusCycler;
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000109class MouseCursorEventFilter;
110class OutputConfiguratorAnimation;
111class OverlayEventFilter;
112class ResizeShadowController;
113class RootWindowController;
114class RootWindowLayoutManager;
115class ScreenPositionController;
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000116class SlowAnimationEventFilter;
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000117class StatusAreaWidget;
118class SystemGestureEventFilter;
119class SystemModalContainerEventFilter;
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000120class TouchObserverHUD;
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000121class WorkspaceController;
122}
123
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000124namespace shell {
125class WindowWatcher;
126}
127
128namespace test {
129class ShellTestApi;
130}
131
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000132// Shell is a singleton object that presents the Shell API and implements the
133// RootWindow's delegate interface.
134//
135// Upon creation, the Shell sets itself as the RootWindow's delegate, which
136// takes ownership of the Shell.
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000137class ASH_EXPORT Shell
138 : public internal::SystemModalContainerEventFilterDelegate,
139 public ui::EventTarget,
140 public aura::client::ActivationChangeObserver {
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000141 public:
142 typedef std::vector<aura::RootWindow*> RootWindowList;
143 typedef std::vector<internal::RootWindowController*> RootWindowControllerList;
144
145 enum Direction {
146 FORWARD,
147 BACKWARD
148 };
149
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000150 // A shell must be explicitly created so that it can call |Init()| with the
151 // delegate set. |delegate| can be NULL (if not required for initialization).
152 static Shell* CreateInstance(ShellDelegate* delegate);
153
154 // Should never be called before |CreateInstance()|.
155 static Shell* GetInstance();
156
157 // Returns true if the ash shell has been instantiated.
158 static bool HasInstance();
159
160 static void DeleteInstance();
161
162 // Returns the root window controller for the primary root window.
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000163 // TODO(oshima): move this to |RootWindowController|
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000164 static internal::RootWindowController* GetPrimaryRootWindowController();
165
166 // Returns all root window controllers.
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000167 // TODO(oshima): move this to |RootWindowController|
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000168 static RootWindowControllerList GetAllRootWindowControllers();
169
170 // Returns the primary RootWindow. The primary RootWindow is the one
171 // that has a launcher.
172 static aura::RootWindow* GetPrimaryRootWindow();
173
174 // Returns the active RootWindow. The active RootWindow is the one that
175 // contains the current active window as a decendant child. The active
176 // RootWindow remains the same even when the active window becomes NULL,
177 // until the another window who has a different root window becomes active.
178 static aura::RootWindow* GetActiveRootWindow();
179
180 // Returns the global Screen object that's always active in ash.
181 static gfx::Screen* GetScreen();
182
183 // Returns all root windows.
184 static RootWindowList GetAllRootWindows();
185
186 static aura::Window* GetContainer(aura::RootWindow* root_window,
187 int container_id);
188 static const aura::Window* GetContainer(const aura::RootWindow* root_window,
189 int container_id);
190
191 // Returns the list of containers that match |container_id| in
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000192 // all root windows. If |priority_root| is given, the container
193 // in the |priority_root| will be inserted at the top of the list.
194 static std::vector<aura::Window*> GetContainersFromAllRootWindows(
195 int container_id,
196 aura::RootWindow* priority_root);
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000197
198 // True if "launcher per display" feature is enabled.
199 static bool IsLauncherPerDisplayEnabled();
200
201 void set_active_root_window(aura::RootWindow* active_root_window) {
202 active_root_window_ = active_root_window;
203 }
204
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000205 // Shows the context menu for the background and launcher at
206 // |location_in_screen| (in screen coordinates).
207 void ShowContextMenu(const gfx::Point& location_in_screen);
208
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000209 // Toggles the app list. |window| specifies in which display the app
210 // list should be shown. If this is NULL, the active root window
211 // will be used.
212 void ToggleAppList(aura::Window* anchor);
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000213
214 // Returns app list target visibility.
215 bool GetAppListTargetVisibility() const;
216
217 // Returns app list window or NULL if it is not visible.
218 aura::Window* GetAppListWindow();
219
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000220 // Returns true if a user is logged in whose session can be locked (i.e. the
221 // user has a password with which to unlock the session).
222 bool CanLockScreen();
223
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000224 // Returns true if the screen is locked.
225 bool IsScreenLocked() const;
226
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000227 // Returns true if a system-modal dialog window is currently open.
228 bool IsSystemModalWindowOpen() const;
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000229
230 // For testing only: set simulation that a modal window is open
231 void SimulateModalWindowOpenForTesting(bool modal_window_open) {
232 simulate_modal_window_open_for_testing_ = modal_window_open;
233 }
234
235 // Creates a default views::NonClientFrameView for use by windows in the
236 // Ash environment.
237 views::NonClientFrameView* CreateDefaultNonClientFrameView(
238 views::Widget* widget);
239
240 // Rotates focus through containers that can receive focus.
241 void RotateFocus(Direction direction);
242
243 // Sets the work area insets of the display that contains |window|,
244 // this notifies observers too.
245 // TODO(sky): this no longer really replicates what happens and is unreliable.
246 // Remove this.
247 void SetDisplayWorkAreaInsets(aura::Window* window,
248 const gfx::Insets& insets);
249
250 // Called when the user logs in.
251 void OnLoginStateChanged(user::LoginStatus status);
252
253 // Called when the login status changes.
254 // TODO(oshima): Investigate if we can merge this and |OnLoginStateChanged|.
255 void UpdateAfterLoginStatusChange(user::LoginStatus status);
256
257 // Called when the application is exiting.
258 void OnAppTerminating();
259
260 // Called when the screen is locked (after the lock window is visible) or
261 // unlocked.
262 void OnLockStateChanged(bool locked);
263
264 // Initializes |launcher_|. Does nothing if it's already initialized.
265 void CreateLauncher();
266
267 // Show launcher view if it was created hidden (before session has started).
268 void ShowLauncher();
269
270 // Adds/removes observer.
271 void AddShellObserver(ShellObserver* observer);
272 void RemoveShellObserver(ShellObserver* observer);
273
274#if !defined(OS_MACOSX)
275 AcceleratorController* accelerator_controller() {
276 return accelerator_controller_.get();
277 }
278#endif // !defined(OS_MACOSX)
279
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000280 internal::DisplayManager* display_manager() {
281 return display_manager_.get();
282 }
283 views::corewm::CompoundEventFilter* env_filter() {
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000284 return env_filter_.get();
285 }
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000286 views::corewm::TooltipController* tooltip_controller() {
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000287 return tooltip_controller_.get();
288 }
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000289 internal::TouchObserverHUD* touch_observer_hud() {
290 return touch_observer_hud_.get();
291 }
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000292 internal::EventRewriterEventFilter* event_rewriter_filter() {
293 return event_rewriter_filter_.get();
294 }
295 internal::OverlayEventFilter* overlay_filter() {
296 return overlay_filter_.get();
297 }
298 DesktopBackgroundController* desktop_background_controller() {
299 return desktop_background_controller_.get();
300 }
301 PowerButtonController* power_button_controller() {
302 return power_button_controller_.get();
303 }
304 SessionStateController* session_state_controller() {
305 return session_state_controller_.get();
306 }
307 UserActivityDetector* user_activity_detector() {
308 return user_activity_detector_.get();
309 }
310 VideoDetector* video_detector() {
311 return video_detector_.get();
312 }
313 WindowCycleController* window_cycle_controller() {
314 return window_cycle_controller_.get();
315 }
316 internal::FocusCycler* focus_cycler() {
317 return focus_cycler_.get();
318 }
319 DisplayController* display_controller() {
320 return display_controller_.get();
321 }
322 internal::MouseCursorEventFilter* mouse_cursor_filter() {
323 return mouse_cursor_filter_.get();
324 }
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000325 internal::EventTransformationHandler* event_transformation_handler() {
326 return event_transformation_handler_.get();
327 }
328 views::corewm::CursorManager* cursor_manager() { return &cursor_manager_; }
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000329
330 ShellDelegate* delegate() { return delegate_.get(); }
331
332 UserWallpaperDelegate* user_wallpaper_delegate() {
333 return user_wallpaper_delegate_.get();
334 }
335
336 CapsLockDelegate* caps_lock_delegate() {
337 return caps_lock_delegate_.get();
338 }
339
340 HighContrastController* high_contrast_controller() {
341 return high_contrast_controller_.get();
342 }
343
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000344 MagnificationController* magnification_controller() {
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000345 return magnification_controller_.get();
346 }
347
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000348 PartialMagnificationController* partial_magnification_controller() {
349 return partial_magnification_controller_.get();
350 }
351 aura::client::ActivationClient* activation_client() {
352 return activation_client_;
353 }
354
355 ScreenAsh* screen() { return screen_; }
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000356
357 // Force the shelf to query for it's current visibility state.
358 void UpdateShelfVisibility();
359
360 // TODO(oshima): Define an interface to access shelf/launcher
361 // state, or just use Launcher.
362
363 // Sets/gets the shelf auto-hide behavior on |root_window|.
364 void SetShelfAutoHideBehavior(ShelfAutoHideBehavior behavior,
365 aura::RootWindow* root_window);
366 ShelfAutoHideBehavior GetShelfAutoHideBehavior(
367 aura::RootWindow* root_window) const;
368
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000369 // Sets/gets shelf's alignment on |root_window|.
370 void SetShelfAlignment(ShelfAlignment alignment,
371 aura::RootWindow* root_window);
372 ShelfAlignment GetShelfAlignment(aura::RootWindow* root_window);
373
374 // Dims or undims the screen.
375 void SetDimming(bool should_dim);
376
377 // Creates a modal background (a partially-opaque fullscreen window)
378 // on all displays for |window|.
379 void CreateModalBackground(aura::Window* window);
380
381 // Called when a modal window is removed. It will activate
382 // another modal window if any, or remove modal screens
383 // on all displays.
384 void OnModalWindowRemoved(aura::Window* removed);
385
386 // Returns WebNotificationTray on the primary root window.
387 WebNotificationTray* GetWebNotificationTray();
388
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000389 // Does the primary display have status area?
390 bool HasPrimaryStatusArea();
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000391
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000392 // Returns the system tray on primary display.
393 SystemTray* GetPrimarySystemTray();
394
395 SystemTrayDelegate* system_tray_delegate() {
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000396 return system_tray_delegate_.get();
397 }
398
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000399 SystemTrayNotifier* system_tray_notifier() {
400 return system_tray_notifier_.get();
401 }
402
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000403 static void set_initially_hide_cursor(bool hide) {
404 initially_hide_cursor_ = hide;
405 }
406
407 internal::ResizeShadowController* resize_shadow_controller() {
408 return resize_shadow_controller_.get();
409 }
410
411 // Made available for tests.
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000412 views::corewm::ShadowController* shadow_controller() {
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000413 return shadow_controller_.get();
414 }
415
416 content::BrowserContext* browser_context() { return browser_context_; }
417 void set_browser_context(content::BrowserContext* browser_context) {
418 browser_context_ = browser_context;
419 }
420
421 // Initializes the root window to be used for a secondary display.
422 void InitRootWindowForSecondaryDisplay(aura::RootWindow* root);
423
424 // Starts the animation that occurs on first login.
425 void DoInitialWorkspaceAnimation();
426
427#if defined(OS_CHROMEOS)
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000428 // TODO(oshima): Move these objects to DisplayController.
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000429 chromeos::OutputConfigurator* output_configurator() {
430 return output_configurator_.get();
431 }
432 internal::OutputConfiguratorAnimation* output_configurator_animation() {
433 return output_configurator_animation_.get();
434 }
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000435 internal::DisplayErrorObserver* display_error_observer() {
436 return display_error_observer_.get();
437 }
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000438#endif // defined(OS_CHROMEOS)
439
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000440 RootWindowHostFactory* root_window_host_factory() {
441 return root_window_host_factory_.get();
442 }
443
444 LauncherModel* launcher_model() {
445 return launcher_model_.get();
446 }
447
448 // Returns the launcher delegate, creating if necesary.
449 LauncherDelegate* GetLauncherDelegate();
450
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000451 private:
452 FRIEND_TEST_ALL_PREFIXES(ExtendedDesktopTest, TestCursor);
453 FRIEND_TEST_ALL_PREFIXES(WindowManagerTest, MouseEventCursors);
454 FRIEND_TEST_ALL_PREFIXES(WindowManagerTest, TransformActivate);
455 friend class internal::RootWindowController;
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000456 friend class test::ShellTestApi;
457 friend class shell::WindowWatcher;
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000458
459 typedef std::pair<aura::Window*, gfx::Rect> WindowAndBoundsPair;
460
461 explicit Shell(ShellDelegate* delegate);
462 virtual ~Shell();
463
464 void Init();
465
466 // Initializes the root window and root window controller so that it
467 // can host browser windows.
468 void InitRootWindowController(internal::RootWindowController* root);
469
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000470 // ash::internal::SystemModalContainerEventFilterDelegate overrides:
471 virtual bool CanWindowReceiveEvents(aura::Window* window) OVERRIDE;
472
473 // Overridden from ui::EventTarget:
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000474 virtual bool CanAcceptEvent(const ui::Event& event) OVERRIDE;
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000475 virtual EventTarget* GetParentTarget() OVERRIDE;
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000476 virtual void OnEvent(ui::Event* event) OVERRIDE;
477
478 // Overridden from aura::client::ActivationChangeObserver:
479 virtual void OnWindowActivated(aura::Window* gained_active,
480 aura::Window* lost_active) OVERRIDE;
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000481
482 static Shell* instance_;
483
484 // If set before the Shell is initialized, the mouse cursor will be hidden
485 // when the screen is initially created.
486 static bool initially_hide_cursor_;
487
488 ScreenAsh* screen_;
489
490 // Active root window. Never becomes NULL during the session.
491 aura::RootWindow* active_root_window_;
492
493 // The CompoundEventFilter owned by aura::Env object.
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000494 scoped_ptr<views::corewm::CompoundEventFilter> env_filter_;
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000495
496 std::vector<WindowAndBoundsPair> to_restore_;
497
498#if !defined(OS_MACOSX)
499 scoped_ptr<NestedDispatcherController> nested_dispatcher_controller_;
500
501 scoped_ptr<AcceleratorController> accelerator_controller_;
502#endif // !defined(OS_MACOSX)
503
504 scoped_ptr<ShellDelegate> delegate_;
505 scoped_ptr<SystemTrayDelegate> system_tray_delegate_;
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000506 scoped_ptr<SystemTrayNotifier> system_tray_notifier_;
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000507 scoped_ptr<UserWallpaperDelegate> user_wallpaper_delegate_;
508 scoped_ptr<CapsLockDelegate> caps_lock_delegate_;
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000509 scoped_ptr<LauncherDelegate> launcher_delegate_;
510
511 scoped_ptr<LauncherModel> launcher_model_;
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000512
513 scoped_ptr<internal::AppListController> app_list_controller_;
514
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000515 scoped_ptr<internal::ActivationController> activation_controller_;
516 scoped_ptr<internal::CaptureController> capture_controller_;
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000517 scoped_ptr<internal::DragDropController> drag_drop_controller_;
518 scoped_ptr<internal::ResizeShadowController> resize_shadow_controller_;
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000519 scoped_ptr<views::corewm::ShadowController> shadow_controller_;
520 scoped_ptr<views::corewm::VisibilityController> visibility_controller_;
521 scoped_ptr<views::corewm::WindowModalityController>
522 window_modality_controller_;
523 scoped_ptr<views::corewm::TooltipController> tooltip_controller_;
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000524 scoped_ptr<DesktopBackgroundController> desktop_background_controller_;
525 scoped_ptr<PowerButtonController> power_button_controller_;
526 scoped_ptr<SessionStateController> session_state_controller_;
527 scoped_ptr<UserActivityDetector> user_activity_detector_;
528 scoped_ptr<VideoDetector> video_detector_;
529 scoped_ptr<WindowCycleController> window_cycle_controller_;
530 scoped_ptr<internal::FocusCycler> focus_cycler_;
531 scoped_ptr<DisplayController> display_controller_;
532 scoped_ptr<HighContrastController> high_contrast_controller_;
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000533 scoped_ptr<MagnificationController> magnification_controller_;
534 scoped_ptr<PartialMagnificationController> partial_magnification_controller_;
535 scoped_ptr<aura::client::FocusClient> focus_client_;
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000536 scoped_ptr<aura::client::UserActionClient> user_action_client_;
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000537 aura::client::ActivationClient* activation_client_;
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000538 scoped_ptr<internal::MouseCursorEventFilter> mouse_cursor_filter_;
539 scoped_ptr<internal::ScreenPositionController> screen_position_controller_;
540 scoped_ptr<internal::SystemModalContainerEventFilter> modality_filter_;
541 scoped_ptr<internal::EventClientImpl> event_client_;
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000542 scoped_ptr<internal::EventTransformationHandler>
543 event_transformation_handler_;
544 scoped_ptr<RootWindowHostFactory> root_window_host_factory_;
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000545
546 // An event filter that rewrites or drops an event.
547 scoped_ptr<internal::EventRewriterEventFilter> event_rewriter_filter_;
548
549 // An event filter that pre-handles key events while the partial
550 // screenshot UI or the keyboard overlay is active.
551 scoped_ptr<internal::OverlayEventFilter> overlay_filter_;
552
553 // An event filter which handles system level gestures
554 scoped_ptr<internal::SystemGestureEventFilter> system_gesture_filter_;
555
556#if !defined(OS_MACOSX)
557 // An event filter that pre-handles global accelerators.
558 scoped_ptr<internal::AcceleratorFilter> accelerator_filter_;
559#endif
560
561 // An event filter that pre-handles all key events to send them to an IME.
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000562 scoped_ptr<views::corewm::InputMethodEventFilter> input_method_filter_;
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000563
564 // An event filter that silently keeps track of all touch events and controls
565 // a heads-up display. This is enabled only if --ash-touch-hud flag is used.
566 scoped_ptr<internal::TouchObserverHUD> touch_observer_hud_;
567
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000568 scoped_ptr<internal::DisplayManager> display_manager_;
569
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000570#if defined(OS_CHROMEOS)
571 // Controls video output device state.
572 scoped_ptr<chromeos::OutputConfigurator> output_configurator_;
573 scoped_ptr<internal::OutputConfiguratorAnimation>
574 output_configurator_animation_;
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000575 scoped_ptr<internal::DisplayErrorObserver> display_error_observer_;
576
577 // Receives output change events and udpates the display manager.
578 scoped_ptr<internal::DisplayChangeObserverX11> display_change_observer_;
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000579#endif // defined(OS_CHROMEOS)
580
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000581 // |native_cursor_manager_| is owned by |cursor_manager_|, but we keep a
582 // pointer to vend to test code.
583 AshNativeCursorManager* native_cursor_manager_;
584 views::corewm::CursorManager cursor_manager_;
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000585
586 ObserverList<ShellObserver> observers_;
587
588 // Used by ash/shell.
589 content::BrowserContext* browser_context_;
590
591 // For testing only: simulate that a modal window is open
592 bool simulate_modal_window_open_for_testing_;
593
594 DISALLOW_COPY_AND_ASSIGN(Shell);
595};
596
597} // namespace ash
598
599#endif // ASH_SHELL_H_