blob: b8a0ce9b1dee96615b1ae16c1e560928794ddbeb [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;
Torne (Richard Coles)c2e0dbd2013-05-09 18:35:53 +010085class SessionStateDelegate;
Torne (Richard Coles)58218062012-11-14 11:43:16 +000086class ShellDelegate;
87class ShellObserver;
88class SystemTray;
89class SystemTrayDelegate;
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +000090class SystemTrayNotifier;
Torne (Richard Coles)58218062012-11-14 11:43:16 +000091class UserActivityDetector;
92class UserWallpaperDelegate;
93class VideoDetector;
94class WebNotificationTray;
95class WindowCycleController;
96
97namespace internal {
98class AcceleratorFilter;
99class ActivationController;
100class AppListController;
101class CaptureController;
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000102class DisplayChangeObserverX11;
103class DisplayErrorObserver;
104class DisplayManager;
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000105class DragDropController;
106class EventClientImpl;
107class EventRewriterEventFilter;
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000108class EventTransformationHandler;
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000109class FocusCycler;
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000110class MouseCursorEventFilter;
111class OutputConfiguratorAnimation;
112class OverlayEventFilter;
113class ResizeShadowController;
114class RootWindowController;
115class RootWindowLayoutManager;
116class ScreenPositionController;
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000117class SlowAnimationEventFilter;
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000118class StatusAreaWidget;
119class SystemGestureEventFilter;
120class SystemModalContainerEventFilter;
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000121class TouchObserverHUD;
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000122class WorkspaceController;
123}
124
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000125namespace shell {
126class WindowWatcher;
127}
128
129namespace test {
130class ShellTestApi;
131}
132
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000133// Shell is a singleton object that presents the Shell API and implements the
134// RootWindow's delegate interface.
135//
136// Upon creation, the Shell sets itself as the RootWindow's delegate, which
137// takes ownership of the Shell.
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000138class ASH_EXPORT Shell
139 : public internal::SystemModalContainerEventFilterDelegate,
140 public ui::EventTarget,
141 public aura::client::ActivationChangeObserver {
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000142 public:
143 typedef std::vector<aura::RootWindow*> RootWindowList;
144 typedef std::vector<internal::RootWindowController*> RootWindowControllerList;
145
146 enum Direction {
147 FORWARD,
148 BACKWARD
149 };
150
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000151 // A shell must be explicitly created so that it can call |Init()| with the
152 // delegate set. |delegate| can be NULL (if not required for initialization).
Torne (Richard Coles)c2e0dbd2013-05-09 18:35:53 +0100153 // Takes ownership of |delegate|.
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000154 static Shell* CreateInstance(ShellDelegate* delegate);
155
156 // Should never be called before |CreateInstance()|.
157 static Shell* GetInstance();
158
159 // Returns true if the ash shell has been instantiated.
160 static bool HasInstance();
161
162 static void DeleteInstance();
163
164 // Returns the root window controller for the primary root window.
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000165 // TODO(oshima): move this to |RootWindowController|
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000166 static internal::RootWindowController* GetPrimaryRootWindowController();
167
168 // Returns all root window controllers.
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 RootWindowControllerList GetAllRootWindowControllers();
171
172 // Returns the primary RootWindow. The primary RootWindow is the one
173 // that has a launcher.
174 static aura::RootWindow* GetPrimaryRootWindow();
175
176 // Returns the active RootWindow. The active RootWindow is the one that
177 // contains the current active window as a decendant child. The active
178 // RootWindow remains the same even when the active window becomes NULL,
179 // until the another window who has a different root window becomes active.
180 static aura::RootWindow* GetActiveRootWindow();
181
182 // Returns the global Screen object that's always active in ash.
183 static gfx::Screen* GetScreen();
184
185 // Returns all root windows.
186 static RootWindowList GetAllRootWindows();
187
188 static aura::Window* GetContainer(aura::RootWindow* root_window,
189 int container_id);
190 static const aura::Window* GetContainer(const aura::RootWindow* root_window,
191 int container_id);
192
193 // Returns the list of containers that match |container_id| in
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000194 // all root windows. If |priority_root| is given, the container
195 // in the |priority_root| will be inserted at the top of the list.
196 static std::vector<aura::Window*> GetContainersFromAllRootWindows(
197 int container_id,
198 aura::RootWindow* priority_root);
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000199
200 // True if "launcher per display" feature is enabled.
201 static bool IsLauncherPerDisplayEnabled();
202
Torne (Richard Coles)c2e0dbd2013-05-09 18:35:53 +0100203 // True if an experimental maximize mode is enabled which forces browser and
204 // application windows to be maximized only.
205 static bool IsForcedMaximizeMode();
206
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000207 void set_active_root_window(aura::RootWindow* active_root_window) {
208 active_root_window_ = active_root_window;
209 }
210
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000211 // Shows the context menu for the background and launcher at
212 // |location_in_screen| (in screen coordinates).
213 void ShowContextMenu(const gfx::Point& location_in_screen);
214
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000215 // Toggles the app list. |window| specifies in which display the app
216 // list should be shown. If this is NULL, the active root window
217 // will be used.
218 void ToggleAppList(aura::Window* anchor);
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000219
220 // Returns app list target visibility.
221 bool GetAppListTargetVisibility() const;
222
223 // Returns app list window or NULL if it is not visible.
224 aura::Window* GetAppListWindow();
225
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000226 // Returns true if a system-modal dialog window is currently open.
227 bool IsSystemModalWindowOpen() const;
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000228
229 // For testing only: set simulation that a modal window is open
230 void SimulateModalWindowOpenForTesting(bool modal_window_open) {
231 simulate_modal_window_open_for_testing_ = modal_window_open;
232 }
233
234 // Creates a default views::NonClientFrameView for use by windows in the
235 // Ash environment.
236 views::NonClientFrameView* CreateDefaultNonClientFrameView(
237 views::Widget* widget);
238
239 // Rotates focus through containers that can receive focus.
240 void RotateFocus(Direction direction);
241
242 // Sets the work area insets of the display that contains |window|,
243 // this notifies observers too.
244 // TODO(sky): this no longer really replicates what happens and is unreliable.
245 // Remove this.
246 void SetDisplayWorkAreaInsets(aura::Window* window,
247 const gfx::Insets& insets);
248
249 // Called when the user logs in.
250 void OnLoginStateChanged(user::LoginStatus status);
251
252 // Called when the login status changes.
253 // TODO(oshima): Investigate if we can merge this and |OnLoginStateChanged|.
254 void UpdateAfterLoginStatusChange(user::LoginStatus status);
255
256 // Called when the application is exiting.
257 void OnAppTerminating();
258
259 // Called when the screen is locked (after the lock window is visible) or
260 // unlocked.
261 void OnLockStateChanged(bool locked);
262
263 // Initializes |launcher_|. Does nothing if it's already initialized.
264 void CreateLauncher();
265
266 // Show launcher view if it was created hidden (before session has started).
267 void ShowLauncher();
268
269 // Adds/removes observer.
270 void AddShellObserver(ShellObserver* observer);
271 void RemoveShellObserver(ShellObserver* observer);
272
273#if !defined(OS_MACOSX)
274 AcceleratorController* accelerator_controller() {
275 return accelerator_controller_.get();
276 }
277#endif // !defined(OS_MACOSX)
278
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000279 internal::DisplayManager* display_manager() {
280 return display_manager_.get();
281 }
Torne (Richard Coles)c2e0dbd2013-05-09 18:35:53 +0100282 views::corewm::InputMethodEventFilter* input_method_filter() {
283 return input_method_filter_.get();
284 }
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000285 views::corewm::CompoundEventFilter* env_filter() {
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000286 return env_filter_.get();
287 }
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000288 views::corewm::TooltipController* tooltip_controller() {
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000289 return tooltip_controller_.get();
290 }
291 internal::EventRewriterEventFilter* event_rewriter_filter() {
292 return event_rewriter_filter_.get();
293 }
294 internal::OverlayEventFilter* overlay_filter() {
295 return overlay_filter_.get();
296 }
297 DesktopBackgroundController* desktop_background_controller() {
298 return desktop_background_controller_.get();
299 }
300 PowerButtonController* power_button_controller() {
301 return power_button_controller_.get();
302 }
303 SessionStateController* session_state_controller() {
304 return session_state_controller_.get();
305 }
306 UserActivityDetector* user_activity_detector() {
307 return user_activity_detector_.get();
308 }
309 VideoDetector* video_detector() {
310 return video_detector_.get();
311 }
312 WindowCycleController* window_cycle_controller() {
313 return window_cycle_controller_.get();
314 }
315 internal::FocusCycler* focus_cycler() {
316 return focus_cycler_.get();
317 }
318 DisplayController* display_controller() {
319 return display_controller_.get();
320 }
321 internal::MouseCursorEventFilter* mouse_cursor_filter() {
322 return mouse_cursor_filter_.get();
323 }
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000324 internal::EventTransformationHandler* event_transformation_handler() {
325 return event_transformation_handler_.get();
326 }
327 views::corewm::CursorManager* cursor_manager() { return &cursor_manager_; }
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000328
329 ShellDelegate* delegate() { return delegate_.get(); }
330
331 UserWallpaperDelegate* user_wallpaper_delegate() {
332 return user_wallpaper_delegate_.get();
333 }
334
335 CapsLockDelegate* caps_lock_delegate() {
336 return caps_lock_delegate_.get();
337 }
338
Torne (Richard Coles)c2e0dbd2013-05-09 18:35:53 +0100339 SessionStateDelegate* session_state_delegate() {
340 return session_state_delegate_.get();
341 }
342
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000343 HighContrastController* high_contrast_controller() {
344 return high_contrast_controller_.get();
345 }
346
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000347 MagnificationController* magnification_controller() {
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000348 return magnification_controller_.get();
349 }
350
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000351 PartialMagnificationController* partial_magnification_controller() {
352 return partial_magnification_controller_.get();
353 }
354 aura::client::ActivationClient* activation_client() {
355 return activation_client_;
356 }
357
358 ScreenAsh* screen() { return screen_; }
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000359
360 // Force the shelf to query for it's current visibility state.
361 void UpdateShelfVisibility();
362
363 // TODO(oshima): Define an interface to access shelf/launcher
364 // state, or just use Launcher.
365
366 // Sets/gets the shelf auto-hide behavior on |root_window|.
367 void SetShelfAutoHideBehavior(ShelfAutoHideBehavior behavior,
368 aura::RootWindow* root_window);
369 ShelfAutoHideBehavior GetShelfAutoHideBehavior(
370 aura::RootWindow* root_window) const;
371
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000372 // Sets/gets shelf's alignment on |root_window|.
373 void SetShelfAlignment(ShelfAlignment alignment,
374 aura::RootWindow* root_window);
375 ShelfAlignment GetShelfAlignment(aura::RootWindow* root_window);
376
377 // Dims or undims the screen.
378 void SetDimming(bool should_dim);
379
380 // Creates a modal background (a partially-opaque fullscreen window)
381 // on all displays for |window|.
382 void CreateModalBackground(aura::Window* window);
383
384 // Called when a modal window is removed. It will activate
385 // another modal window if any, or remove modal screens
386 // on all displays.
387 void OnModalWindowRemoved(aura::Window* removed);
388
389 // Returns WebNotificationTray on the primary root window.
390 WebNotificationTray* GetWebNotificationTray();
391
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000392 // Does the primary display have status area?
393 bool HasPrimaryStatusArea();
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000394
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000395 // Returns the system tray on primary display.
396 SystemTray* GetPrimarySystemTray();
397
398 SystemTrayDelegate* system_tray_delegate() {
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000399 return system_tray_delegate_.get();
400 }
401
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000402 SystemTrayNotifier* system_tray_notifier() {
403 return system_tray_notifier_.get();
404 }
405
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000406 static void set_initially_hide_cursor(bool hide) {
407 initially_hide_cursor_ = hide;
408 }
409
410 internal::ResizeShadowController* resize_shadow_controller() {
411 return resize_shadow_controller_.get();
412 }
413
414 // Made available for tests.
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000415 views::corewm::ShadowController* shadow_controller() {
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000416 return shadow_controller_.get();
417 }
418
419 content::BrowserContext* browser_context() { return browser_context_; }
420 void set_browser_context(content::BrowserContext* browser_context) {
421 browser_context_ = browser_context;
422 }
423
424 // Initializes the root window to be used for a secondary display.
425 void InitRootWindowForSecondaryDisplay(aura::RootWindow* root);
426
427 // Starts the animation that occurs on first login.
428 void DoInitialWorkspaceAnimation();
429
Torne (Richard Coles)c2e0dbd2013-05-09 18:35:53 +0100430#if defined(OS_CHROMEOS) && defined(USE_X11)
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000431 // TODO(oshima): Move these objects to DisplayController.
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000432 chromeos::OutputConfigurator* output_configurator() {
433 return output_configurator_.get();
434 }
435 internal::OutputConfiguratorAnimation* output_configurator_animation() {
436 return output_configurator_animation_.get();
437 }
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000438 internal::DisplayErrorObserver* display_error_observer() {
439 return display_error_observer_.get();
440 }
Torne (Richard Coles)c2e0dbd2013-05-09 18:35:53 +0100441#endif // defined(OS_CHROMEOS) && defined(USE_X11)
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000442
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000443 RootWindowHostFactory* root_window_host_factory() {
444 return root_window_host_factory_.get();
445 }
446
447 LauncherModel* launcher_model() {
448 return launcher_model_.get();
449 }
450
451 // Returns the launcher delegate, creating if necesary.
452 LauncherDelegate* GetLauncherDelegate();
453
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000454 private:
455 FRIEND_TEST_ALL_PREFIXES(ExtendedDesktopTest, TestCursor);
456 FRIEND_TEST_ALL_PREFIXES(WindowManagerTest, MouseEventCursors);
457 FRIEND_TEST_ALL_PREFIXES(WindowManagerTest, TransformActivate);
458 friend class internal::RootWindowController;
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000459 friend class test::ShellTestApi;
460 friend class shell::WindowWatcher;
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000461
462 typedef std::pair<aura::Window*, gfx::Rect> WindowAndBoundsPair;
463
Torne (Richard Coles)c2e0dbd2013-05-09 18:35:53 +0100464 // Takes ownership of |delegate|.
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000465 explicit Shell(ShellDelegate* delegate);
466 virtual ~Shell();
467
468 void Init();
469
470 // Initializes the root window and root window controller so that it
471 // can host browser windows.
472 void InitRootWindowController(internal::RootWindowController* root);
473
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000474 // ash::internal::SystemModalContainerEventFilterDelegate overrides:
475 virtual bool CanWindowReceiveEvents(aura::Window* window) OVERRIDE;
476
477 // Overridden from ui::EventTarget:
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000478 virtual bool CanAcceptEvent(const ui::Event& event) OVERRIDE;
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000479 virtual EventTarget* GetParentTarget() OVERRIDE;
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000480 virtual void OnEvent(ui::Event* event) OVERRIDE;
481
482 // Overridden from aura::client::ActivationChangeObserver:
483 virtual void OnWindowActivated(aura::Window* gained_active,
484 aura::Window* lost_active) OVERRIDE;
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000485
486 static Shell* instance_;
487
488 // If set before the Shell is initialized, the mouse cursor will be hidden
489 // when the screen is initially created.
490 static bool initially_hide_cursor_;
491
492 ScreenAsh* screen_;
493
494 // Active root window. Never becomes NULL during the session.
495 aura::RootWindow* active_root_window_;
496
497 // The CompoundEventFilter owned by aura::Env object.
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000498 scoped_ptr<views::corewm::CompoundEventFilter> env_filter_;
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000499
500 std::vector<WindowAndBoundsPair> to_restore_;
501
502#if !defined(OS_MACOSX)
503 scoped_ptr<NestedDispatcherController> nested_dispatcher_controller_;
504
505 scoped_ptr<AcceleratorController> accelerator_controller_;
506#endif // !defined(OS_MACOSX)
507
508 scoped_ptr<ShellDelegate> delegate_;
509 scoped_ptr<SystemTrayDelegate> system_tray_delegate_;
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000510 scoped_ptr<SystemTrayNotifier> system_tray_notifier_;
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000511 scoped_ptr<UserWallpaperDelegate> user_wallpaper_delegate_;
512 scoped_ptr<CapsLockDelegate> caps_lock_delegate_;
Torne (Richard Coles)c2e0dbd2013-05-09 18:35:53 +0100513 scoped_ptr<SessionStateDelegate> session_state_delegate_;
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000514 scoped_ptr<LauncherDelegate> launcher_delegate_;
515
516 scoped_ptr<LauncherModel> launcher_model_;
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000517
518 scoped_ptr<internal::AppListController> app_list_controller_;
519
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000520 scoped_ptr<internal::ActivationController> activation_controller_;
521 scoped_ptr<internal::CaptureController> capture_controller_;
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000522 scoped_ptr<internal::DragDropController> drag_drop_controller_;
523 scoped_ptr<internal::ResizeShadowController> resize_shadow_controller_;
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000524 scoped_ptr<views::corewm::ShadowController> shadow_controller_;
525 scoped_ptr<views::corewm::VisibilityController> visibility_controller_;
526 scoped_ptr<views::corewm::WindowModalityController>
527 window_modality_controller_;
528 scoped_ptr<views::corewm::TooltipController> tooltip_controller_;
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000529 scoped_ptr<DesktopBackgroundController> desktop_background_controller_;
530 scoped_ptr<PowerButtonController> power_button_controller_;
531 scoped_ptr<SessionStateController> session_state_controller_;
532 scoped_ptr<UserActivityDetector> user_activity_detector_;
533 scoped_ptr<VideoDetector> video_detector_;
534 scoped_ptr<WindowCycleController> window_cycle_controller_;
535 scoped_ptr<internal::FocusCycler> focus_cycler_;
536 scoped_ptr<DisplayController> display_controller_;
537 scoped_ptr<HighContrastController> high_contrast_controller_;
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000538 scoped_ptr<MagnificationController> magnification_controller_;
539 scoped_ptr<PartialMagnificationController> partial_magnification_controller_;
540 scoped_ptr<aura::client::FocusClient> focus_client_;
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000541 scoped_ptr<aura::client::UserActionClient> user_action_client_;
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000542 aura::client::ActivationClient* activation_client_;
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000543 scoped_ptr<internal::MouseCursorEventFilter> mouse_cursor_filter_;
544 scoped_ptr<internal::ScreenPositionController> screen_position_controller_;
545 scoped_ptr<internal::SystemModalContainerEventFilter> modality_filter_;
546 scoped_ptr<internal::EventClientImpl> event_client_;
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000547 scoped_ptr<internal::EventTransformationHandler>
548 event_transformation_handler_;
549 scoped_ptr<RootWindowHostFactory> root_window_host_factory_;
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000550
551 // An event filter that rewrites or drops an event.
552 scoped_ptr<internal::EventRewriterEventFilter> event_rewriter_filter_;
553
554 // An event filter that pre-handles key events while the partial
555 // screenshot UI or the keyboard overlay is active.
556 scoped_ptr<internal::OverlayEventFilter> overlay_filter_;
557
558 // An event filter which handles system level gestures
559 scoped_ptr<internal::SystemGestureEventFilter> system_gesture_filter_;
560
561#if !defined(OS_MACOSX)
562 // An event filter that pre-handles global accelerators.
563 scoped_ptr<internal::AcceleratorFilter> accelerator_filter_;
564#endif
565
566 // An event filter that pre-handles all key events to send them to an IME.
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000567 scoped_ptr<views::corewm::InputMethodEventFilter> input_method_filter_;
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000568
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000569 scoped_ptr<internal::DisplayManager> display_manager_;
570
Torne (Richard Coles)c2e0dbd2013-05-09 18:35:53 +0100571#if defined(OS_CHROMEOS) && defined(USE_X11)
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000572 // Controls video output device state.
573 scoped_ptr<chromeos::OutputConfigurator> output_configurator_;
574 scoped_ptr<internal::OutputConfiguratorAnimation>
575 output_configurator_animation_;
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000576 scoped_ptr<internal::DisplayErrorObserver> display_error_observer_;
577
578 // Receives output change events and udpates the display manager.
579 scoped_ptr<internal::DisplayChangeObserverX11> display_change_observer_;
Torne (Richard Coles)c2e0dbd2013-05-09 18:35:53 +0100580#endif // defined(OS_CHROMEOS) && defined(USE_X11)
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000581
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000582 // |native_cursor_manager_| is owned by |cursor_manager_|, but we keep a
583 // pointer to vend to test code.
584 AshNativeCursorManager* native_cursor_manager_;
585 views::corewm::CursorManager cursor_manager_;
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000586
587 ObserverList<ShellObserver> observers_;
588
589 // Used by ash/shell.
590 content::BrowserContext* browser_context_;
591
592 // For testing only: simulate that a modal window is open
593 bool simulate_modal_window_open_for_testing_;
594
595 DISALLOW_COPY_AND_ASSIGN(Shell);
596};
597
598} // namespace ash
599
600#endif // ASH_SHELL_H_