blob: 14e1f9144cdffef725d80b85ce2509ac741efe46 [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)5d1f7b12014-02-21 12:16:55 +000012#include "ash/metrics/user_metrics_recorder.h"
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +000013#include "ash/shelf/shelf_types.h"
Torne (Richard Coles)58218062012-11-14 11:43:16 +000014#include "ash/system/user/login_status.h"
Ben Murdochc5cede92014-04-10 11:22:14 +010015#include "ash/wm/cursor_manager_chromeos.h"
Torne (Richard Coles)58218062012-11-14 11:43:16 +000016#include "ash/wm/system_modal_container_event_filter_delegate.h"
17#include "base/basictypes.h"
18#include "base/compiler_specific.h"
19#include "base/gtest_prod_util.h"
20#include "base/memory/scoped_ptr.h"
Torne (Richard Coles)1e9bf3e2013-10-31 11:16:26 +000021#include "base/memory/weak_ptr.h"
Torne (Richard Coles)58218062012-11-14 11:43:16 +000022#include "base/observer_list.h"
Torne (Richard Coles)f2477e02013-11-28 11:55:43 +000023#include "ui/aura/window.h"
Torne (Richard Coles)7d4cd472013-06-19 11:58:07 +010024#include "ui/base/ui_base_types.h"
Torne (Richard Coles)d0247b12013-09-19 22:36:51 +010025#include "ui/events/event_target.h"
Torne (Richard Coles)58218062012-11-14 11:43:16 +000026#include "ui/gfx/insets.h"
27#include "ui/gfx/screen.h"
28#include "ui/gfx/size.h"
Torne (Richard Coles)a1401312014-03-18 10:20:56 +000029#include "ui/wm/core/cursor_manager.h"
Ben Murdocheffb81e2014-03-31 11:51:25 +010030#include "ui/wm/public/activation_change_observer.h"
Torne (Richard Coles)58218062012-11-14 11:43:16 +000031
Torne (Richard Coles)8bcbed82013-10-22 16:41:35 +010032namespace app_list {
33class AppListView;
34}
Torne (Richard Coles)58218062012-11-14 11:43:16 +000035namespace aura {
36class EventFilter;
Torne (Richard Coles)58218062012-11-14 11:43:16 +000037class RootWindow;
38class Window;
39namespace client {
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +000040class ActivationClient;
41class FocusClient;
Torne (Richard Coles)58218062012-11-14 11:43:16 +000042}
Torne (Richard Coles)58218062012-11-14 11:43:16 +000043}
Torne (Richard Coles)58218062012-11-14 11:43:16 +000044
45namespace gfx {
46class ImageSkia;
47class Point;
48class Rect;
49}
Torne (Richard Coles)4e180b62013-10-18 15:46:22 +010050
Torne (Richard Coles)58218062012-11-14 11:43:16 +000051namespace ui {
Ben Murdochc5cede92014-04-10 11:22:14 +010052class DisplayConfigurator;
Torne (Richard Coles)58218062012-11-14 11:43:16 +000053class Layer;
Ben Murdoch0529e5d2014-04-24 10:50:13 +010054class UserActivityPowerManagerNotifier;
Torne (Richard Coles)58218062012-11-14 11:43:16 +000055}
56namespace views {
57class NonClientFrameView;
58class Widget;
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +000059namespace corewm {
Torne (Richard Coles)a1401312014-03-18 10:20:56 +000060class TooltipController;
61}
62}
63
64namespace wm {
Torne (Richard Coles)cedac222014-06-03 10:58:34 +010065class AcceleratorFilter;
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +000066class CompoundEventFilter;
67class InputMethodEventFilter;
Torne (Richard Coles)cedac222014-06-03 10:58:34 +010068class NestedAcceleratorController;
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +000069class ShadowController;
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +000070class VisibilityController;
Ben Murdochc5cede92014-04-10 11:22:14 +010071class UserActivityDetector;
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +000072class WindowModalityController;
73}
Torne (Richard Coles)58218062012-11-14 11:43:16 +000074
75namespace ash {
76
77class AcceleratorController;
Ben Murdochc5cede92014-04-10 11:22:14 +010078class AccelerometerController;
Torne (Richard Coles)1e9bf3e2013-10-31 11:16:26 +000079class AccessibilityDelegate;
Ben Murdochc5cede92014-04-10 11:22:14 +010080class AppListController;
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +000081class AshNativeCursorManager;
Torne (Richard Coles)4e180b62013-10-18 15:46:22 +010082class AutoclickController;
Torne (Richard Coles)a1401312014-03-18 10:20:56 +000083class BluetoothNotificationController;
Torne (Richard Coles)58218062012-11-14 11:43:16 +000084class CaptureController;
Ben Murdochc5cede92014-04-10 11:22:14 +010085class DesktopBackgroundController;
Torne (Richard Coles)3551c9c2013-08-23 16:39:15 +010086class DisplayChangeObserver;
Bo Liu5c02ac12014-05-01 10:37:37 -070087class DisplayConfiguratorAnimation;
Ben Murdochc5cede92014-04-10 11:22:14 +010088class DisplayController;
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +000089class DisplayErrorObserver;
90class DisplayManager;
Torne (Richard Coles)58218062012-11-14 11:43:16 +000091class DragDropController;
92class EventClientImpl;
93class EventRewriterEventFilter;
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +000094class EventTransformationHandler;
Ben Murdochc5cede92014-04-10 11:22:14 +010095class FirstRunHelper;
Torne (Richard Coles)58218062012-11-14 11:43:16 +000096class FocusCycler;
Ben Murdochc5cede92014-04-10 11:22:14 +010097class GPUSupport;
98class HighContrastController;
Torne (Richard Coles)4e180b62013-10-18 15:46:22 +010099class KeyboardUMAEventFilter;
Torne (Richard Coles)a1401312014-03-18 10:20:56 +0000100class LastWindowClosedLogoutReminder;
Torne (Richard Coles)a36e5922013-08-05 13:57:33 +0100101class LocaleNotificationController;
Ben Murdochc5cede92014-04-10 11:22:14 +0100102class LockStateController;
Torne (Richard Coles)a1401312014-03-18 10:20:56 +0000103class LogoutConfirmationController;
Ben Murdochc5cede92014-04-10 11:22:14 +0100104class MagnificationController;
105class MaximizeModeController;
Torne (Richard Coles)a1401312014-03-18 10:20:56 +0000106class MaximizeModeWindowManager;
Ben Murdochc5cede92014-04-10 11:22:14 +0100107class MediaDelegate;
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000108class MouseCursorEventFilter;
Ben Murdochc5cede92014-04-10 11:22:14 +0100109class MruWindowTracker;
Ben Murdochc5cede92014-04-10 11:22:14 +0100110class NewWindowDelegate;
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000111class OverlayEventFilter;
Ben Murdochc5cede92014-04-10 11:22:14 +0100112class PartialMagnificationController;
113class PowerButtonController;
Torne (Richard Coles)4e180b62013-10-18 15:46:22 +0100114class PowerEventObserver;
Torne (Richard Coles)5d1f7b12014-02-21 12:16:55 +0000115class ProjectingObserver;
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000116class ResizeShadowController;
Ben Murdochba5b9a62013-08-12 14:20:17 +0100117class ResolutionNotificationController;
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000118class RootWindowController;
Torne (Richard Coles)a36e5922013-08-05 13:57:33 +0100119class ScopedTargetRootWindow;
Ben Murdochc5cede92014-04-10 11:22:14 +0100120class ScreenAsh;
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000121class ScreenPositionController;
Ben Murdochc5cede92014-04-10 11:22:14 +0100122class SessionStateDelegate;
123class Shelf;
124class ShelfDelegate;
125class ShelfItemDelegateManager;
126class ShelfModel;
Torne (Richard Coles)a3f6a492013-12-18 16:25:09 +0000127class ShelfWindowWatcher;
Ben Murdochc5cede92014-04-10 11:22:14 +0100128class ShellDelegate;
Torne (Richard Coles)cedac222014-06-03 10:58:34 +0100129struct ShellInitParams;
Ben Murdochc5cede92014-04-10 11:22:14 +0100130class ShellObserver;
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000131class SlowAnimationEventFilter;
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000132class StatusAreaWidget;
Ben Murdochc5cede92014-04-10 11:22:14 +0100133class StickyKeysController;
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000134class SystemGestureEventFilter;
135class SystemModalContainerEventFilter;
Ben Murdochc5cede92014-04-10 11:22:14 +0100136class SystemTray;
137class SystemTrayDelegate;
138class SystemTrayNotifier;
139class ToplevelWindowEventHandler;
Torne (Richard Coles)cedac222014-06-03 10:58:34 +0100140class TouchTransformerController;
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000141class TouchObserverHUD;
Ben Murdochc5cede92014-04-10 11:22:14 +0100142class UserActivityDetector;
143class UserWallpaperDelegate;
Torne (Richard Coles)4e180b62013-10-18 15:46:22 +0100144class VideoActivityNotifier;
Ben Murdochc5cede92014-04-10 11:22:14 +0100145class VideoDetector;
146class WebNotificationTray;
147class WindowCycleController;
148class WindowPositioner;
149class WindowSelectorController;
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000150
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000151namespace shell {
152class WindowWatcher;
153}
154
155namespace test {
156class ShellTestApi;
157}
158
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000159// Shell is a singleton object that presents the Shell API and implements the
160// RootWindow's delegate interface.
161//
162// Upon creation, the Shell sets itself as the RootWindow's delegate, which
163// takes ownership of the Shell.
Ben Murdochc5cede92014-04-10 11:22:14 +0100164class ASH_EXPORT Shell : public SystemModalContainerEventFilterDelegate,
165 public ui::EventTarget,
166 public aura::client::ActivationChangeObserver {
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000167 public:
Ben Murdochc5cede92014-04-10 11:22:14 +0100168 typedef std::vector<RootWindowController*> RootWindowControllerList;
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000169
170 enum Direction {
171 FORWARD,
172 BACKWARD
173 };
174
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000175 // A shell must be explicitly created so that it can call |Init()| with the
176 // delegate set. |delegate| can be NULL (if not required for initialization).
Torne (Richard Coles)c2e0dbd2013-05-09 18:35:53 +0100177 // Takes ownership of |delegate|.
Torne (Richard Coles)cedac222014-06-03 10:58:34 +0100178 static Shell* CreateInstance(const ShellInitParams& init_params);
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000179
180 // Should never be called before |CreateInstance()|.
181 static Shell* GetInstance();
182
183 // Returns true if the ash shell has been instantiated.
184 static bool HasInstance();
185
186 static void DeleteInstance();
187
188 // Returns the root window controller for the primary root window.
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000189 // TODO(oshima): move this to |RootWindowController|
Ben Murdochc5cede92014-04-10 11:22:14 +0100190 static RootWindowController* GetPrimaryRootWindowController();
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000191
192 // Returns all root window controllers.
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000193 // TODO(oshima): move this to |RootWindowController|
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000194 static RootWindowControllerList GetAllRootWindowControllers();
195
Torne (Richard Coles)1e9bf3e2013-10-31 11:16:26 +0000196 // Returns the primary root Window. The primary root Window is the one that
197 // has a launcher.
198 static aura::Window* GetPrimaryRootWindow();
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000199
Torne (Richard Coles)1e9bf3e2013-10-31 11:16:26 +0000200 // Returns a root Window when used as a target when creating a new window.
Torne (Richard Coles)a36e5922013-08-05 13:57:33 +0100201 // The root window of the active window is used in most cases, but can
202 // be overridden by using ScopedTargetRootWindow().
Torne (Richard Coles)1e9bf3e2013-10-31 11:16:26 +0000203 // If you want to get the root Window of the active window, just use
Torne (Richard Coles)a36e5922013-08-05 13:57:33 +0100204 // |wm::GetActiveWindow()->GetRootWindow()|.
Torne (Richard Coles)1e9bf3e2013-10-31 11:16:26 +0000205 static aura::Window* GetTargetRootWindow();
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000206
207 // Returns the global Screen object that's always active in ash.
208 static gfx::Screen* GetScreen();
209
210 // Returns all root windows.
Torne (Richard Coles)f2477e02013-11-28 11:55:43 +0000211 static aura::Window::Windows GetAllRootWindows();
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000212
Torne (Richard Coles)1e9bf3e2013-10-31 11:16:26 +0000213 static aura::Window* GetContainer(aura::Window* root_window,
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000214 int container_id);
Torne (Richard Coles)1e9bf3e2013-10-31 11:16:26 +0000215 static const aura::Window* GetContainer(const aura::Window* root_window,
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000216 int container_id);
217
218 // Returns the list of containers that match |container_id| in
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000219 // all root windows. If |priority_root| is given, the container
220 // in the |priority_root| will be inserted at the top of the list.
221 static std::vector<aura::Window*> GetContainersFromAllRootWindows(
222 int container_id,
Torne (Richard Coles)1e9bf3e2013-10-31 11:16:26 +0000223 aura::Window* priority_root);
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000224
Torne (Richard Coles)1e9bf3e2013-10-31 11:16:26 +0000225 void set_target_root_window(aura::Window* target_root_window) {
Torne (Richard Coles)a36e5922013-08-05 13:57:33 +0100226 target_root_window_ = target_root_window;
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000227 }
228
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000229 // Shows the context menu for the background and launcher at
230 // |location_in_screen| (in screen coordinates).
Torne (Richard Coles)7d4cd472013-06-19 11:58:07 +0100231 void ShowContextMenu(const gfx::Point& location_in_screen,
232 ui::MenuSourceType source_type);
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000233
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000234 // Toggles the app list. |window| specifies in which display the app
235 // list should be shown. If this is NULL, the active root window
236 // will be used.
237 void ToggleAppList(aura::Window* anchor);
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000238
239 // Returns app list target visibility.
240 bool GetAppListTargetVisibility() const;
241
242 // Returns app list window or NULL if it is not visible.
243 aura::Window* GetAppListWindow();
244
Torne (Richard Coles)8bcbed82013-10-22 16:41:35 +0100245 // Returns app list view or NULL if it is not visible.
246 app_list::AppListView* GetAppListView();
247
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000248 // Returns true if a system-modal dialog window is currently open.
249 bool IsSystemModalWindowOpen() const;
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000250
251 // For testing only: set simulation that a modal window is open
252 void SimulateModalWindowOpenForTesting(bool modal_window_open) {
253 simulate_modal_window_open_for_testing_ = modal_window_open;
254 }
255
256 // Creates a default views::NonClientFrameView for use by windows in the
257 // Ash environment.
258 views::NonClientFrameView* CreateDefaultNonClientFrameView(
259 views::Widget* widget);
260
261 // Rotates focus through containers that can receive focus.
262 void RotateFocus(Direction direction);
263
264 // Sets the work area insets of the display that contains |window|,
265 // this notifies observers too.
266 // TODO(sky): this no longer really replicates what happens and is unreliable.
267 // Remove this.
268 void SetDisplayWorkAreaInsets(aura::Window* window,
269 const gfx::Insets& insets);
270
271 // Called when the user logs in.
272 void OnLoginStateChanged(user::LoginStatus status);
273
Torne (Richard Coles)f2477e02013-11-28 11:55:43 +0000274 // Called after the logged-in user's profile is ready.
275 void OnLoginUserProfilePrepared();
276
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000277 // Called when the login status changes.
278 // TODO(oshima): Investigate if we can merge this and |OnLoginStateChanged|.
279 void UpdateAfterLoginStatusChange(user::LoginStatus status);
280
281 // Called when the application is exiting.
282 void OnAppTerminating();
283
284 // Called when the screen is locked (after the lock window is visible) or
285 // unlocked.
286 void OnLockStateChanged(bool locked);
287
Torne (Richard Coles)5d1f7b12014-02-21 12:16:55 +0000288 // Called when a casting session is started or stopped.
289 void OnCastingSessionStartedOrStopped(bool started);
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000290
Torne (Richard Coles)a1401312014-03-18 10:20:56 +0000291 // Called when the overview mode is about to be started (before the windows
292 // get re-arranged).
293 void OnOverviewModeStarting();
294
295 // Called before the overview mode is ending (before the windows get arranged
296 // to their final position).
297 void OnOverviewModeEnding();
298
299 // Called after maximize mode has started, windows might still animate though.
300 void OnMaximizeModeStarted();
301
302 // Called after maximize mode has ended, windows might still be returning to
303 // their original position.
304 void OnMaximizeModeEnded();
305
Ben Murdocha02191e2014-04-16 11:17:03 +0100306 // Called when a root window is created.
307 void OnRootWindowAdded(aura::Window* root_window);
308
Torne (Richard Coles)5d1f7b12014-02-21 12:16:55 +0000309 // Initializes |shelf_|. Does nothing if it's already initialized.
310 void CreateShelf();
311
Ben Murdoch0529e5d2014-04-24 10:50:13 +0100312 // Called when the shelf is created for |root_window|.
313 void OnShelfCreatedForRootWindow(aura::Window* root_window);
314
Torne (Richard Coles)5d1f7b12014-02-21 12:16:55 +0000315 // Creates a virtual keyboard. Deletes the old virtual keyboard if it already
316 // exists.
Torne (Richard Coles)f2477e02013-11-28 11:55:43 +0000317 void CreateKeyboard();
318
Torne (Richard Coles)5d1f7b12014-02-21 12:16:55 +0000319 // Deactivates the virtual keyboard.
320 void DeactivateKeyboard();
321
Torne (Richard Coles)8bcbed82013-10-22 16:41:35 +0100322 // Show shelf view if it was created hidden (before session has started).
Torne (Richard Coles)5d1f7b12014-02-21 12:16:55 +0000323 void ShowShelf();
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000324
325 // Adds/removes observer.
326 void AddShellObserver(ShellObserver* observer);
327 void RemoveShellObserver(ShellObserver* observer);
328
Torne (Richard Coles)cedac222014-06-03 10:58:34 +0100329#if defined(OS_CHROMEOS)
330 // Test if MaximizeModeWindowManager is not enabled, and if
331 // MaximizeModeController is not currently setting a display rotation. Or if
332 // the |resolution_notification_controller_| is not showing its confirmation
333 // dialog. If true then changes to display settings can be saved.
334 bool ShouldSaveDisplaySettings();
335#endif
336
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000337 AcceleratorController* accelerator_controller() {
338 return accelerator_controller_.get();
339 }
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000340
Ben Murdochc5cede92014-04-10 11:22:14 +0100341 DisplayManager* display_manager() { return display_manager_.get(); }
Torne (Richard Coles)a1401312014-03-18 10:20:56 +0000342 ::wm::InputMethodEventFilter* input_method_filter() {
Torne (Richard Coles)c2e0dbd2013-05-09 18:35:53 +0100343 return input_method_filter_.get();
344 }
Torne (Richard Coles)a1401312014-03-18 10:20:56 +0000345 ::wm::CompoundEventFilter* env_filter() {
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000346 return env_filter_.get();
347 }
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000348 views::corewm::TooltipController* tooltip_controller() {
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000349 return tooltip_controller_.get();
350 }
Ben Murdochc5cede92014-04-10 11:22:14 +0100351 OverlayEventFilter* overlay_filter() { return overlay_filter_.get(); }
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000352 DesktopBackgroundController* desktop_background_controller() {
353 return desktop_background_controller_.get();
354 }
355 PowerButtonController* power_button_controller() {
356 return power_button_controller_.get();
357 }
Torne (Richard Coles)868fa2f2013-06-11 10:57:03 +0100358 LockStateController* lock_state_controller() {
359 return lock_state_controller_.get();
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000360 }
Torne (Richard Coles)a36e5922013-08-05 13:57:33 +0100361 MruWindowTracker* mru_window_tracker() {
362 return mru_window_tracker_.get();
363 }
Ben Murdochc5cede92014-04-10 11:22:14 +0100364 ::wm::UserActivityDetector* user_activity_detector() {
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000365 return user_activity_detector_.get();
366 }
367 VideoDetector* video_detector() {
368 return video_detector_.get();
369 }
Torne (Richard Coles)cedac222014-06-03 10:58:34 +0100370 WindowCycleController* window_cycle_controller() {
371 return window_cycle_controller_.get();
372 }
Torne (Richard Coles)a36e5922013-08-05 13:57:33 +0100373 WindowSelectorController* window_selector_controller() {
374 return window_selector_controller_.get();
375 }
Ben Murdochc5cede92014-04-10 11:22:14 +0100376 FocusCycler* focus_cycler() { return focus_cycler_.get(); }
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000377 DisplayController* display_controller() {
378 return display_controller_.get();
379 }
Torne (Richard Coles)cedac222014-06-03 10:58:34 +0100380#if defined(OS_CHROMEOS) && defined(USE_X11)
381 TouchTransformerController* touch_transformer_controller() {
382 return touch_transformer_controller_.get();
383 }
384#endif // defined(OS_CHROMEOS) && defined(USE_X11)
Ben Murdochc5cede92014-04-10 11:22:14 +0100385 MouseCursorEventFilter* mouse_cursor_filter() {
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000386 return mouse_cursor_filter_.get();
387 }
Ben Murdochc5cede92014-04-10 11:22:14 +0100388 EventTransformationHandler* event_transformation_handler() {
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000389 return event_transformation_handler_.get();
390 }
Torne (Richard Coles)a1401312014-03-18 10:20:56 +0000391 ::wm::CursorManager* cursor_manager() { return &cursor_manager_; }
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000392
393 ShellDelegate* delegate() { return delegate_.get(); }
394
395 UserWallpaperDelegate* user_wallpaper_delegate() {
396 return user_wallpaper_delegate_.get();
397 }
398
Torne (Richard Coles)c2e0dbd2013-05-09 18:35:53 +0100399 SessionStateDelegate* session_state_delegate() {
400 return session_state_delegate_.get();
401 }
402
Torne (Richard Coles)1e9bf3e2013-10-31 11:16:26 +0000403 AccessibilityDelegate* accessibility_delegate() {
404 return accessibility_delegate_.get();
405 }
406
407 NewWindowDelegate* new_window_delegate() {
408 return new_window_delegate_.get();
409 }
410
Torne (Richard Coles)0f1bc082013-11-06 12:27:47 +0000411 MediaDelegate* media_delegate() {
412 return media_delegate_.get();
413 }
414
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000415 HighContrastController* high_contrast_controller() {
416 return high_contrast_controller_.get();
417 }
418
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000419 MagnificationController* magnification_controller() {
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000420 return magnification_controller_.get();
421 }
422
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000423 PartialMagnificationController* partial_magnification_controller() {
424 return partial_magnification_controller_.get();
425 }
Torne (Richard Coles)4e180b62013-10-18 15:46:22 +0100426
427 AutoclickController* autoclick_controller() {
428 return autoclick_controller_.get();
429 }
430
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000431 aura::client::ActivationClient* activation_client() {
432 return activation_client_;
433 }
434
Torne (Richard Coles)a3f6a492013-12-18 16:25:09 +0000435 ShelfItemDelegateManager* shelf_item_delegate_manager() {
436 return shelf_item_delegate_manager_.get();
Torne (Richard Coles)424c4d72013-08-30 15:14:49 +0100437 }
438
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000439 // Force the shelf to query for it's current visibility state.
440 void UpdateShelfVisibility();
441
442 // TODO(oshima): Define an interface to access shelf/launcher
443 // state, or just use Launcher.
444
445 // Sets/gets the shelf auto-hide behavior on |root_window|.
446 void SetShelfAutoHideBehavior(ShelfAutoHideBehavior behavior,
Torne (Richard Coles)1e9bf3e2013-10-31 11:16:26 +0000447 aura::Window* root_window);
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000448 ShelfAutoHideBehavior GetShelfAutoHideBehavior(
Torne (Richard Coles)1e9bf3e2013-10-31 11:16:26 +0000449 aura::Window* root_window) const;
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000450
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000451 // Sets/gets shelf's alignment on |root_window|.
452 void SetShelfAlignment(ShelfAlignment alignment,
Torne (Richard Coles)1e9bf3e2013-10-31 11:16:26 +0000453 aura::Window* root_window);
Torne (Richard Coles)f8ee7882014-06-20 14:52:04 +0100454 ShelfAlignment GetShelfAlignment(const aura::Window* root_window);
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000455
456 // Dims or undims the screen.
457 void SetDimming(bool should_dim);
458
Torne (Richard Coles)4e180b62013-10-18 15:46:22 +0100459 // Notifies |observers_| when entering or exiting fullscreen mode in
460 // |root_window|.
461 void NotifyFullscreenStateChange(bool is_fullscreen,
Torne (Richard Coles)1e9bf3e2013-10-31 11:16:26 +0000462 aura::Window* root_window);
Torne (Richard Coles)4e180b62013-10-18 15:46:22 +0100463
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000464 // Creates a modal background (a partially-opaque fullscreen window)
465 // on all displays for |window|.
466 void CreateModalBackground(aura::Window* window);
467
468 // Called when a modal window is removed. It will activate
469 // another modal window if any, or remove modal screens
470 // on all displays.
471 void OnModalWindowRemoved(aura::Window* removed);
472
473 // Returns WebNotificationTray on the primary root window.
474 WebNotificationTray* GetWebNotificationTray();
475
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000476 // Does the primary display have status area?
477 bool HasPrimaryStatusArea();
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000478
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000479 // Returns the system tray on primary display.
480 SystemTray* GetPrimarySystemTray();
481
482 SystemTrayDelegate* system_tray_delegate() {
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000483 return system_tray_delegate_.get();
484 }
485
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000486 SystemTrayNotifier* system_tray_notifier() {
487 return system_tray_notifier_.get();
488 }
489
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000490 static void set_initially_hide_cursor(bool hide) {
491 initially_hide_cursor_ = hide;
492 }
493
Ben Murdochc5cede92014-04-10 11:22:14 +0100494 ResizeShadowController* resize_shadow_controller() {
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000495 return resize_shadow_controller_.get();
496 }
497
498 // Made available for tests.
Torne (Richard Coles)a1401312014-03-18 10:20:56 +0000499 ::wm::ShadowController* shadow_controller() {
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000500 return shadow_controller_.get();
501 }
502
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000503 // Starts the animation that occurs on first login.
504 void DoInitialWorkspaceAnimation();
505
Ben Murdochc5cede92014-04-10 11:22:14 +0100506 AccelerometerController* accelerometer_controller() {
507 return accelerometer_controller_.get();
508 }
509
510 MaximizeModeController* maximize_mode_controller() {
511 return maximize_mode_controller_.get();
512 }
513
Torne (Richard Coles)5d1f7b12014-02-21 12:16:55 +0000514#if defined(OS_CHROMEOS)
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000515 // TODO(oshima): Move these objects to DisplayController.
Ben Murdochc5cede92014-04-10 11:22:14 +0100516 ui::DisplayConfigurator* display_configurator() {
517 return display_configurator_.get();
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000518 }
Bo Liu5c02ac12014-05-01 10:37:37 -0700519 DisplayConfiguratorAnimation* display_configurator_animation() {
520 return display_configurator_animation_.get();
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000521 }
Ben Murdochc5cede92014-04-10 11:22:14 +0100522 DisplayErrorObserver* display_error_observer() {
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000523 return display_error_observer_.get();
524 }
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000525
Ben Murdochc5cede92014-04-10 11:22:14 +0100526 ResolutionNotificationController* resolution_notification_controller() {
Ben Murdochba5b9a62013-08-12 14:20:17 +0100527 return resolution_notification_controller_.get();
528 }
Torne (Richard Coles)a1401312014-03-18 10:20:56 +0000529
Ben Murdochc5cede92014-04-10 11:22:14 +0100530 LogoutConfirmationController* logout_confirmation_controller() {
Torne (Richard Coles)a1401312014-03-18 10:20:56 +0000531 return logout_confirmation_controller_.get();
532 }
Torne (Richard Coles)5d1f7b12014-02-21 12:16:55 +0000533#endif // defined(OS_CHROMEOS)
Ben Murdochba5b9a62013-08-12 14:20:17 +0100534
Torne (Richard Coles)f2477e02013-11-28 11:55:43 +0000535 ShelfModel* shelf_model() {
536 return shelf_model_.get();
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000537 }
538
Torne (Richard Coles)4e180b62013-10-18 15:46:22 +0100539 WindowPositioner* window_positioner() {
540 return window_positioner_.get();
541 }
542
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000543 // Returns the launcher delegate, creating if necesary.
Torne (Richard Coles)a3f6a492013-12-18 16:25:09 +0000544 ShelfDelegate* GetShelfDelegate();
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000545
Torne (Richard Coles)5d1f7b12014-02-21 12:16:55 +0000546 UserMetricsRecorder* metrics() {
547 return user_metrics_recorder_.get();
548 }
549
Ben Murdocheb525c52013-07-10 11:40:50 +0100550 void SetTouchHudProjectionEnabled(bool enabled);
551
552 bool is_touch_hud_projection_enabled() const {
553 return is_touch_hud_projection_enabled_;
554 }
555
Torne (Richard Coles)8bcbed82013-10-22 16:41:35 +0100556#if defined(OS_CHROMEOS)
557 // Creates instance of FirstRunHelper. Caller is responsible for deleting
558 // returned object.
559 ash::FirstRunHelper* CreateFirstRunHelper();
Torne (Richard Coles)f2477e02013-11-28 11:55:43 +0000560
Torne (Richard Coles)5d1f7b12014-02-21 12:16:55 +0000561 // Toggles cursor compositing on/off. Native cursor is disabled when cursor
562 // compositing is enabled, and vice versa.
563 void SetCursorCompositingEnabled(bool enabled);
564
565 StickyKeysController* sticky_keys_controller() {
566 return sticky_keys_controller_.get();
Torne (Richard Coles)f2477e02013-11-28 11:55:43 +0000567 }
Torne (Richard Coles)8bcbed82013-10-22 16:41:35 +0100568#endif // defined(OS_CHROMEOS)
569
Torne (Richard Coles)5d1f7b12014-02-21 12:16:55 +0000570 GPUSupport* gpu_support() { return gpu_support_.get(); }
571
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000572 private:
573 FRIEND_TEST_ALL_PREFIXES(ExtendedDesktopTest, TestCursor);
574 FRIEND_TEST_ALL_PREFIXES(WindowManagerTest, MouseEventCursors);
575 FRIEND_TEST_ALL_PREFIXES(WindowManagerTest, TransformActivate);
Ben Murdochc5cede92014-04-10 11:22:14 +0100576 friend class RootWindowController;
577 friend class ScopedTargetRootWindow;
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000578 friend class test::ShellTestApi;
579 friend class shell::WindowWatcher;
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000580
581 typedef std::pair<aura::Window*, gfx::Rect> WindowAndBoundsPair;
582
Torne (Richard Coles)c2e0dbd2013-05-09 18:35:53 +0100583 // Takes ownership of |delegate|.
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000584 explicit Shell(ShellDelegate* delegate);
585 virtual ~Shell();
586
Torne (Richard Coles)cedac222014-06-03 10:58:34 +0100587 void Init(const ShellInitParams& init_params);
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000588
Torne (Richard Coles)f2477e02013-11-28 11:55:43 +0000589 // Initializes virtual keyboard controller.
590 void InitKeyboard();
Torne (Richard Coles)4e180b62013-10-18 15:46:22 +0100591
Torne (Richard Coles)8bcbed82013-10-22 16:41:35 +0100592 // Initializes the root window so that it can host browser windows.
Torne (Richard Coles)f2477e02013-11-28 11:55:43 +0000593 void InitRootWindow(aura::Window* root_window);
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000594
Ben Murdochc5cede92014-04-10 11:22:14 +0100595 // ash::SystemModalContainerEventFilterDelegate overrides:
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000596 virtual bool CanWindowReceiveEvents(aura::Window* window) OVERRIDE;
597
598 // Overridden from ui::EventTarget:
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000599 virtual bool CanAcceptEvent(const ui::Event& event) OVERRIDE;
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000600 virtual EventTarget* GetParentTarget() OVERRIDE;
Torne (Richard Coles)a3f6a492013-12-18 16:25:09 +0000601 virtual scoped_ptr<ui::EventTargetIterator> GetChildIterator() const OVERRIDE;
602 virtual ui::EventTargeter* GetEventTargeter() OVERRIDE;
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000603 virtual void OnEvent(ui::Event* event) OVERRIDE;
604
605 // Overridden from aura::client::ActivationChangeObserver:
606 virtual void OnWindowActivated(aura::Window* gained_active,
607 aura::Window* lost_active) OVERRIDE;
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000608
609 static Shell* instance_;
610
611 // If set before the Shell is initialized, the mouse cursor will be hidden
612 // when the screen is initially created.
613 static bool initially_hide_cursor_;
614
Torne (Richard Coles)a36e5922013-08-05 13:57:33 +0100615 // When no explicit target display/RootWindow is given, new windows are
616 // created on |scoped_target_root_window_| , unless NULL in
617 // which case they are created on |target_root_window_|.
618 // |target_root_window_| never becomes NULL during the session.
Torne (Richard Coles)1e9bf3e2013-10-31 11:16:26 +0000619 aura::Window* target_root_window_;
620 aura::Window* scoped_target_root_window_;
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000621
622 // The CompoundEventFilter owned by aura::Env object.
Torne (Richard Coles)a1401312014-03-18 10:20:56 +0000623 scoped_ptr< ::wm::CompoundEventFilter> env_filter_;
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000624
625 std::vector<WindowAndBoundsPair> to_restore_;
626
Torne (Richard Coles)5d1f7b12014-02-21 12:16:55 +0000627 scoped_ptr<UserMetricsRecorder> user_metrics_recorder_;
Torne (Richard Coles)cedac222014-06-03 10:58:34 +0100628 scoped_ptr< ::wm::NestedAcceleratorController> nested_accelerator_controller_;
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000629 scoped_ptr<AcceleratorController> accelerator_controller_;
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000630 scoped_ptr<ShellDelegate> delegate_;
631 scoped_ptr<SystemTrayDelegate> system_tray_delegate_;
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000632 scoped_ptr<SystemTrayNotifier> system_tray_notifier_;
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000633 scoped_ptr<UserWallpaperDelegate> user_wallpaper_delegate_;
Torne (Richard Coles)c2e0dbd2013-05-09 18:35:53 +0100634 scoped_ptr<SessionStateDelegate> session_state_delegate_;
Torne (Richard Coles)1e9bf3e2013-10-31 11:16:26 +0000635 scoped_ptr<AccessibilityDelegate> accessibility_delegate_;
636 scoped_ptr<NewWindowDelegate> new_window_delegate_;
Torne (Richard Coles)0f1bc082013-11-06 12:27:47 +0000637 scoped_ptr<MediaDelegate> media_delegate_;
Torne (Richard Coles)a3f6a492013-12-18 16:25:09 +0000638 scoped_ptr<ShelfDelegate> shelf_delegate_;
639 scoped_ptr<ShelfItemDelegateManager> shelf_item_delegate_manager_;
Ben Murdochc5cede92014-04-10 11:22:14 +0100640 scoped_ptr<ShelfWindowWatcher> shelf_window_watcher_;
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000641
Torne (Richard Coles)f2477e02013-11-28 11:55:43 +0000642 scoped_ptr<ShelfModel> shelf_model_;
643 scoped_ptr<WindowPositioner> window_positioner_;
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000644
Ben Murdochc5cede92014-04-10 11:22:14 +0100645 scoped_ptr<AppListController> app_list_controller_;
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000646
Ben Murdochc5cede92014-04-10 11:22:14 +0100647 scoped_ptr<DragDropController> drag_drop_controller_;
648 scoped_ptr<ResizeShadowController> resize_shadow_controller_;
Torne (Richard Coles)a1401312014-03-18 10:20:56 +0000649 scoped_ptr< ::wm::ShadowController> shadow_controller_;
650 scoped_ptr< ::wm::VisibilityController> visibility_controller_;
651 scoped_ptr< ::wm::WindowModalityController> window_modality_controller_;
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000652 scoped_ptr<views::corewm::TooltipController> tooltip_controller_;
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000653 scoped_ptr<DesktopBackgroundController> desktop_background_controller_;
654 scoped_ptr<PowerButtonController> power_button_controller_;
Torne (Richard Coles)868fa2f2013-06-11 10:57:03 +0100655 scoped_ptr<LockStateController> lock_state_controller_;
Torne (Richard Coles)a36e5922013-08-05 13:57:33 +0100656 scoped_ptr<MruWindowTracker> mru_window_tracker_;
Ben Murdochc5cede92014-04-10 11:22:14 +0100657 scoped_ptr< ::wm::UserActivityDetector> user_activity_detector_;
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000658 scoped_ptr<VideoDetector> video_detector_;
Torne (Richard Coles)cedac222014-06-03 10:58:34 +0100659 scoped_ptr<WindowCycleController> window_cycle_controller_;
Torne (Richard Coles)a36e5922013-08-05 13:57:33 +0100660 scoped_ptr<WindowSelectorController> window_selector_controller_;
Ben Murdochc5cede92014-04-10 11:22:14 +0100661 scoped_ptr<FocusCycler> focus_cycler_;
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000662 scoped_ptr<DisplayController> display_controller_;
663 scoped_ptr<HighContrastController> high_contrast_controller_;
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000664 scoped_ptr<MagnificationController> magnification_controller_;
665 scoped_ptr<PartialMagnificationController> partial_magnification_controller_;
Torne (Richard Coles)4e180b62013-10-18 15:46:22 +0100666 scoped_ptr<AutoclickController> autoclick_controller_;
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000667 scoped_ptr<aura::client::FocusClient> focus_client_;
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000668 aura::client::ActivationClient* activation_client_;
Ben Murdocha02191e2014-04-16 11:17:03 +0100669
Ben Murdochc5cede92014-04-10 11:22:14 +0100670 scoped_ptr<MouseCursorEventFilter> mouse_cursor_filter_;
671 scoped_ptr<ScreenPositionController> screen_position_controller_;
672 scoped_ptr<SystemModalContainerEventFilter> modality_filter_;
673 scoped_ptr<EventClientImpl> event_client_;
674 scoped_ptr<EventTransformationHandler> event_transformation_handler_;
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000675
676 // An event filter that pre-handles key events while the partial
677 // screenshot UI or the keyboard overlay is active.
Ben Murdochc5cede92014-04-10 11:22:14 +0100678 scoped_ptr<OverlayEventFilter> overlay_filter_;
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000679
Torne (Richard Coles)4e180b62013-10-18 15:46:22 +0100680 // An event filter for logging keyboard-related metrics.
Ben Murdochc5cede92014-04-10 11:22:14 +0100681 scoped_ptr<KeyboardUMAEventFilter> keyboard_metrics_filter_;
Torne (Richard Coles)4e180b62013-10-18 15:46:22 +0100682
Torne (Richard Coles)5d1f7b12014-02-21 12:16:55 +0000683 // An event filter which handles moving and resizing windows.
684 scoped_ptr<ToplevelWindowEventHandler> toplevel_window_event_handler_;
685
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000686 // An event filter which handles system level gestures
Ben Murdochc5cede92014-04-10 11:22:14 +0100687 scoped_ptr<SystemGestureEventFilter> system_gesture_filter_;
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000688
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000689 // An event filter that pre-handles global accelerators.
Torne (Richard Coles)cedac222014-06-03 10:58:34 +0100690 scoped_ptr< ::wm::AcceleratorFilter> accelerator_filter_;
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000691
692 // An event filter that pre-handles all key events to send them to an IME.
Torne (Richard Coles)a1401312014-03-18 10:20:56 +0000693 scoped_ptr< ::wm::InputMethodEventFilter> input_method_filter_;
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000694
Ben Murdochc5cede92014-04-10 11:22:14 +0100695 scoped_ptr<DisplayManager> display_manager_;
696 scoped_ptr<base::WeakPtrFactory<DisplayManager> >
Torne (Richard Coles)1e9bf3e2013-10-31 11:16:26 +0000697 weak_display_manager_factory_;
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000698
Ben Murdochc5cede92014-04-10 11:22:14 +0100699 scoped_ptr<LocaleNotificationController> locale_notification_controller_;
Torne (Richard Coles)a36e5922013-08-05 13:57:33 +0100700
Ben Murdochc5cede92014-04-10 11:22:14 +0100701 scoped_ptr<AccelerometerController> accelerometer_controller_;
Torne (Richard Coles)a1401312014-03-18 10:20:56 +0000702
Torne (Richard Coles)4e180b62013-10-18 15:46:22 +0100703#if defined(OS_CHROMEOS)
Ben Murdochc5cede92014-04-10 11:22:14 +0100704 scoped_ptr<PowerEventObserver> power_event_observer_;
Ben Murdoch0529e5d2014-04-24 10:50:13 +0100705 scoped_ptr<ui::UserActivityPowerManagerNotifier> user_activity_notifier_;
Ben Murdochc5cede92014-04-10 11:22:14 +0100706 scoped_ptr<VideoActivityNotifier> video_activity_notifier_;
Torne (Richard Coles)5d1f7b12014-02-21 12:16:55 +0000707 scoped_ptr<StickyKeysController> sticky_keys_controller_;
Ben Murdochc5cede92014-04-10 11:22:14 +0100708 scoped_ptr<ResolutionNotificationController>
Torne (Richard Coles)5d1f7b12014-02-21 12:16:55 +0000709 resolution_notification_controller_;
Ben Murdochc5cede92014-04-10 11:22:14 +0100710 scoped_ptr<BluetoothNotificationController>
Torne (Richard Coles)a1401312014-03-18 10:20:56 +0000711 bluetooth_notification_controller_;
Ben Murdochc5cede92014-04-10 11:22:14 +0100712 scoped_ptr<LogoutConfirmationController> logout_confirmation_controller_;
713 scoped_ptr<LastWindowClosedLogoutReminder>
Torne (Richard Coles)a1401312014-03-18 10:20:56 +0000714 last_window_closed_logout_reminder_;
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000715 // Controls video output device state.
Ben Murdochc5cede92014-04-10 11:22:14 +0100716 scoped_ptr<ui::DisplayConfigurator> display_configurator_;
Bo Liu5c02ac12014-05-01 10:37:37 -0700717 scoped_ptr<DisplayConfiguratorAnimation> display_configurator_animation_;
Ben Murdochc5cede92014-04-10 11:22:14 +0100718 scoped_ptr<DisplayErrorObserver> display_error_observer_;
719 scoped_ptr<ProjectingObserver> projecting_observer_;
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000720
Torne (Richard Coles)3551c9c2013-08-23 16:39:15 +0100721 // Listens for output changes and updates the display manager.
Ben Murdochc5cede92014-04-10 11:22:14 +0100722 scoped_ptr<DisplayChangeObserver> display_change_observer_;
Torne (Richard Coles)5d1f7b12014-02-21 12:16:55 +0000723
Ben Murdocheffb81e2014-03-31 11:51:25 +0100724#if defined(USE_X11)
Torne (Richard Coles)5d1f7b12014-02-21 12:16:55 +0000725 scoped_ptr<ui::EventHandler> magnifier_key_scroll_handler_;
726 scoped_ptr<ui::EventHandler> speech_feedback_handler_;
Torne (Richard Coles)cedac222014-06-03 10:58:34 +0100727 scoped_ptr<TouchTransformerController> touch_transformer_controller_;
Torne (Richard Coles)4e180b62013-10-18 15:46:22 +0100728#endif // defined(USE_X11)
729#endif // defined(OS_CHROMEOS)
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000730
Ben Murdochc5cede92014-04-10 11:22:14 +0100731 scoped_ptr<MaximizeModeController> maximize_mode_controller_;
732
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000733 // |native_cursor_manager_| is owned by |cursor_manager_|, but we keep a
734 // pointer to vend to test code.
735 AshNativeCursorManager* native_cursor_manager_;
Ben Murdochc5cede92014-04-10 11:22:14 +0100736
737// Cursor may be hidden on certain key events in ChromeOS, whereas we never hide
738// the cursor on Windows.
739#if defined(OS_CHROMEOS)
740 CursorManager cursor_manager_;
741#else // !defined(OS_CHROMEOS)
Torne (Richard Coles)a1401312014-03-18 10:20:56 +0000742 ::wm::CursorManager cursor_manager_;
Ben Murdochc5cede92014-04-10 11:22:14 +0100743#endif // defined(OS_CHROMEOS)
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000744
745 ObserverList<ShellObserver> observers_;
746
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000747 // For testing only: simulate that a modal window is open
748 bool simulate_modal_window_open_for_testing_;
749
Ben Murdocheb525c52013-07-10 11:40:50 +0100750 bool is_touch_hud_projection_enabled_;
751
Torne (Richard Coles)5d1f7b12014-02-21 12:16:55 +0000752 // Injected content::GPUDataManager support.
753 scoped_ptr<GPUSupport> gpu_support_;
754
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000755 DISALLOW_COPY_AND_ASSIGN(Shell);
756};
757
758} // namespace ash
759
760#endif // ASH_SHELL_H_