blob: a42029314a04129fe66db121bc46ada8c5f44a86 [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
Torne (Richard Coles)b2df76e2013-05-13 16:52:09 +010029namespace app_list {
30class ApplicationDragAndDropHost;
31}
Torne (Richard Coles)58218062012-11-14 11:43:16 +000032namespace aura {
33class EventFilter;
Torne (Richard Coles)58218062012-11-14 11:43:16 +000034class RootWindow;
35class Window;
36namespace client {
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +000037class ActivationClient;
38class FocusClient;
Torne (Richard Coles)58218062012-11-14 11:43:16 +000039class UserActionClient;
40}
Torne (Richard Coles)58218062012-11-14 11:43:16 +000041}
42namespace chromeos {
43class OutputConfigurator;
44}
45namespace content {
46class BrowserContext;
47}
48
49namespace gfx {
50class ImageSkia;
51class Point;
52class Rect;
53}
54namespace ui {
55class Layer;
56}
57namespace views {
58class NonClientFrameView;
59class Widget;
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +000060namespace corewm {
61class CompoundEventFilter;
62class InputMethodEventFilter;
63class ShadowController;
64class TooltipController;
65class VisibilityController;
66class WindowModalityController;
67}
Torne (Richard Coles)58218062012-11-14 11:43:16 +000068}
69
70namespace ash {
71
72class AcceleratorController;
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +000073class AshNativeCursorManager;
Torne (Richard Coles)58218062012-11-14 11:43:16 +000074class CapsLockDelegate;
75class DesktopBackgroundController;
76class DisplayController;
77class HighContrastController;
78class Launcher;
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +000079class LauncherDelegate;
80class LauncherModel;
81class MagnificationController;
Torne (Richard Coles)58218062012-11-14 11:43:16 +000082class NestedDispatcherController;
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +000083class PartialMagnificationController;
Torne (Richard Coles)58218062012-11-14 11:43:16 +000084class PowerButtonController;
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +000085class RootWindowHostFactory;
Torne (Richard Coles)58218062012-11-14 11:43:16 +000086class ScreenAsh;
Torne (Richard Coles)868fa2f2013-06-11 10:57:03 +010087class LockStateController;
Torne (Richard Coles)c2e0dbd2013-05-09 18:35:53 +010088class SessionStateDelegate;
Torne (Richard Coles)58218062012-11-14 11:43:16 +000089class ShellDelegate;
90class ShellObserver;
91class SystemTray;
92class SystemTrayDelegate;
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +000093class SystemTrayNotifier;
Torne (Richard Coles)58218062012-11-14 11:43:16 +000094class UserActivityDetector;
95class UserWallpaperDelegate;
96class VideoDetector;
97class WebNotificationTray;
98class WindowCycleController;
99
100namespace internal {
101class AcceleratorFilter;
102class ActivationController;
103class AppListController;
104class CaptureController;
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000105class DisplayChangeObserverX11;
106class DisplayErrorObserver;
107class DisplayManager;
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000108class DragDropController;
109class EventClientImpl;
110class EventRewriterEventFilter;
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000111class EventTransformationHandler;
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000112class FocusCycler;
Torne (Richard Coles)90dce4d2013-05-29 14:40:03 +0100113class MirrorWindowController;
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000114class MouseCursorEventFilter;
115class OutputConfiguratorAnimation;
116class OverlayEventFilter;
117class ResizeShadowController;
118class RootWindowController;
119class RootWindowLayoutManager;
120class ScreenPositionController;
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000121class SlowAnimationEventFilter;
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000122class StatusAreaWidget;
123class SystemGestureEventFilter;
124class SystemModalContainerEventFilter;
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000125class TouchObserverHUD;
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000126class WorkspaceController;
127}
128
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000129namespace shell {
130class WindowWatcher;
131}
132
133namespace test {
134class ShellTestApi;
135}
136
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000137// Shell is a singleton object that presents the Shell API and implements the
138// RootWindow's delegate interface.
139//
140// Upon creation, the Shell sets itself as the RootWindow's delegate, which
141// takes ownership of the Shell.
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000142class ASH_EXPORT Shell
143 : public internal::SystemModalContainerEventFilterDelegate,
144 public ui::EventTarget,
145 public aura::client::ActivationChangeObserver {
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000146 public:
147 typedef std::vector<aura::RootWindow*> RootWindowList;
148 typedef std::vector<internal::RootWindowController*> RootWindowControllerList;
149
150 enum Direction {
151 FORWARD,
152 BACKWARD
153 };
154
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000155 // A shell must be explicitly created so that it can call |Init()| with the
156 // delegate set. |delegate| can be NULL (if not required for initialization).
Torne (Richard Coles)c2e0dbd2013-05-09 18:35:53 +0100157 // Takes ownership of |delegate|.
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000158 static Shell* CreateInstance(ShellDelegate* delegate);
159
160 // Should never be called before |CreateInstance()|.
161 static Shell* GetInstance();
162
163 // Returns true if the ash shell has been instantiated.
164 static bool HasInstance();
165
166 static void DeleteInstance();
167
168 // Returns the root window controller for the primary root window.
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000169 // TODO(oshima): move this to |RootWindowController|
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000170 static internal::RootWindowController* GetPrimaryRootWindowController();
171
172 // Returns all root window controllers.
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000173 // TODO(oshima): move this to |RootWindowController|
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000174 static RootWindowControllerList GetAllRootWindowControllers();
175
176 // Returns the primary RootWindow. The primary RootWindow is the one
177 // that has a launcher.
178 static aura::RootWindow* GetPrimaryRootWindow();
179
180 // Returns the active RootWindow. The active RootWindow is the one that
181 // contains the current active window as a decendant child. The active
182 // RootWindow remains the same even when the active window becomes NULL,
183 // until the another window who has a different root window becomes active.
184 static aura::RootWindow* GetActiveRootWindow();
185
186 // Returns the global Screen object that's always active in ash.
187 static gfx::Screen* GetScreen();
188
189 // Returns all root windows.
190 static RootWindowList GetAllRootWindows();
191
192 static aura::Window* GetContainer(aura::RootWindow* root_window,
193 int container_id);
194 static const aura::Window* GetContainer(const aura::RootWindow* root_window,
195 int container_id);
196
197 // Returns the list of containers that match |container_id| in
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000198 // all root windows. If |priority_root| is given, the container
199 // in the |priority_root| will be inserted at the top of the list.
200 static std::vector<aura::Window*> GetContainersFromAllRootWindows(
201 int container_id,
202 aura::RootWindow* priority_root);
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000203
Torne (Richard Coles)c2e0dbd2013-05-09 18:35:53 +0100204 // True if an experimental maximize mode is enabled which forces browser and
205 // application windows to be maximized only.
206 static bool IsForcedMaximizeMode();
207
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000208 void set_active_root_window(aura::RootWindow* active_root_window) {
209 active_root_window_ = active_root_window;
210 }
211
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000212 // Shows the context menu for the background and launcher at
213 // |location_in_screen| (in screen coordinates).
214 void ShowContextMenu(const gfx::Point& location_in_screen);
215
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000216 // Toggles the app list. |window| specifies in which display the app
217 // list should be shown. If this is NULL, the active root window
218 // will be used.
219 void ToggleAppList(aura::Window* anchor);
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000220
Torne (Richard Coles)b2df76e2013-05-13 16:52:09 +0100221 // If |drag_and_drop_host| is not NULL it will be called upon drag and drop
222 // operations outside the application list.
223 void SetDragAndDropHostOfCurrentAppList(
224 app_list::ApplicationDragAndDropHost* drag_and_drop_host);
225
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000226 // Returns app list target visibility.
227 bool GetAppListTargetVisibility() const;
228
229 // Returns app list window or NULL if it is not visible.
230 aura::Window* GetAppListWindow();
231
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000232 // Returns true if a system-modal dialog window is currently open.
233 bool IsSystemModalWindowOpen() const;
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000234
235 // For testing only: set simulation that a modal window is open
236 void SimulateModalWindowOpenForTesting(bool modal_window_open) {
237 simulate_modal_window_open_for_testing_ = modal_window_open;
238 }
239
240 // Creates a default views::NonClientFrameView for use by windows in the
241 // Ash environment.
242 views::NonClientFrameView* CreateDefaultNonClientFrameView(
243 views::Widget* widget);
244
245 // Rotates focus through containers that can receive focus.
246 void RotateFocus(Direction direction);
247
248 // Sets the work area insets of the display that contains |window|,
249 // this notifies observers too.
250 // TODO(sky): this no longer really replicates what happens and is unreliable.
251 // Remove this.
252 void SetDisplayWorkAreaInsets(aura::Window* window,
253 const gfx::Insets& insets);
254
255 // Called when the user logs in.
256 void OnLoginStateChanged(user::LoginStatus status);
257
258 // Called when the login status changes.
259 // TODO(oshima): Investigate if we can merge this and |OnLoginStateChanged|.
260 void UpdateAfterLoginStatusChange(user::LoginStatus status);
261
262 // Called when the application is exiting.
263 void OnAppTerminating();
264
265 // Called when the screen is locked (after the lock window is visible) or
266 // unlocked.
267 void OnLockStateChanged(bool locked);
268
269 // Initializes |launcher_|. Does nothing if it's already initialized.
270 void CreateLauncher();
271
272 // Show launcher view if it was created hidden (before session has started).
273 void ShowLauncher();
274
275 // Adds/removes observer.
276 void AddShellObserver(ShellObserver* observer);
277 void RemoveShellObserver(ShellObserver* observer);
278
279#if !defined(OS_MACOSX)
280 AcceleratorController* accelerator_controller() {
281 return accelerator_controller_.get();
282 }
283#endif // !defined(OS_MACOSX)
284
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000285 internal::DisplayManager* display_manager() {
286 return display_manager_.get();
287 }
Torne (Richard Coles)90dce4d2013-05-29 14:40:03 +0100288 internal::MirrorWindowController* mirror_window_controller() {
289 return mirror_window_controller_.get();
290 }
Torne (Richard Coles)c2e0dbd2013-05-09 18:35:53 +0100291 views::corewm::InputMethodEventFilter* input_method_filter() {
292 return input_method_filter_.get();
293 }
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000294 views::corewm::CompoundEventFilter* env_filter() {
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000295 return env_filter_.get();
296 }
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000297 views::corewm::TooltipController* tooltip_controller() {
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000298 return tooltip_controller_.get();
299 }
300 internal::EventRewriterEventFilter* event_rewriter_filter() {
301 return event_rewriter_filter_.get();
302 }
303 internal::OverlayEventFilter* overlay_filter() {
304 return overlay_filter_.get();
305 }
306 DesktopBackgroundController* desktop_background_controller() {
307 return desktop_background_controller_.get();
308 }
309 PowerButtonController* power_button_controller() {
310 return power_button_controller_.get();
311 }
Torne (Richard Coles)868fa2f2013-06-11 10:57:03 +0100312 LockStateController* lock_state_controller() {
313 return lock_state_controller_.get();
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000314 }
315 UserActivityDetector* user_activity_detector() {
316 return user_activity_detector_.get();
317 }
318 VideoDetector* video_detector() {
319 return video_detector_.get();
320 }
321 WindowCycleController* window_cycle_controller() {
322 return window_cycle_controller_.get();
323 }
324 internal::FocusCycler* focus_cycler() {
325 return focus_cycler_.get();
326 }
327 DisplayController* display_controller() {
328 return display_controller_.get();
329 }
330 internal::MouseCursorEventFilter* mouse_cursor_filter() {
331 return mouse_cursor_filter_.get();
332 }
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000333 internal::EventTransformationHandler* event_transformation_handler() {
334 return event_transformation_handler_.get();
335 }
336 views::corewm::CursorManager* cursor_manager() { return &cursor_manager_; }
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000337
338 ShellDelegate* delegate() { return delegate_.get(); }
339
340 UserWallpaperDelegate* user_wallpaper_delegate() {
341 return user_wallpaper_delegate_.get();
342 }
343
344 CapsLockDelegate* caps_lock_delegate() {
345 return caps_lock_delegate_.get();
346 }
347
Torne (Richard Coles)c2e0dbd2013-05-09 18:35:53 +0100348 SessionStateDelegate* session_state_delegate() {
349 return session_state_delegate_.get();
350 }
351
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000352 HighContrastController* high_contrast_controller() {
353 return high_contrast_controller_.get();
354 }
355
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000356 MagnificationController* magnification_controller() {
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000357 return magnification_controller_.get();
358 }
359
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000360 PartialMagnificationController* partial_magnification_controller() {
361 return partial_magnification_controller_.get();
362 }
363 aura::client::ActivationClient* activation_client() {
364 return activation_client_;
365 }
366
367 ScreenAsh* screen() { return screen_; }
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000368
369 // Force the shelf to query for it's current visibility state.
370 void UpdateShelfVisibility();
371
372 // TODO(oshima): Define an interface to access shelf/launcher
373 // state, or just use Launcher.
374
375 // Sets/gets the shelf auto-hide behavior on |root_window|.
376 void SetShelfAutoHideBehavior(ShelfAutoHideBehavior behavior,
377 aura::RootWindow* root_window);
378 ShelfAutoHideBehavior GetShelfAutoHideBehavior(
379 aura::RootWindow* root_window) const;
380
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000381 // Sets/gets shelf's alignment on |root_window|.
382 void SetShelfAlignment(ShelfAlignment alignment,
383 aura::RootWindow* root_window);
384 ShelfAlignment GetShelfAlignment(aura::RootWindow* root_window);
385
386 // Dims or undims the screen.
387 void SetDimming(bool should_dim);
388
389 // Creates a modal background (a partially-opaque fullscreen window)
390 // on all displays for |window|.
391 void CreateModalBackground(aura::Window* window);
392
393 // Called when a modal window is removed. It will activate
394 // another modal window if any, or remove modal screens
395 // on all displays.
396 void OnModalWindowRemoved(aura::Window* removed);
397
398 // Returns WebNotificationTray on the primary root window.
399 WebNotificationTray* GetWebNotificationTray();
400
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000401 // Does the primary display have status area?
402 bool HasPrimaryStatusArea();
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000403
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000404 // Returns the system tray on primary display.
405 SystemTray* GetPrimarySystemTray();
406
407 SystemTrayDelegate* system_tray_delegate() {
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000408 return system_tray_delegate_.get();
409 }
410
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000411 SystemTrayNotifier* system_tray_notifier() {
412 return system_tray_notifier_.get();
413 }
414
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000415 static void set_initially_hide_cursor(bool hide) {
416 initially_hide_cursor_ = hide;
417 }
418
419 internal::ResizeShadowController* resize_shadow_controller() {
420 return resize_shadow_controller_.get();
421 }
422
423 // Made available for tests.
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000424 views::corewm::ShadowController* shadow_controller() {
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000425 return shadow_controller_.get();
426 }
427
428 content::BrowserContext* browser_context() { return browser_context_; }
429 void set_browser_context(content::BrowserContext* browser_context) {
430 browser_context_ = browser_context;
431 }
432
433 // Initializes the root window to be used for a secondary display.
434 void InitRootWindowForSecondaryDisplay(aura::RootWindow* root);
435
436 // Starts the animation that occurs on first login.
437 void DoInitialWorkspaceAnimation();
438
Torne (Richard Coles)c2e0dbd2013-05-09 18:35:53 +0100439#if defined(OS_CHROMEOS) && defined(USE_X11)
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000440 // TODO(oshima): Move these objects to DisplayController.
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000441 chromeos::OutputConfigurator* output_configurator() {
442 return output_configurator_.get();
443 }
444 internal::OutputConfiguratorAnimation* output_configurator_animation() {
445 return output_configurator_animation_.get();
446 }
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000447 internal::DisplayErrorObserver* display_error_observer() {
448 return display_error_observer_.get();
449 }
Torne (Richard Coles)c2e0dbd2013-05-09 18:35:53 +0100450#endif // defined(OS_CHROMEOS) && defined(USE_X11)
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000451
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000452 RootWindowHostFactory* root_window_host_factory() {
453 return root_window_host_factory_.get();
454 }
455
456 LauncherModel* launcher_model() {
457 return launcher_model_.get();
458 }
459
460 // Returns the launcher delegate, creating if necesary.
461 LauncherDelegate* GetLauncherDelegate();
462
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000463 private:
464 FRIEND_TEST_ALL_PREFIXES(ExtendedDesktopTest, TestCursor);
465 FRIEND_TEST_ALL_PREFIXES(WindowManagerTest, MouseEventCursors);
466 FRIEND_TEST_ALL_PREFIXES(WindowManagerTest, TransformActivate);
467 friend class internal::RootWindowController;
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000468 friend class test::ShellTestApi;
469 friend class shell::WindowWatcher;
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000470
471 typedef std::pair<aura::Window*, gfx::Rect> WindowAndBoundsPair;
472
Torne (Richard Coles)c2e0dbd2013-05-09 18:35:53 +0100473 // Takes ownership of |delegate|.
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000474 explicit Shell(ShellDelegate* delegate);
475 virtual ~Shell();
476
477 void Init();
478
479 // Initializes the root window and root window controller so that it
480 // can host browser windows.
481 void InitRootWindowController(internal::RootWindowController* root);
482
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000483 // ash::internal::SystemModalContainerEventFilterDelegate overrides:
484 virtual bool CanWindowReceiveEvents(aura::Window* window) OVERRIDE;
485
486 // Overridden from ui::EventTarget:
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000487 virtual bool CanAcceptEvent(const ui::Event& event) OVERRIDE;
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000488 virtual EventTarget* GetParentTarget() OVERRIDE;
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000489 virtual void OnEvent(ui::Event* event) OVERRIDE;
490
491 // Overridden from aura::client::ActivationChangeObserver:
492 virtual void OnWindowActivated(aura::Window* gained_active,
493 aura::Window* lost_active) OVERRIDE;
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000494
495 static Shell* instance_;
496
497 // If set before the Shell is initialized, the mouse cursor will be hidden
498 // when the screen is initially created.
499 static bool initially_hide_cursor_;
500
501 ScreenAsh* screen_;
502
503 // Active root window. Never becomes NULL during the session.
504 aura::RootWindow* active_root_window_;
505
506 // The CompoundEventFilter owned by aura::Env object.
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000507 scoped_ptr<views::corewm::CompoundEventFilter> env_filter_;
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000508
509 std::vector<WindowAndBoundsPair> to_restore_;
510
511#if !defined(OS_MACOSX)
512 scoped_ptr<NestedDispatcherController> nested_dispatcher_controller_;
513
514 scoped_ptr<AcceleratorController> accelerator_controller_;
515#endif // !defined(OS_MACOSX)
516
517 scoped_ptr<ShellDelegate> delegate_;
518 scoped_ptr<SystemTrayDelegate> system_tray_delegate_;
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000519 scoped_ptr<SystemTrayNotifier> system_tray_notifier_;
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000520 scoped_ptr<UserWallpaperDelegate> user_wallpaper_delegate_;
521 scoped_ptr<CapsLockDelegate> caps_lock_delegate_;
Torne (Richard Coles)c2e0dbd2013-05-09 18:35:53 +0100522 scoped_ptr<SessionStateDelegate> session_state_delegate_;
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000523 scoped_ptr<LauncherDelegate> launcher_delegate_;
524
525 scoped_ptr<LauncherModel> launcher_model_;
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000526
527 scoped_ptr<internal::AppListController> app_list_controller_;
528
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000529 scoped_ptr<internal::ActivationController> activation_controller_;
530 scoped_ptr<internal::CaptureController> capture_controller_;
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000531 scoped_ptr<internal::DragDropController> drag_drop_controller_;
532 scoped_ptr<internal::ResizeShadowController> resize_shadow_controller_;
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000533 scoped_ptr<views::corewm::ShadowController> shadow_controller_;
534 scoped_ptr<views::corewm::VisibilityController> visibility_controller_;
535 scoped_ptr<views::corewm::WindowModalityController>
536 window_modality_controller_;
537 scoped_ptr<views::corewm::TooltipController> tooltip_controller_;
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000538 scoped_ptr<DesktopBackgroundController> desktop_background_controller_;
539 scoped_ptr<PowerButtonController> power_button_controller_;
Torne (Richard Coles)868fa2f2013-06-11 10:57:03 +0100540 scoped_ptr<LockStateController> lock_state_controller_;
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000541 scoped_ptr<UserActivityDetector> user_activity_detector_;
542 scoped_ptr<VideoDetector> video_detector_;
543 scoped_ptr<WindowCycleController> window_cycle_controller_;
544 scoped_ptr<internal::FocusCycler> focus_cycler_;
545 scoped_ptr<DisplayController> display_controller_;
546 scoped_ptr<HighContrastController> high_contrast_controller_;
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000547 scoped_ptr<MagnificationController> magnification_controller_;
548 scoped_ptr<PartialMagnificationController> partial_magnification_controller_;
549 scoped_ptr<aura::client::FocusClient> focus_client_;
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000550 scoped_ptr<aura::client::UserActionClient> user_action_client_;
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000551 aura::client::ActivationClient* activation_client_;
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000552 scoped_ptr<internal::MouseCursorEventFilter> mouse_cursor_filter_;
553 scoped_ptr<internal::ScreenPositionController> screen_position_controller_;
554 scoped_ptr<internal::SystemModalContainerEventFilter> modality_filter_;
555 scoped_ptr<internal::EventClientImpl> event_client_;
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000556 scoped_ptr<internal::EventTransformationHandler>
557 event_transformation_handler_;
558 scoped_ptr<RootWindowHostFactory> root_window_host_factory_;
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000559
560 // An event filter that rewrites or drops an event.
561 scoped_ptr<internal::EventRewriterEventFilter> event_rewriter_filter_;
562
563 // An event filter that pre-handles key events while the partial
564 // screenshot UI or the keyboard overlay is active.
565 scoped_ptr<internal::OverlayEventFilter> overlay_filter_;
566
567 // An event filter which handles system level gestures
568 scoped_ptr<internal::SystemGestureEventFilter> system_gesture_filter_;
569
570#if !defined(OS_MACOSX)
571 // An event filter that pre-handles global accelerators.
572 scoped_ptr<internal::AcceleratorFilter> accelerator_filter_;
573#endif
574
575 // An event filter that pre-handles all key events to send them to an IME.
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000576 scoped_ptr<views::corewm::InputMethodEventFilter> input_method_filter_;
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000577
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000578 scoped_ptr<internal::DisplayManager> display_manager_;
Torne (Richard Coles)90dce4d2013-05-29 14:40:03 +0100579 scoped_ptr<internal::MirrorWindowController> mirror_window_controller_;
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000580
Torne (Richard Coles)c2e0dbd2013-05-09 18:35:53 +0100581#if defined(OS_CHROMEOS) && defined(USE_X11)
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000582 // Controls video output device state.
583 scoped_ptr<chromeos::OutputConfigurator> output_configurator_;
584 scoped_ptr<internal::OutputConfiguratorAnimation>
585 output_configurator_animation_;
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000586 scoped_ptr<internal::DisplayErrorObserver> display_error_observer_;
587
588 // Receives output change events and udpates the display manager.
589 scoped_ptr<internal::DisplayChangeObserverX11> display_change_observer_;
Torne (Richard Coles)c2e0dbd2013-05-09 18:35:53 +0100590#endif // defined(OS_CHROMEOS) && defined(USE_X11)
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000591
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000592 // |native_cursor_manager_| is owned by |cursor_manager_|, but we keep a
593 // pointer to vend to test code.
594 AshNativeCursorManager* native_cursor_manager_;
595 views::corewm::CursorManager cursor_manager_;
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000596
597 ObserverList<ShellObserver> observers_;
598
599 // Used by ash/shell.
600 content::BrowserContext* browser_context_;
601
602 // For testing only: simulate that a modal window is open
603 bool simulate_modal_window_open_for_testing_;
604
605 DISALLOW_COPY_AND_ASSIGN(Shell);
606};
607
608} // namespace ash
609
610#endif // ASH_SHELL_H_