blob: 6f88e1d8738dccad9327a652e7faa0642c0d49c7 [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)2a99a7e2013-03-28 15:31:22 +000065class CompoundEventFilter;
66class InputMethodEventFilter;
67class ShadowController;
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +000068class VisibilityController;
Ben Murdochc5cede92014-04-10 11:22:14 +010069class UserActivityDetector;
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +000070class WindowModalityController;
71}
Torne (Richard Coles)58218062012-11-14 11:43:16 +000072
73namespace ash {
74
75class AcceleratorController;
Ben Murdochc5cede92014-04-10 11:22:14 +010076class AccelerometerController;
77class AcceleratorFilter;
Torne (Richard Coles)1e9bf3e2013-10-31 11:16:26 +000078class AccessibilityDelegate;
Ben Murdochc5cede92014-04-10 11:22:14 +010079class AppListController;
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +000080class AshNativeCursorManager;
Torne (Richard Coles)4e180b62013-10-18 15:46:22 +010081class AutoclickController;
Torne (Richard Coles)a1401312014-03-18 10:20:56 +000082class BluetoothNotificationController;
Torne (Richard Coles)58218062012-11-14 11:43:16 +000083class CaptureController;
Ben Murdochc5cede92014-04-10 11:22:14 +010084class DesktopBackgroundController;
Torne (Richard Coles)3551c9c2013-08-23 16:39:15 +010085class DisplayChangeObserver;
Ben Murdochc5cede92014-04-10 11:22:14 +010086class DisplayController;
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +000087class DisplayErrorObserver;
88class DisplayManager;
Torne (Richard Coles)58218062012-11-14 11:43:16 +000089class DragDropController;
90class EventClientImpl;
91class EventRewriterEventFilter;
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +000092class EventTransformationHandler;
Ben Murdochc5cede92014-04-10 11:22:14 +010093class FirstRunHelper;
Torne (Richard Coles)58218062012-11-14 11:43:16 +000094class FocusCycler;
Ben Murdochc5cede92014-04-10 11:22:14 +010095class GPUSupport;
96class HighContrastController;
Torne (Richard Coles)4e180b62013-10-18 15:46:22 +010097class KeyboardUMAEventFilter;
Torne (Richard Coles)a1401312014-03-18 10:20:56 +000098class LastWindowClosedLogoutReminder;
Torne (Richard Coles)a36e5922013-08-05 13:57:33 +010099class LocaleNotificationController;
Ben Murdochc5cede92014-04-10 11:22:14 +0100100class LockStateController;
Torne (Richard Coles)a1401312014-03-18 10:20:56 +0000101class LogoutConfirmationController;
Ben Murdochc5cede92014-04-10 11:22:14 +0100102class MagnificationController;
103class MaximizeModeController;
Torne (Richard Coles)a1401312014-03-18 10:20:56 +0000104class MaximizeModeWindowManager;
Ben Murdochc5cede92014-04-10 11:22:14 +0100105class MediaDelegate;
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000106class MouseCursorEventFilter;
Ben Murdochc5cede92014-04-10 11:22:14 +0100107class MruWindowTracker;
108class NestedDispatcherController;
109class NewWindowDelegate;
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000110class OutputConfiguratorAnimation;
111class 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;
129class ShellObserver;
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000130class SlowAnimationEventFilter;
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000131class StatusAreaWidget;
Ben Murdochc5cede92014-04-10 11:22:14 +0100132class StickyKeysController;
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000133class SystemGestureEventFilter;
134class SystemModalContainerEventFilter;
Ben Murdochc5cede92014-04-10 11:22:14 +0100135class SystemTray;
136class SystemTrayDelegate;
137class SystemTrayNotifier;
138class ToplevelWindowEventHandler;
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000139class TouchObserverHUD;
Ben Murdochc5cede92014-04-10 11:22:14 +0100140class UserActivityDetector;
141class UserWallpaperDelegate;
Torne (Richard Coles)4e180b62013-10-18 15:46:22 +0100142class VideoActivityNotifier;
Ben Murdochc5cede92014-04-10 11:22:14 +0100143class VideoDetector;
144class WebNotificationTray;
145class WindowCycleController;
146class WindowPositioner;
147class WindowSelectorController;
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000148
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000149namespace shell {
150class WindowWatcher;
151}
152
153namespace test {
154class ShellTestApi;
155}
156
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000157// Shell is a singleton object that presents the Shell API and implements the
158// RootWindow's delegate interface.
159//
160// Upon creation, the Shell sets itself as the RootWindow's delegate, which
161// takes ownership of the Shell.
Ben Murdochc5cede92014-04-10 11:22:14 +0100162class ASH_EXPORT Shell : public SystemModalContainerEventFilterDelegate,
163 public ui::EventTarget,
164 public aura::client::ActivationChangeObserver {
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000165 public:
Ben Murdochc5cede92014-04-10 11:22:14 +0100166 typedef std::vector<RootWindowController*> RootWindowControllerList;
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000167
168 enum Direction {
169 FORWARD,
170 BACKWARD
171 };
172
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000173 // A shell must be explicitly created so that it can call |Init()| with the
174 // delegate set. |delegate| can be NULL (if not required for initialization).
Torne (Richard Coles)c2e0dbd2013-05-09 18:35:53 +0100175 // Takes ownership of |delegate|.
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000176 static Shell* CreateInstance(ShellDelegate* delegate);
177
178 // Should never be called before |CreateInstance()|.
179 static Shell* GetInstance();
180
181 // Returns true if the ash shell has been instantiated.
182 static bool HasInstance();
183
184 static void DeleteInstance();
185
186 // Returns the root window controller for the primary root window.
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000187 // TODO(oshima): move this to |RootWindowController|
Ben Murdochc5cede92014-04-10 11:22:14 +0100188 static RootWindowController* GetPrimaryRootWindowController();
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000189
190 // Returns all root window controllers.
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000191 // TODO(oshima): move this to |RootWindowController|
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000192 static RootWindowControllerList GetAllRootWindowControllers();
193
Torne (Richard Coles)1e9bf3e2013-10-31 11:16:26 +0000194 // Returns the primary root Window. The primary root Window is the one that
195 // has a launcher.
196 static aura::Window* GetPrimaryRootWindow();
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000197
Torne (Richard Coles)1e9bf3e2013-10-31 11:16:26 +0000198 // Returns a root Window when used as a target when creating a new window.
Torne (Richard Coles)a36e5922013-08-05 13:57:33 +0100199 // The root window of the active window is used in most cases, but can
200 // be overridden by using ScopedTargetRootWindow().
Torne (Richard Coles)1e9bf3e2013-10-31 11:16:26 +0000201 // If you want to get the root Window of the active window, just use
Torne (Richard Coles)a36e5922013-08-05 13:57:33 +0100202 // |wm::GetActiveWindow()->GetRootWindow()|.
Torne (Richard Coles)1e9bf3e2013-10-31 11:16:26 +0000203 static aura::Window* GetTargetRootWindow();
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000204
205 // Returns the global Screen object that's always active in ash.
206 static gfx::Screen* GetScreen();
207
208 // Returns all root windows.
Torne (Richard Coles)f2477e02013-11-28 11:55:43 +0000209 static aura::Window::Windows GetAllRootWindows();
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000210
Torne (Richard Coles)1e9bf3e2013-10-31 11:16:26 +0000211 static aura::Window* GetContainer(aura::Window* root_window,
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000212 int container_id);
Torne (Richard Coles)1e9bf3e2013-10-31 11:16:26 +0000213 static const aura::Window* GetContainer(const aura::Window* root_window,
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000214 int container_id);
215
216 // Returns the list of containers that match |container_id| in
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000217 // all root windows. If |priority_root| is given, the container
218 // in the |priority_root| will be inserted at the top of the list.
219 static std::vector<aura::Window*> GetContainersFromAllRootWindows(
220 int container_id,
Torne (Richard Coles)1e9bf3e2013-10-31 11:16:26 +0000221 aura::Window* priority_root);
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000222
Torne (Richard Coles)1e9bf3e2013-10-31 11:16:26 +0000223 void set_target_root_window(aura::Window* target_root_window) {
Torne (Richard Coles)a36e5922013-08-05 13:57:33 +0100224 target_root_window_ = target_root_window;
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000225 }
226
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000227 // Shows the context menu for the background and launcher at
228 // |location_in_screen| (in screen coordinates).
Torne (Richard Coles)7d4cd472013-06-19 11:58:07 +0100229 void ShowContextMenu(const gfx::Point& location_in_screen,
230 ui::MenuSourceType source_type);
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000231
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000232 // Toggles the app list. |window| specifies in which display the app
233 // list should be shown. If this is NULL, the active root window
234 // will be used.
235 void ToggleAppList(aura::Window* anchor);
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000236
237 // Returns app list target visibility.
238 bool GetAppListTargetVisibility() const;
239
240 // Returns app list window or NULL if it is not visible.
241 aura::Window* GetAppListWindow();
242
Torne (Richard Coles)8bcbed82013-10-22 16:41:35 +0100243 // Returns app list view or NULL if it is not visible.
244 app_list::AppListView* GetAppListView();
245
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000246 // Returns true if a system-modal dialog window is currently open.
247 bool IsSystemModalWindowOpen() const;
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000248
249 // For testing only: set simulation that a modal window is open
250 void SimulateModalWindowOpenForTesting(bool modal_window_open) {
251 simulate_modal_window_open_for_testing_ = modal_window_open;
252 }
253
254 // Creates a default views::NonClientFrameView for use by windows in the
255 // Ash environment.
256 views::NonClientFrameView* CreateDefaultNonClientFrameView(
257 views::Widget* widget);
258
259 // Rotates focus through containers that can receive focus.
260 void RotateFocus(Direction direction);
261
262 // Sets the work area insets of the display that contains |window|,
263 // this notifies observers too.
264 // TODO(sky): this no longer really replicates what happens and is unreliable.
265 // Remove this.
266 void SetDisplayWorkAreaInsets(aura::Window* window,
267 const gfx::Insets& insets);
268
269 // Called when the user logs in.
270 void OnLoginStateChanged(user::LoginStatus status);
271
Torne (Richard Coles)f2477e02013-11-28 11:55:43 +0000272 // Called after the logged-in user's profile is ready.
273 void OnLoginUserProfilePrepared();
274
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000275 // Called when the login status changes.
276 // TODO(oshima): Investigate if we can merge this and |OnLoginStateChanged|.
277 void UpdateAfterLoginStatusChange(user::LoginStatus status);
278
279 // Called when the application is exiting.
280 void OnAppTerminating();
281
282 // Called when the screen is locked (after the lock window is visible) or
283 // unlocked.
284 void OnLockStateChanged(bool locked);
285
Torne (Richard Coles)5d1f7b12014-02-21 12:16:55 +0000286 // Called when a casting session is started or stopped.
287 void OnCastingSessionStartedOrStopped(bool started);
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000288
Torne (Richard Coles)a1401312014-03-18 10:20:56 +0000289 // Called when the overview mode is about to be started (before the windows
290 // get re-arranged).
291 void OnOverviewModeStarting();
292
293 // Called before the overview mode is ending (before the windows get arranged
294 // to their final position).
295 void OnOverviewModeEnding();
296
297 // Called after maximize mode has started, windows might still animate though.
298 void OnMaximizeModeStarted();
299
300 // Called after maximize mode has ended, windows might still be returning to
301 // their original position.
302 void OnMaximizeModeEnded();
303
Ben Murdocha02191e2014-04-16 11:17:03 +0100304 // Called when a root window is created.
305 void OnRootWindowAdded(aura::Window* root_window);
306
Torne (Richard Coles)5d1f7b12014-02-21 12:16:55 +0000307 // Initializes |shelf_|. Does nothing if it's already initialized.
308 void CreateShelf();
309
Ben Murdoch0529e5d2014-04-24 10:50:13 +0100310 // Called when the shelf is created for |root_window|.
311 void OnShelfCreatedForRootWindow(aura::Window* root_window);
312
Torne (Richard Coles)5d1f7b12014-02-21 12:16:55 +0000313 // Creates a virtual keyboard. Deletes the old virtual keyboard if it already
314 // exists.
Torne (Richard Coles)f2477e02013-11-28 11:55:43 +0000315 void CreateKeyboard();
316
Torne (Richard Coles)5d1f7b12014-02-21 12:16:55 +0000317 // Deactivates the virtual keyboard.
318 void DeactivateKeyboard();
319
Torne (Richard Coles)8bcbed82013-10-22 16:41:35 +0100320 // Show shelf view if it was created hidden (before session has started).
Torne (Richard Coles)5d1f7b12014-02-21 12:16:55 +0000321 void ShowShelf();
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000322
323 // Adds/removes observer.
324 void AddShellObserver(ShellObserver* observer);
325 void RemoveShellObserver(ShellObserver* observer);
326
Torne (Richard Coles)a1401312014-03-18 10:20:56 +0000327 // Turn the always maximize mode window manager on or off.
328 void EnableMaximizeModeWindowManager(bool enable);
329
330 // Test if the MaximizeModeWindowManager is enabled or not.
331 bool IsMaximizeModeWindowManagerEnabled();
332
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000333 AcceleratorController* accelerator_controller() {
334 return accelerator_controller_.get();
335 }
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000336
Ben Murdochc5cede92014-04-10 11:22:14 +0100337 DisplayManager* display_manager() { return display_manager_.get(); }
Torne (Richard Coles)a1401312014-03-18 10:20:56 +0000338 ::wm::InputMethodEventFilter* input_method_filter() {
Torne (Richard Coles)c2e0dbd2013-05-09 18:35:53 +0100339 return input_method_filter_.get();
340 }
Torne (Richard Coles)a1401312014-03-18 10:20:56 +0000341 ::wm::CompoundEventFilter* env_filter() {
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000342 return env_filter_.get();
343 }
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000344 views::corewm::TooltipController* tooltip_controller() {
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000345 return tooltip_controller_.get();
346 }
Ben Murdochc5cede92014-04-10 11:22:14 +0100347 OverlayEventFilter* overlay_filter() { return overlay_filter_.get(); }
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000348 DesktopBackgroundController* desktop_background_controller() {
349 return desktop_background_controller_.get();
350 }
351 PowerButtonController* power_button_controller() {
352 return power_button_controller_.get();
353 }
Torne (Richard Coles)868fa2f2013-06-11 10:57:03 +0100354 LockStateController* lock_state_controller() {
355 return lock_state_controller_.get();
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000356 }
Torne (Richard Coles)a36e5922013-08-05 13:57:33 +0100357 MruWindowTracker* mru_window_tracker() {
358 return mru_window_tracker_.get();
359 }
Ben Murdochc5cede92014-04-10 11:22:14 +0100360 ::wm::UserActivityDetector* user_activity_detector() {
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000361 return user_activity_detector_.get();
362 }
363 VideoDetector* video_detector() {
364 return video_detector_.get();
365 }
Torne (Richard Coles)a36e5922013-08-05 13:57:33 +0100366 WindowSelectorController* window_selector_controller() {
367 return window_selector_controller_.get();
368 }
Ben Murdochc5cede92014-04-10 11:22:14 +0100369 FocusCycler* focus_cycler() { return focus_cycler_.get(); }
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000370 DisplayController* display_controller() {
371 return display_controller_.get();
372 }
Ben Murdochc5cede92014-04-10 11:22:14 +0100373 MouseCursorEventFilter* mouse_cursor_filter() {
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000374 return mouse_cursor_filter_.get();
375 }
Ben Murdochc5cede92014-04-10 11:22:14 +0100376 EventTransformationHandler* event_transformation_handler() {
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000377 return event_transformation_handler_.get();
378 }
Torne (Richard Coles)a1401312014-03-18 10:20:56 +0000379 ::wm::CursorManager* cursor_manager() { return &cursor_manager_; }
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000380
381 ShellDelegate* delegate() { return delegate_.get(); }
382
383 UserWallpaperDelegate* user_wallpaper_delegate() {
384 return user_wallpaper_delegate_.get();
385 }
386
Torne (Richard Coles)c2e0dbd2013-05-09 18:35:53 +0100387 SessionStateDelegate* session_state_delegate() {
388 return session_state_delegate_.get();
389 }
390
Torne (Richard Coles)1e9bf3e2013-10-31 11:16:26 +0000391 AccessibilityDelegate* accessibility_delegate() {
392 return accessibility_delegate_.get();
393 }
394
395 NewWindowDelegate* new_window_delegate() {
396 return new_window_delegate_.get();
397 }
398
Torne (Richard Coles)0f1bc082013-11-06 12:27:47 +0000399 MediaDelegate* media_delegate() {
400 return media_delegate_.get();
401 }
402
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000403 HighContrastController* high_contrast_controller() {
404 return high_contrast_controller_.get();
405 }
406
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000407 MagnificationController* magnification_controller() {
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000408 return magnification_controller_.get();
409 }
410
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000411 PartialMagnificationController* partial_magnification_controller() {
412 return partial_magnification_controller_.get();
413 }
Torne (Richard Coles)4e180b62013-10-18 15:46:22 +0100414
415 AutoclickController* autoclick_controller() {
416 return autoclick_controller_.get();
417 }
418
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000419 aura::client::ActivationClient* activation_client() {
420 return activation_client_;
421 }
422
Torne (Richard Coles)a3f6a492013-12-18 16:25:09 +0000423 ShelfItemDelegateManager* shelf_item_delegate_manager() {
424 return shelf_item_delegate_manager_.get();
Torne (Richard Coles)424c4d72013-08-30 15:14:49 +0100425 }
426
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000427 // Force the shelf to query for it's current visibility state.
428 void UpdateShelfVisibility();
429
430 // TODO(oshima): Define an interface to access shelf/launcher
431 // state, or just use Launcher.
432
433 // Sets/gets the shelf auto-hide behavior on |root_window|.
434 void SetShelfAutoHideBehavior(ShelfAutoHideBehavior behavior,
Torne (Richard Coles)1e9bf3e2013-10-31 11:16:26 +0000435 aura::Window* root_window);
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000436 ShelfAutoHideBehavior GetShelfAutoHideBehavior(
Torne (Richard Coles)1e9bf3e2013-10-31 11:16:26 +0000437 aura::Window* root_window) const;
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000438
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000439 // Sets/gets shelf's alignment on |root_window|.
440 void SetShelfAlignment(ShelfAlignment alignment,
Torne (Richard Coles)1e9bf3e2013-10-31 11:16:26 +0000441 aura::Window* root_window);
442 ShelfAlignment GetShelfAlignment(aura::Window* root_window);
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000443
444 // Dims or undims the screen.
445 void SetDimming(bool should_dim);
446
Torne (Richard Coles)4e180b62013-10-18 15:46:22 +0100447 // Notifies |observers_| when entering or exiting fullscreen mode in
448 // |root_window|.
449 void NotifyFullscreenStateChange(bool is_fullscreen,
Torne (Richard Coles)1e9bf3e2013-10-31 11:16:26 +0000450 aura::Window* root_window);
Torne (Richard Coles)4e180b62013-10-18 15:46:22 +0100451
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000452 // Creates a modal background (a partially-opaque fullscreen window)
453 // on all displays for |window|.
454 void CreateModalBackground(aura::Window* window);
455
456 // Called when a modal window is removed. It will activate
457 // another modal window if any, or remove modal screens
458 // on all displays.
459 void OnModalWindowRemoved(aura::Window* removed);
460
461 // Returns WebNotificationTray on the primary root window.
462 WebNotificationTray* GetWebNotificationTray();
463
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000464 // Does the primary display have status area?
465 bool HasPrimaryStatusArea();
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000466
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000467 // Returns the system tray on primary display.
468 SystemTray* GetPrimarySystemTray();
469
470 SystemTrayDelegate* system_tray_delegate() {
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000471 return system_tray_delegate_.get();
472 }
473
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000474 SystemTrayNotifier* system_tray_notifier() {
475 return system_tray_notifier_.get();
476 }
477
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000478 static void set_initially_hide_cursor(bool hide) {
479 initially_hide_cursor_ = hide;
480 }
481
Ben Murdochc5cede92014-04-10 11:22:14 +0100482 ResizeShadowController* resize_shadow_controller() {
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000483 return resize_shadow_controller_.get();
484 }
485
486 // Made available for tests.
Torne (Richard Coles)a1401312014-03-18 10:20:56 +0000487 ::wm::ShadowController* shadow_controller() {
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000488 return shadow_controller_.get();
489 }
490
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000491 // Starts the animation that occurs on first login.
492 void DoInitialWorkspaceAnimation();
493
Ben Murdochc5cede92014-04-10 11:22:14 +0100494 AccelerometerController* accelerometer_controller() {
495 return accelerometer_controller_.get();
496 }
497
498 MaximizeModeController* maximize_mode_controller() {
499 return maximize_mode_controller_.get();
500 }
501
Torne (Richard Coles)5d1f7b12014-02-21 12:16:55 +0000502#if defined(OS_CHROMEOS)
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000503 // TODO(oshima): Move these objects to DisplayController.
Ben Murdochc5cede92014-04-10 11:22:14 +0100504 ui::DisplayConfigurator* display_configurator() {
505 return display_configurator_.get();
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000506 }
Ben Murdochc5cede92014-04-10 11:22:14 +0100507 OutputConfiguratorAnimation* output_configurator_animation() {
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000508 return output_configurator_animation_.get();
509 }
Ben Murdochc5cede92014-04-10 11:22:14 +0100510 DisplayErrorObserver* display_error_observer() {
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000511 return display_error_observer_.get();
512 }
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000513
Ben Murdochc5cede92014-04-10 11:22:14 +0100514 ResolutionNotificationController* resolution_notification_controller() {
Ben Murdochba5b9a62013-08-12 14:20:17 +0100515 return resolution_notification_controller_.get();
516 }
Torne (Richard Coles)a1401312014-03-18 10:20:56 +0000517
Ben Murdochc5cede92014-04-10 11:22:14 +0100518 LogoutConfirmationController* logout_confirmation_controller() {
Torne (Richard Coles)a1401312014-03-18 10:20:56 +0000519 return logout_confirmation_controller_.get();
520 }
Torne (Richard Coles)5d1f7b12014-02-21 12:16:55 +0000521#endif // defined(OS_CHROMEOS)
Ben Murdochba5b9a62013-08-12 14:20:17 +0100522
Torne (Richard Coles)f2477e02013-11-28 11:55:43 +0000523 ShelfModel* shelf_model() {
524 return shelf_model_.get();
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000525 }
526
Torne (Richard Coles)4e180b62013-10-18 15:46:22 +0100527 WindowPositioner* window_positioner() {
528 return window_positioner_.get();
529 }
530
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000531 // Returns the launcher delegate, creating if necesary.
Torne (Richard Coles)a3f6a492013-12-18 16:25:09 +0000532 ShelfDelegate* GetShelfDelegate();
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000533
Torne (Richard Coles)5d1f7b12014-02-21 12:16:55 +0000534 UserMetricsRecorder* metrics() {
535 return user_metrics_recorder_.get();
536 }
537
Ben Murdocheb525c52013-07-10 11:40:50 +0100538 void SetTouchHudProjectionEnabled(bool enabled);
539
540 bool is_touch_hud_projection_enabled() const {
541 return is_touch_hud_projection_enabled_;
542 }
543
Torne (Richard Coles)8bcbed82013-10-22 16:41:35 +0100544#if defined(OS_CHROMEOS)
545 // Creates instance of FirstRunHelper. Caller is responsible for deleting
546 // returned object.
547 ash::FirstRunHelper* CreateFirstRunHelper();
Torne (Richard Coles)f2477e02013-11-28 11:55:43 +0000548
Torne (Richard Coles)5d1f7b12014-02-21 12:16:55 +0000549 // Toggles cursor compositing on/off. Native cursor is disabled when cursor
550 // compositing is enabled, and vice versa.
551 void SetCursorCompositingEnabled(bool enabled);
552
553 StickyKeysController* sticky_keys_controller() {
554 return sticky_keys_controller_.get();
Torne (Richard Coles)f2477e02013-11-28 11:55:43 +0000555 }
Torne (Richard Coles)8bcbed82013-10-22 16:41:35 +0100556#endif // defined(OS_CHROMEOS)
557
Torne (Richard Coles)5d1f7b12014-02-21 12:16:55 +0000558 GPUSupport* gpu_support() { return gpu_support_.get(); }
559
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000560 private:
561 FRIEND_TEST_ALL_PREFIXES(ExtendedDesktopTest, TestCursor);
562 FRIEND_TEST_ALL_PREFIXES(WindowManagerTest, MouseEventCursors);
563 FRIEND_TEST_ALL_PREFIXES(WindowManagerTest, TransformActivate);
Ben Murdochc5cede92014-04-10 11:22:14 +0100564 friend class RootWindowController;
565 friend class ScopedTargetRootWindow;
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000566 friend class test::ShellTestApi;
567 friend class shell::WindowWatcher;
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000568
569 typedef std::pair<aura::Window*, gfx::Rect> WindowAndBoundsPair;
570
Torne (Richard Coles)c2e0dbd2013-05-09 18:35:53 +0100571 // Takes ownership of |delegate|.
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000572 explicit Shell(ShellDelegate* delegate);
573 virtual ~Shell();
574
575 void Init();
576
Torne (Richard Coles)f2477e02013-11-28 11:55:43 +0000577 // Initializes virtual keyboard controller.
578 void InitKeyboard();
Torne (Richard Coles)4e180b62013-10-18 15:46:22 +0100579
Torne (Richard Coles)8bcbed82013-10-22 16:41:35 +0100580 // Initializes the root window so that it can host browser windows.
Torne (Richard Coles)f2477e02013-11-28 11:55:43 +0000581 void InitRootWindow(aura::Window* root_window);
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000582
Ben Murdochc5cede92014-04-10 11:22:14 +0100583 // ash::SystemModalContainerEventFilterDelegate overrides:
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000584 virtual bool CanWindowReceiveEvents(aura::Window* window) OVERRIDE;
585
586 // Overridden from ui::EventTarget:
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000587 virtual bool CanAcceptEvent(const ui::Event& event) OVERRIDE;
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000588 virtual EventTarget* GetParentTarget() OVERRIDE;
Torne (Richard Coles)a3f6a492013-12-18 16:25:09 +0000589 virtual scoped_ptr<ui::EventTargetIterator> GetChildIterator() const OVERRIDE;
590 virtual ui::EventTargeter* GetEventTargeter() OVERRIDE;
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000591 virtual void OnEvent(ui::Event* event) OVERRIDE;
592
593 // Overridden from aura::client::ActivationChangeObserver:
594 virtual void OnWindowActivated(aura::Window* gained_active,
595 aura::Window* lost_active) OVERRIDE;
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000596
597 static Shell* instance_;
598
599 // If set before the Shell is initialized, the mouse cursor will be hidden
600 // when the screen is initially created.
601 static bool initially_hide_cursor_;
602
Torne (Richard Coles)a36e5922013-08-05 13:57:33 +0100603 // When no explicit target display/RootWindow is given, new windows are
604 // created on |scoped_target_root_window_| , unless NULL in
605 // which case they are created on |target_root_window_|.
606 // |target_root_window_| never becomes NULL during the session.
Torne (Richard Coles)1e9bf3e2013-10-31 11:16:26 +0000607 aura::Window* target_root_window_;
608 aura::Window* scoped_target_root_window_;
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000609
610 // The CompoundEventFilter owned by aura::Env object.
Torne (Richard Coles)a1401312014-03-18 10:20:56 +0000611 scoped_ptr< ::wm::CompoundEventFilter> env_filter_;
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000612
613 std::vector<WindowAndBoundsPair> to_restore_;
614
Torne (Richard Coles)5d1f7b12014-02-21 12:16:55 +0000615 scoped_ptr<UserMetricsRecorder> user_metrics_recorder_;
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000616 scoped_ptr<NestedDispatcherController> nested_dispatcher_controller_;
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000617 scoped_ptr<AcceleratorController> accelerator_controller_;
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000618 scoped_ptr<ShellDelegate> delegate_;
619 scoped_ptr<SystemTrayDelegate> system_tray_delegate_;
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000620 scoped_ptr<SystemTrayNotifier> system_tray_notifier_;
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000621 scoped_ptr<UserWallpaperDelegate> user_wallpaper_delegate_;
Torne (Richard Coles)c2e0dbd2013-05-09 18:35:53 +0100622 scoped_ptr<SessionStateDelegate> session_state_delegate_;
Torne (Richard Coles)1e9bf3e2013-10-31 11:16:26 +0000623 scoped_ptr<AccessibilityDelegate> accessibility_delegate_;
624 scoped_ptr<NewWindowDelegate> new_window_delegate_;
Torne (Richard Coles)0f1bc082013-11-06 12:27:47 +0000625 scoped_ptr<MediaDelegate> media_delegate_;
Torne (Richard Coles)a3f6a492013-12-18 16:25:09 +0000626 scoped_ptr<ShelfDelegate> shelf_delegate_;
627 scoped_ptr<ShelfItemDelegateManager> shelf_item_delegate_manager_;
Ben Murdochc5cede92014-04-10 11:22:14 +0100628 scoped_ptr<ShelfWindowWatcher> shelf_window_watcher_;
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000629
Torne (Richard Coles)f2477e02013-11-28 11:55:43 +0000630 scoped_ptr<ShelfModel> shelf_model_;
631 scoped_ptr<WindowPositioner> window_positioner_;
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000632
Ben Murdochc5cede92014-04-10 11:22:14 +0100633 scoped_ptr<AppListController> app_list_controller_;
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000634
Ben Murdochc5cede92014-04-10 11:22:14 +0100635 scoped_ptr<DragDropController> drag_drop_controller_;
636 scoped_ptr<ResizeShadowController> resize_shadow_controller_;
Torne (Richard Coles)a1401312014-03-18 10:20:56 +0000637 scoped_ptr< ::wm::ShadowController> shadow_controller_;
638 scoped_ptr< ::wm::VisibilityController> visibility_controller_;
639 scoped_ptr< ::wm::WindowModalityController> window_modality_controller_;
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000640 scoped_ptr<views::corewm::TooltipController> tooltip_controller_;
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000641 scoped_ptr<DesktopBackgroundController> desktop_background_controller_;
642 scoped_ptr<PowerButtonController> power_button_controller_;
Torne (Richard Coles)868fa2f2013-06-11 10:57:03 +0100643 scoped_ptr<LockStateController> lock_state_controller_;
Torne (Richard Coles)a36e5922013-08-05 13:57:33 +0100644 scoped_ptr<MruWindowTracker> mru_window_tracker_;
Ben Murdochc5cede92014-04-10 11:22:14 +0100645 scoped_ptr< ::wm::UserActivityDetector> user_activity_detector_;
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000646 scoped_ptr<VideoDetector> video_detector_;
Torne (Richard Coles)a36e5922013-08-05 13:57:33 +0100647 scoped_ptr<WindowSelectorController> window_selector_controller_;
Ben Murdochc5cede92014-04-10 11:22:14 +0100648 scoped_ptr<FocusCycler> focus_cycler_;
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000649 scoped_ptr<DisplayController> display_controller_;
650 scoped_ptr<HighContrastController> high_contrast_controller_;
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000651 scoped_ptr<MagnificationController> magnification_controller_;
652 scoped_ptr<PartialMagnificationController> partial_magnification_controller_;
Torne (Richard Coles)4e180b62013-10-18 15:46:22 +0100653 scoped_ptr<AutoclickController> autoclick_controller_;
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000654 scoped_ptr<aura::client::FocusClient> focus_client_;
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000655 aura::client::ActivationClient* activation_client_;
Ben Murdocha02191e2014-04-16 11:17:03 +0100656
Ben Murdochc5cede92014-04-10 11:22:14 +0100657 scoped_ptr<MouseCursorEventFilter> mouse_cursor_filter_;
658 scoped_ptr<ScreenPositionController> screen_position_controller_;
659 scoped_ptr<SystemModalContainerEventFilter> modality_filter_;
660 scoped_ptr<EventClientImpl> event_client_;
661 scoped_ptr<EventTransformationHandler> event_transformation_handler_;
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000662
663 // An event filter that pre-handles key events while the partial
664 // screenshot UI or the keyboard overlay is active.
Ben Murdochc5cede92014-04-10 11:22:14 +0100665 scoped_ptr<OverlayEventFilter> overlay_filter_;
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000666
Torne (Richard Coles)4e180b62013-10-18 15:46:22 +0100667 // An event filter for logging keyboard-related metrics.
Ben Murdochc5cede92014-04-10 11:22:14 +0100668 scoped_ptr<KeyboardUMAEventFilter> keyboard_metrics_filter_;
Torne (Richard Coles)4e180b62013-10-18 15:46:22 +0100669
Torne (Richard Coles)5d1f7b12014-02-21 12:16:55 +0000670 // An event filter which handles moving and resizing windows.
671 scoped_ptr<ToplevelWindowEventHandler> toplevel_window_event_handler_;
672
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000673 // An event filter which handles system level gestures
Ben Murdochc5cede92014-04-10 11:22:14 +0100674 scoped_ptr<SystemGestureEventFilter> system_gesture_filter_;
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000675
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000676 // An event filter that pre-handles global accelerators.
Ben Murdochc5cede92014-04-10 11:22:14 +0100677 scoped_ptr<AcceleratorFilter> accelerator_filter_;
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000678
679 // An event filter that pre-handles all key events to send them to an IME.
Torne (Richard Coles)a1401312014-03-18 10:20:56 +0000680 scoped_ptr< ::wm::InputMethodEventFilter> input_method_filter_;
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000681
Ben Murdochc5cede92014-04-10 11:22:14 +0100682 scoped_ptr<DisplayManager> display_manager_;
683 scoped_ptr<base::WeakPtrFactory<DisplayManager> >
Torne (Richard Coles)1e9bf3e2013-10-31 11:16:26 +0000684 weak_display_manager_factory_;
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000685
Ben Murdochc5cede92014-04-10 11:22:14 +0100686 scoped_ptr<LocaleNotificationController> locale_notification_controller_;
Torne (Richard Coles)a36e5922013-08-05 13:57:33 +0100687
Torne (Richard Coles)a1401312014-03-18 10:20:56 +0000688 // The maximized window manager (if enabled).
Ben Murdochc5cede92014-04-10 11:22:14 +0100689 scoped_ptr<MaximizeModeWindowManager> maximize_mode_window_manager_;
690
691 scoped_ptr<AccelerometerController> accelerometer_controller_;
Torne (Richard Coles)a1401312014-03-18 10:20:56 +0000692
Torne (Richard Coles)4e180b62013-10-18 15:46:22 +0100693#if defined(OS_CHROMEOS)
Ben Murdochc5cede92014-04-10 11:22:14 +0100694 scoped_ptr<PowerEventObserver> power_event_observer_;
Ben Murdoch0529e5d2014-04-24 10:50:13 +0100695 scoped_ptr<ui::UserActivityPowerManagerNotifier> user_activity_notifier_;
Ben Murdochc5cede92014-04-10 11:22:14 +0100696 scoped_ptr<VideoActivityNotifier> video_activity_notifier_;
Torne (Richard Coles)5d1f7b12014-02-21 12:16:55 +0000697 scoped_ptr<StickyKeysController> sticky_keys_controller_;
Ben Murdochc5cede92014-04-10 11:22:14 +0100698 scoped_ptr<ResolutionNotificationController>
Torne (Richard Coles)5d1f7b12014-02-21 12:16:55 +0000699 resolution_notification_controller_;
Ben Murdochc5cede92014-04-10 11:22:14 +0100700 scoped_ptr<BluetoothNotificationController>
Torne (Richard Coles)a1401312014-03-18 10:20:56 +0000701 bluetooth_notification_controller_;
Ben Murdochc5cede92014-04-10 11:22:14 +0100702 scoped_ptr<LogoutConfirmationController> logout_confirmation_controller_;
703 scoped_ptr<LastWindowClosedLogoutReminder>
Torne (Richard Coles)a1401312014-03-18 10:20:56 +0000704 last_window_closed_logout_reminder_;
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000705 // Controls video output device state.
Ben Murdochc5cede92014-04-10 11:22:14 +0100706 scoped_ptr<ui::DisplayConfigurator> display_configurator_;
707 scoped_ptr<OutputConfiguratorAnimation> output_configurator_animation_;
708 scoped_ptr<DisplayErrorObserver> display_error_observer_;
709 scoped_ptr<ProjectingObserver> projecting_observer_;
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000710
Torne (Richard Coles)3551c9c2013-08-23 16:39:15 +0100711 // Listens for output changes and updates the display manager.
Ben Murdochc5cede92014-04-10 11:22:14 +0100712 scoped_ptr<DisplayChangeObserver> display_change_observer_;
Torne (Richard Coles)5d1f7b12014-02-21 12:16:55 +0000713
Ben Murdocheffb81e2014-03-31 11:51:25 +0100714#if defined(USE_X11)
Torne (Richard Coles)5d1f7b12014-02-21 12:16:55 +0000715 scoped_ptr<ui::EventHandler> magnifier_key_scroll_handler_;
716 scoped_ptr<ui::EventHandler> speech_feedback_handler_;
Torne (Richard Coles)4e180b62013-10-18 15:46:22 +0100717#endif // defined(USE_X11)
718#endif // defined(OS_CHROMEOS)
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000719
Ben Murdochc5cede92014-04-10 11:22:14 +0100720 scoped_ptr<MaximizeModeController> maximize_mode_controller_;
721
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000722 // |native_cursor_manager_| is owned by |cursor_manager_|, but we keep a
723 // pointer to vend to test code.
724 AshNativeCursorManager* native_cursor_manager_;
Ben Murdochc5cede92014-04-10 11:22:14 +0100725
726// Cursor may be hidden on certain key events in ChromeOS, whereas we never hide
727// the cursor on Windows.
728#if defined(OS_CHROMEOS)
729 CursorManager cursor_manager_;
730#else // !defined(OS_CHROMEOS)
Torne (Richard Coles)a1401312014-03-18 10:20:56 +0000731 ::wm::CursorManager cursor_manager_;
Ben Murdochc5cede92014-04-10 11:22:14 +0100732#endif // defined(OS_CHROMEOS)
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000733
734 ObserverList<ShellObserver> observers_;
735
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000736 // For testing only: simulate that a modal window is open
737 bool simulate_modal_window_open_for_testing_;
738
Ben Murdocheb525c52013-07-10 11:40:50 +0100739 bool is_touch_hud_projection_enabled_;
740
Torne (Richard Coles)5d1f7b12014-02-21 12:16:55 +0000741 // Injected content::GPUDataManager support.
742 scoped_ptr<GPUSupport> gpu_support_;
743
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000744 DISALLOW_COPY_AND_ASSIGN(Shell);
745};
746
747} // namespace ash
748
749#endif // ASH_SHELL_H_