blob: 91a18a3c4ca470a9e00b73b7c4b9fe54127f2d87 [file] [log] [blame]
[email protected]e0d22e82012-01-04 00:46:571// Copyright (c) 2012 The Chromium Authors. All rights reserved.
[email protected]87b0d82e2011-10-07 21:02:592// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
[email protected]b65bdda2011-12-23 23:35:315#ifndef ASH_SHELL_H_
6#define ASH_SHELL_H_
[email protected]87b0d82e2011-10-07 21:02:597
dchenga94547472016-04-08 08:41:118#include <memory>
[email protected]cac10fc62011-10-07 23:22:569#include <utility>
10#include <vector>
11
[email protected]b65bdda2011-12-23 23:35:3112#include "ash/ash_export.h"
[email protected]5d2ea362013-12-13 08:10:1813#include "ash/metrics/user_metrics_recorder.h"
jamescookd4649fa2016-09-30 17:50:0914#include "ash/public/cpp/shelf_types.h"
Xiyuan Xia22b1a6c2017-04-18 22:46:0115#include "ash/session/session_observer.h"
[email protected]c0ce80e2012-10-05 23:28:2716#include "ash/wm/system_modal_container_event_filter_delegate.h"
[email protected]b0639282011-12-22 21:12:2717#include "base/gtest_prod_util.h"
avidb567a8a2015-12-20 17:07:2418#include "base/macros.h"
[email protected]6f67df52013-10-29 01:07:1519#include "base/memory/weak_ptr.h"
[email protected]1a2145b2012-03-13 21:09:1720#include "base/observer_list.h"
Alex Newcomer8fdcb9342017-08-08 18:48:4421#include "ui/app_list/app_list_constants.h"
[email protected]c9390bd2013-11-08 20:33:1322#include "ui/aura/window.h"
oshimaf84b0da722016-04-27 19:47:1923#include "ui/display/screen.h"
[email protected]86ccbd42013-09-18 18:11:5424#include "ui/events/event_target.h"
[email protected]ee3ed10772014-03-11 22:02:0125#include "ui/wm/core/cursor_manager.h"
sky27344382017-03-08 21:30:3226#include "ui/wm/public/activation_change_observer.h"
[email protected]87b0d82e2011-10-07 21:02:5927
wychene120c2fd2017-05-10 07:37:0728#if defined(OS_CHROMEOS)
29#include "ash/wm/cursor_manager_chromeos.h"
30#endif // defined(OS_CHROMEOS)
31
afakhrye4fae852017-05-09 18:49:0632class PrefRegistrySimple;
tibellb93c729b2017-03-30 00:45:0933class PrefService;
34
[email protected]87b0d82e2011-10-07 21:02:5935namespace aura {
[email protected]35304ce2011-12-14 23:21:0136class RootWindow;
derat94887a22017-01-20 18:17:2537class UserActivityForwarder;
[email protected]87b0d82e2011-10-07 21:02:5938class Window;
skya8b222f2017-01-12 15:47:1339class WindowManagerClient;
sky00f98a372017-01-11 06:03:4940class WindowTreeClient;
Alex Newcomer8fdcb9342017-08-08 18:48:4441} // namespace aura
[email protected]fa4a45832012-04-12 21:32:4842
warx533c8f62016-04-12 01:19:4343namespace chromeos {
44class AudioA11yController;
45}
46
sky7db5ccf2017-03-14 21:52:2947namespace app_list {
48class AppList;
Alex Newcomer8fdcb9342017-08-08 18:48:4449} // namespace app_list
sky7db5ccf2017-03-14 21:52:2950
rjkroege72f8154f2016-10-29 00:49:0251namespace display {
kylecharf2e4e412016-12-04 04:21:3552class DisplayChangeObserver;
kylechar7a067ec2017-01-07 01:16:2853class DisplayConfigurator;
rjkroege72f8154f2016-10-29 00:49:0254class DisplayManager;
Alex Newcomer8fdcb9342017-08-08 18:48:4455} // namespace display
rjkroege72f8154f2016-10-29 00:49:0256
[email protected]2b99f8c2011-10-11 19:42:2457namespace gfx {
sky4ec2be82017-01-06 17:38:3258class Insets;
[email protected]cac10fc62011-10-07 23:22:5659}
[email protected]b6ba05d902013-10-04 21:38:4560
[email protected]a8bd1cb2012-02-17 23:05:5461namespace ui {
derat2d4e62d2015-01-09 16:09:1762class UserActivityDetector;
[email protected]b0fa7012014-04-16 12:50:5763class UserActivityPowerManagerNotifier;
Alex Newcomer8fdcb9342017-08-08 18:48:4464} // namespace ui
thanhph3f3968512017-06-21 00:37:2365
[email protected]57b8bb352012-01-11 05:11:4666namespace views {
67class NonClientFrameView;
68class Widget;
[email protected]4a59e4e2012-11-12 21:15:4069namespace corewm {
[email protected]e319c7e2014-03-14 19:56:1470class TooltipController;
71}
Alex Newcomer8fdcb9342017-08-08 18:48:4472} // namespace views
[email protected]e319c7e2014-03-14 19:56:1473
74namespace wm {
[email protected]60d677d2014-05-30 13:07:0275class AcceleratorFilter;
Thiago Farina3b086a02017-05-30 22:32:5076class ActivationClient;
[email protected]4a59e4e2012-11-12 21:15:4077class CompoundEventFilter;
sky27344382017-03-08 21:30:3278class FocusController;
[email protected]86f2b5e2012-11-14 20:37:0079class ShadowController;
[email protected]b5756e22012-11-30 01:32:0280class VisibilityController;
[email protected]0c2dc012012-12-02 00:00:2381class WindowModalityController;
Alex Newcomer8fdcb9342017-08-08 18:48:4482} // namespace wm
[email protected]87b0d82e2011-10-07 21:02:5983
[email protected]55f593352011-12-24 05:42:4684namespace ash {
[email protected]87b0d82e2011-10-07 21:02:5985
sky81a2d792017-03-17 19:14:3986class AcceleratorController;
sky07a24d42017-03-09 23:57:3087class AccessibilityDelegate;
Scott Violetd64dac12017-06-02 21:50:0888class AshDisplayController;
sky15ef0aa2017-01-20 18:55:5989class AppListDelegateImpl;
erg36cfb952017-06-21 19:41:4590class NativeCursorManagerAsh;
sky07a24d42017-03-09 23:57:3091class AshTouchTransformController;
[email protected]55398d22013-10-10 19:49:2092class AutoclickController;
[email protected]b3142722014-03-04 06:59:5093class BluetoothNotificationController;
sky79fa34712017-03-20 23:46:4794class BrightnessControlDelegate;
95class CastConfigController;
robert.bradfordab052492015-05-06 11:09:5696class DisplayColorManager;
stevenjb537c5c3f2016-01-20 23:38:1297class DisplayConfigurationController;
[email protected]18b21b2e2013-03-01 20:56:2398class DisplayErrorObserver;
[email protected]084b6bb2011-11-17 05:18:1699class DragDropController;
[email protected]e67291f12012-10-10 05:52:38100class EventClientImpl;
[email protected]682990f2013-01-10 06:49:11101class EventTransformationHandler;
[email protected]093b8d642014-04-03 20:59:28102class FirstRunHelper;
sky79fa34712017-03-20 23:46:47103class FocusCycler;
[email protected]093b8d642014-04-03 20:59:28104class GPUSupport;
105class HighContrastController;
Vladislav Kaznacheev6d6aaff2017-07-22 04:06:32106class HighlighterController;
James Cookbb026732017-06-09 23:01:55107class ImeController;
sky5ab16472017-03-21 19:35:08108class ImmersiveContextAsh;
skyb7b54092016-08-19 16:00:09109class ImmersiveHandlerFactoryAsh;
sky79fa34712017-03-20 23:46:47110class KeyboardBrightnessControlDelegate;
111class KeyboardUI;
sammiequon203ae022016-09-18 17:23:42112class LaserPointerController;
yusukes1168eda2016-04-27 07:52:08113class LinkHandlerModelFactory;
sky79fa34712017-03-20 23:46:47114class LocaleNotificationController;
[email protected]093b8d642014-04-03 20:59:28115class LockStateController;
sky79fa34712017-03-20 23:46:47116class LogoutConfirmationController;
xiaoyinh2bbdd102017-05-18 23:29:42117class LockScreenController;
[email protected]093b8d642014-04-03 20:59:28118class MagnificationController;
Mitsuru Oshima0e9b7a62017-07-19 18:23:03119class TabletModeController;
sky5ab16472017-03-21 19:35:08120class MediaController;
[email protected]78d96302012-06-22 00:58:07121class MouseCursorEventFilter;
sky5ab16472017-03-21 19:35:08122class MruWindowTracker;
123class NewWindowController;
afakhrye4fae852017-05-09 18:49:06124class NightLightController;
[email protected]9ae32df2012-07-26 03:25:18125class OverlayEventFilter;
sky07a24d42017-03-09 23:57:30126class PaletteDelegate;
[email protected]093b8d642014-04-03 20:59:28127class PartialMagnificationController;
128class PowerButtonController;
[email protected]51625052013-10-10 01:40:16129class PowerEventObserver;
[email protected]72bce522014-02-10 21:11:26130class ProjectingObserver;
[email protected]e4a181cc2012-03-17 02:20:57131class ResizeShadowController;
[email protected]6ef71d72013-08-10 18:13:44132class ResolutionNotificationController;
[email protected]d90b8392012-06-13 09:34:56133class RootWindowController;
sky11cf8db92017-04-10 23:38:08134class ShellPort;
jamescookac6724332017-03-21 02:54:43135class ScreenLayoutObserver;
jonross0af45212015-01-13 18:55:46136class ScreenOrientationController;
oshima5a296e82016-04-29 01:32:27137class ScreenshotController;
hidehiko6821ca42016-06-18 11:12:23138class ScreenPinningController;
[email protected]8d625fb2012-07-18 16:40:06139class ScreenPositionController;
sky5ad143a2017-03-22 04:31:23140class SessionController;
sky5ad143a2017-03-22 04:31:23141class ShelfController;
sky5ad143a2017-03-22 04:31:23142class ShelfModel;
143class ShelfWindowWatcher;
skyb073203a2017-03-13 16:59:16144class ShellDelegate;
[email protected]1b4c7472014-05-15 18:32:23145struct ShellInitParams;
sky00c813f2017-03-08 22:48:55146class ShellObserver;
sky5b45ed82017-03-27 02:54:23147class ShutdownController;
kylechar98748a52016-12-03 01:33:22148class ShutdownObserver;
yiyix90cfee22017-02-16 05:38:18149class SmsObserver;
xdaid4913762017-07-06 00:17:22150class SplitViewController;
[email protected]093b8d642014-04-03 20:59:28151class StickyKeysController;
[email protected]9ae32df2012-07-26 03:25:18152class SystemGestureEventFilter;
[email protected]c0ce80e2012-10-05 23:28:27153class SystemModalContainerEventFilter;
[email protected]093b8d642014-04-03 20:59:28154class SystemTray;
sky79fa34712017-03-20 23:46:47155class SystemTrayController;
sky5b45ed82017-03-27 02:54:23156class SystemTrayNotifier;
[email protected]093b8d642014-04-03 20:59:28157class ToplevelWindowEventHandler;
sky07a24d42017-03-09 23:57:30158class ToastManager;
tbarzicc78da1ff92017-05-08 20:46:15159class TrayAction;
jamescookac6724332017-03-21 02:54:43160class TrayBluetoothHelper;
bsheeaae09a2014-09-22 23:16:52161class VirtualKeyboardController;
[email protected]ded58fd2013-10-09 07:56:55162class VideoActivityNotifier;
[email protected]093b8d642014-04-03 20:59:28163class VideoDetector;
sky5b45ed82017-03-27 02:54:23164class VpnList;
sky07a24d42017-03-09 23:57:30165class WallpaperController;
skyb073203a2017-03-13 16:59:16166class WallpaperDelegate;
[email protected]093b8d642014-04-03 20:59:28167class WebNotificationTray;
sky5b45ed82017-03-27 02:54:23168class WindowCycleController;
[email protected]093b8d642014-04-03 20:59:28169class WindowPositioner;
sky5b45ed82017-03-27 02:54:23170class WindowSelectorController;
msw607227f82016-08-30 17:22:39171class WindowTreeHostManager;
[email protected]2b99f8c2011-10-11 19:42:24172
sky494c6cbd2017-03-27 20:57:48173enum class Config;
174enum class LoginStatus;
Xiaohui Chenba65544e2017-08-12 02:30:14175enum class VoiceInteractionState;
sky494c6cbd2017-03-27 20:57:48176
[email protected]87b0d82e2011-10-07 21:02:59177// Shell is a singleton object that presents the Shell API and implements the
[email protected]99f07e02011-12-07 00:02:59178// RootWindow's delegate interface.
[email protected]b0079a92012-01-25 20:13:38179//
180// Upon creation, the Shell sets itself as the RootWindow's delegate, which
181// takes ownership of the Shell.
Xiyuan Xia22b1a6c2017-04-18 22:46:01182class ASH_EXPORT Shell : public SessionObserver,
sky5ad143a2017-03-22 04:31:23183 public SystemModalContainerEventFilterDelegate,
sky27344382017-03-08 21:30:32184 public ui::EventTarget,
Thiago Farina3b086a02017-05-30 22:32:50185 public ::wm::ActivationChangeObserver {
[email protected]87b0d82e2011-10-07 21:02:59186 public:
[email protected]093b8d642014-04-03 20:59:28187 typedef std::vector<RootWindowController*> RootWindowControllerList;
[email protected]be65be362012-06-15 07:38:23188
[email protected]3266c2b92011-11-14 00:06:08189 // A shell must be explicitly created so that it can call |Init()| with the
190 // delegate set. |delegate| can be NULL (if not required for initialization).
[email protected]09464c72013-04-26 07:31:28191 // Takes ownership of |delegate|.
[email protected]1b4c7472014-05-15 18:32:23192 static Shell* CreateInstance(const ShellInitParams& init_params);
[email protected]3266c2b92011-11-14 00:06:08193
194 // Should never be called before |CreateInstance()|.
skyb073203a2017-03-13 16:59:16195 static Shell* Get();
[email protected]3266c2b92011-11-14 00:06:08196
[email protected]b3b7bcd2012-03-06 19:35:45197 // Returns true if the ash shell has been instantiated.
198 static bool HasInstance();
199
[email protected]ef589af2011-12-03 01:07:15200 static void DeleteInstance();
[email protected]cac10fc62011-10-07 23:22:56201
[email protected]d90b8392012-06-13 09:34:56202 // Returns the root window controller for the primary root window.
[email protected]a0afeb12012-12-10 22:57:09203 // TODO(oshima): move this to |RootWindowController|
[email protected]093b8d642014-04-03 20:59:28204 static RootWindowController* GetPrimaryRootWindowController();
[email protected]d90b8392012-06-13 09:34:56205
thanhphc90f49ca2017-03-03 17:48:53206 // Returns the RootWindowController for the given display id. If there
207 // is no display for |display_id|, null is returned.
208 static RootWindowController* GetRootWindowControllerWithDisplayId(
209 int64_t display_id);
210
Scott Violet596bb46342017-06-21 14:43:13211 // Returns the root Window for the given display id. If there is no display
212 // for |display_id| null is returned.
213 static aura::Window* GetRootWindowForDisplayId(int64_t display_id);
214
[email protected]cf1c70e2012-08-30 01:13:02215 // Returns all root window controllers.
[email protected]a0afeb12012-12-10 22:57:09216 // TODO(oshima): move this to |RootWindowController|
[email protected]be65be362012-06-15 07:38:23217 static RootWindowControllerList GetAllRootWindowControllers();
218
[email protected]bf9cdb362013-10-25 19:22:45219 // Returns the primary root Window. The primary root Window is the one that
220 // has a launcher.
221 static aura::Window* GetPrimaryRootWindow();
[email protected]e73bd7802012-02-17 20:10:34222
sky27344382017-03-08 21:30:32223 // Returns the root window that newly created windows should be added to.
224 // Value can be temporarily overridden using ScopedRootWindowForNewWindows.
225 // NOTE: this returns the root, newly created window should be added to the
226 // appropriate container in the returned window.
227 static aura::Window* GetRootWindowForNewWindows();
mfomitcheva1a8aa62016-05-03 16:23:26228
[email protected]cf1c70e2012-08-30 01:13:02229 // Returns all root windows.
[email protected]c9390bd2013-11-08 20:33:13230 static aura::Window::Windows GetAllRootWindows();
[email protected]be65be362012-06-15 07:38:23231
[email protected]bf9cdb362013-10-25 19:22:45232 static aura::Window* GetContainer(aura::Window* root_window,
[email protected]7b0f7502012-06-11 00:12:39233 int container_id);
[email protected]bf9cdb362013-10-25 19:22:45234 static const aura::Window* GetContainer(const aura::Window* root_window,
[email protected]e67291f12012-10-10 05:52:38235 int container_id);
[email protected]7b0f7502012-06-11 00:12:39236
skya8b222f2017-01-12 15:47:13237 // TODO(sky): move this and WindowManagerClient into ShellMash that is owned
238 // by Shell. Doing the move is gated on having mash create Shell.
sky00f98a372017-01-11 06:03:49239 static void set_window_tree_client(aura::WindowTreeClient* client) {
240 window_tree_client_ = client;
241 }
242
243 static aura::WindowTreeClient* window_tree_client() {
244 return window_tree_client_;
245 }
246
skya8b222f2017-01-12 15:47:13247 static void set_window_manager_client(aura::WindowManagerClient* client) {
248 window_manager_client_ = client;
249 }
250 static aura::WindowManagerClient* window_manager_client() {
251 return window_manager_client_;
252 }
253
jamescook0dfe5632017-04-05 18:49:02254 static Config GetAshConfig();
moshayedic229a522017-05-05 18:14:26255 static bool ShouldUseIMEService();
sky494c6cbd2017-03-27 20:57:48256
Wenzhao Zang56c292932017-08-02 04:58:34257 // Registers all ash related local state prefs to the given |registry|.
258 static void RegisterLocalStatePrefs(PrefRegistrySimple* registry);
259
James Cook8532dbc2017-07-31 21:54:51260 // Registers all ash related user profile prefs to the given |registry|.
James Cook98072352017-08-07 18:00:07261 // Can be called before Shell is initialized.
James Cook8532dbc2017-07-31 21:54:51262 static void RegisterProfilePrefs(PrefRegistrySimple* registry);
afakhrye4fae852017-05-09 18:49:06263
[email protected]57b8bb352012-01-11 05:11:46264 // Creates a default views::NonClientFrameView for use by windows in the
265 // Ash environment.
266 views::NonClientFrameView* CreateDefaultNonClientFrameView(
267 views::Widget* widget);
268
mswad28b252016-08-09 02:42:07269 // Sets work area insets of the display containing |window|, pings observers.
[email protected]2e236a52012-06-27 22:21:47270 void SetDisplayWorkAreaInsets(aura::Window* window,
[email protected]8a45c972012-03-14 18:22:44271 const gfx::Insets& insets);
[email protected]1a2145b2012-03-13 21:09:17272
[email protected]58868abf2014-01-17 23:45:33273 // Called when a casting session is started or stopped.
274 void OnCastingSessionStartedOrStopped(bool started);
275
[email protected]0e3e7cb2014-04-12 05:18:25276 // Called when a root window is created.
varkhac71444e52017-05-25 22:51:34277 void OnRootWindowAdded(aura::Window* root_window);
[email protected]0e3e7cb2014-04-12 05:18:25278
Keigo Okae82281a2017-06-14 13:59:14279 // Creates a keyboard controller and associate it with the primary root window
280 // controller. Destroys the old keyboard controller if it already exists.
[email protected]51f438112013-11-18 19:32:50281 void CreateKeyboard();
282
Keigo Okac7617a42017-06-14 11:33:24283 // Destroys the virtual keyboard.
284 void DestroyKeyboard();
[email protected]e1b299b2014-01-29 23:53:41285
Mitsuru Oshima0e9b7a62017-07-19 18:23:03286 // Test if TabletModeWindowManager is not enabled, and if
287 // TabletModeController is not currently setting a display rotation. Or if
[email protected]da285852014-05-27 19:53:43288 // the |resolution_notification_controller_| is not showing its confirmation
289 // dialog. If true then changes to display settings can be saved.
290 bool ShouldSaveDisplaySettings();
[email protected]da285852014-05-27 19:53:43291
sky81a2d792017-03-17 19:14:39292 AcceleratorController* accelerator_controller() {
293 return accelerator_controller_.get();
sky44a09892016-07-20 17:46:58294 }
sky07a24d42017-03-09 23:57:30295 AccessibilityDelegate* accessibility_delegate() {
296 return accessibility_delegate_.get();
297 }
sky7db5ccf2017-03-14 21:52:29298 app_list::AppList* app_list() { return app_list_.get(); }
Scott Violetd64dac12017-06-02 21:50:08299 AshDisplayController* ash_display_controller() {
300 return ash_display_controller_.get();
301 }
sky79fa34712017-03-20 23:46:47302 BrightnessControlDelegate* brightness_control_delegate() {
303 return brightness_control_delegate_.get();
304 }
305 CastConfigController* cast_config() { return cast_config_.get(); }
rjkroege72f8154f2016-10-29 00:49:02306 display::DisplayManager* display_manager() { return display_manager_.get(); }
stevenjb537c5c3f2016-01-20 23:38:12307 DisplayConfigurationController* display_configuration_controller() {
308 return display_configuration_controller_.get();
309 }
Sammie Quona6f96402017-08-24 01:08:37310 EventClientImpl* event_client() { return event_client_.get(); }
jamescookb8dcef522016-06-25 14:42:55311 ::wm::CompoundEventFilter* env_filter() { return env_filter_.get(); }
sky79fa34712017-03-20 23:46:47312 FocusCycler* focus_cycler() { return focus_cycler_.get(); }
James Cookf0c78fc2017-06-15 14:42:55313 ImeController* ime_controller() { return ime_controller_.get(); }
sky79fa34712017-03-20 23:46:47314 KeyboardBrightnessControlDelegate* keyboard_brightness_control_delegate() {
315 return keyboard_brightness_control_delegate_.get();
316 }
317 KeyboardUI* keyboard_ui() { return keyboard_ui_.get(); }
318 LocaleNotificationController* locale_notification_controller() {
319 return locale_notification_controller_.get();
320 }
321 LogoutConfirmationController* logout_confirmation_controller() {
322 return logout_confirmation_controller_.get();
323 }
xiaoyinh2bbdd102017-05-18 23:29:42324 LockScreenController* lock_screen_controller() {
325 return lock_screen_controller_.get();
326 }
sky5ab16472017-03-21 19:35:08327 MediaController* media_controller() { return media_controller_.get(); }
328 MruWindowTracker* mru_window_tracker() { return mru_window_tracker_.get(); }
329 NewWindowController* new_window_controller() {
330 return new_window_controller_.get();
331 }
afakhry9e0a18b32017-06-05 19:23:14332 NightLightController* night_light_controller();
sky5ad143a2017-03-22 04:31:23333 SessionController* session_controller() { return session_controller_.get(); }
334 ShelfController* shelf_controller() { return shelf_controller_.get(); }
sky5ad143a2017-03-22 04:31:23335 ShelfModel* shelf_model();
sky5b45ed82017-03-27 02:54:23336 ShutdownController* shutdown_controller() {
337 return shutdown_controller_.get();
338 }
sky79fa34712017-03-20 23:46:47339 SystemTrayController* system_tray_controller() {
340 return system_tray_controller_.get();
341 }
sky5b45ed82017-03-27 02:54:23342 SystemTrayNotifier* system_tray_notifier() {
343 return system_tray_notifier_.get();
344 }
Sammie Quona6f96402017-08-24 01:08:37345 TabletModeController* tablet_mode_controller() {
346 return tablet_mode_controller_.get();
347 }
[email protected]a1b7a822013-02-23 19:08:04348 views::corewm::TooltipController* tooltip_controller() {
[email protected]862deef2011-12-15 22:07:33349 return tooltip_controller_.get();
[email protected]4a229e902011-12-01 21:21:11350 }
tbarzicc78da1ff92017-05-08 20:46:15351 TrayAction* tray_action() { return tray_action_.get(); }
sky5b45ed82017-03-27 02:54:23352 VpnList* vpn_list() { return vpn_list_.get(); }
353 WindowCycleController* window_cycle_controller() {
354 return window_cycle_controller_.get();
355 }
356 WindowSelectorController* window_selector_controller() {
357 return window_selector_controller_.get();
358 }
[email protected]093b8d642014-04-03 20:59:28359 OverlayEventFilter* overlay_filter() { return overlay_filter_.get(); }
yusukes1168eda2016-04-27 07:52:08360 LinkHandlerModelFactory* link_handler_model_factory() {
361 return link_handler_model_factory_;
362 }
363 void set_link_handler_model_factory(
364 LinkHandlerModelFactory* link_handler_model_factory) {
365 link_handler_model_factory_ = link_handler_model_factory;
366 }
[email protected]e0d22e82012-01-04 00:46:57367 PowerButtonController* power_button_controller() {
368 return power_button_controller_.get();
369 }
[email protected]ab4f8c92013-05-30 19:07:47370 LockStateController* lock_state_controller() {
371 return lock_state_controller_.get();
[email protected]222f40c2012-10-18 08:58:13372 }
sky07a24d42017-03-09 23:57:30373 PaletteDelegate* palette_delegate() { return palette_delegate_.get(); }
skyb073203a2017-03-13 16:59:16374 ShellDelegate* shell_delegate() { return shell_delegate_.get(); }
jamescookb8dcef522016-06-25 14:42:55375 VideoDetector* video_detector() { return video_detector_.get(); }
sky07a24d42017-03-09 23:57:30376 WallpaperController* wallpaper_controller() {
377 return wallpaper_controller_.get();
378 }
skyb073203a2017-03-13 16:59:16379 WallpaperDelegate* wallpaper_delegate() { return wallpaper_delegate_.get(); }
oshimae2818922015-07-28 01:18:52380 WindowTreeHostManager* window_tree_host_manager() {
381 return window_tree_host_manager_.get();
[email protected]3e1cdd312012-06-07 03:48:41382 }
chirantan40e4cd82015-02-19 01:08:19383 PowerEventObserver* power_event_observer() {
384 return power_event_observer_.get();
385 }
kylechar55f0eaf22017-01-11 22:57:37386 AshTouchTransformController* touch_transformer_controller() {
[email protected]03122891a2014-05-13 23:56:49387 return touch_transformer_controller_.get();
388 }
sammiequon203ae022016-09-18 17:23:42389 LaserPointerController* laser_pointer_controller() {
390 return laser_pointer_controller_.get();
391 }
392 PartialMagnificationController* partial_magnification_controller() {
393 return partial_magnification_controller_.get();
394 }
Vladislav Kaznacheev6d6aaff2017-07-22 04:06:32395 HighlighterController* highlighter_controller() {
396 return highlighter_controller_.get();
397 }
oshima5a296e82016-04-29 01:32:27398 ScreenshotController* screenshot_controller() {
399 return screenshot_controller_.get();
mukai19274bdd2015-02-24 22:37:48400 }
[email protected]093b8d642014-04-03 20:59:28401 MouseCursorEventFilter* mouse_cursor_filter() {
[email protected]8b7ba87b2012-09-01 00:40:40402 return mouse_cursor_filter_.get();
403 }
[email protected]093b8d642014-04-03 20:59:28404 EventTransformationHandler* event_transformation_handler() {
[email protected]682990f2013-01-10 06:49:11405 return event_transformation_handler_.get();
406 }
sadrul7a8785e2016-02-12 21:54:35407 ::wm::CursorManager* cursor_manager() { return cursor_manager_.get(); }
[email protected]4a229e902011-12-01 21:21:11408
[email protected]f48075d2012-05-24 11:06:51409 HighContrastController* high_contrast_controller() {
410 return high_contrast_controller_.get();
411 }
412
[email protected]77f7c132012-11-15 06:52:54413 MagnificationController* magnification_controller() {
[email protected]c1c670172012-04-26 04:20:26414 return magnification_controller_.get();
415 }
[email protected]f48075d2012-05-24 11:06:51416
[email protected]55398d22013-10-10 19:49:20417 AutoclickController* autoclick_controller() {
418 return autoclick_controller_.get();
419 }
420
sky07a24d42017-03-09 23:57:30421 ToastManager* toast_manager() { return toast_manager_.get(); }
422
Thiago Farina3b086a02017-05-30 22:32:50423 ::wm::ActivationClient* activation_client();
[email protected]77f7c132012-11-15 06:52:54424
[email protected]c758fbf2012-03-25 22:53:59425 // Force the shelf to query for it's current visibility state.
jamescook6afad6d2016-06-01 00:35:01426 // TODO(jamescook): Move to Shelf.
[email protected]c758fbf2012-03-25 22:53:59427 void UpdateShelfVisibility();
428
Sam McNallye36abbc2017-07-20 01:04:28429 // Gets the local state pref service. It can be null in mash if connecting to
430 // local state pref service has not completed successfully.
Wenzhao Zang44240fb2017-07-13 01:36:54431 PrefService* GetLocalStatePrefService() const;
432
[email protected]88d71122012-10-18 07:11:01433 // Returns WebNotificationTray on the primary root window.
434 WebNotificationTray* GetWebNotificationTray();
[email protected]6d6546e2012-05-30 23:12:02435
[email protected]a0afeb12012-12-10 22:57:09436 // Does the primary display have status area?
437 bool HasPrimaryStatusArea();
438
439 // Returns the system tray on primary display.
440 SystemTray* GetPrimarySystemTray();
[email protected]bfb411312012-02-27 20:59:27441
[email protected]9488d4d2012-02-29 18:32:37442 static void set_initially_hide_cursor(bool hide) {
443 initially_hide_cursor_ = hide;
444 }
445
[email protected]093b8d642014-04-03 20:59:28446 ResizeShadowController* resize_shadow_controller() {
[email protected]e4a181cc2012-03-17 02:20:57447 return resize_shadow_controller_.get();
448 }
449
[email protected]a54e65b2011-11-21 22:03:34450 // Made available for tests.
[email protected]e319c7e2014-03-14 19:56:14451 ::wm::ShadowController* shadow_controller() {
[email protected]a54e65b2011-11-21 22:03:34452 return shadow_controller_.get();
453 }
454
[email protected]f9466702012-09-17 16:35:27455 // Starts the animation that occurs on first login.
456 void DoInitialWorkspaceAnimation();
457
oshimae2818922015-07-28 01:18:52458 // TODO(oshima): Move these objects to WindowTreeHostManager.
kylechar7a067ec2017-01-07 01:16:28459 display::DisplayConfigurator* display_configurator() {
[email protected]1e31cbd2014-04-07 20:06:11460 return display_configurator_.get();
[email protected]70b3e7d52012-06-02 22:12:25461 }
[email protected]093b8d642014-04-03 20:59:28462 DisplayErrorObserver* display_error_observer() {
[email protected]18b21b2e2013-03-01 20:56:23463 return display_error_observer_.get();
464 }
[email protected]70b3e7d52012-06-02 22:12:25465
yiyixa68ade512016-09-01 17:38:13466 ScreenLayoutObserver* screen_layout_observer() {
467 return screen_layout_observer_.get();
468 }
469
[email protected]093b8d642014-04-03 20:59:28470 ResolutionNotificationController* resolution_notification_controller() {
[email protected]6ef71d72013-08-10 18:13:44471 return resolution_notification_controller_.get();
472 }
[email protected]0dc85512014-03-13 13:26:41473
jonross0af45212015-01-13 18:55:46474 ScreenOrientationController* screen_orientation_controller() {
475 return screen_orientation_controller_.get();
jonrossf21fea12014-11-13 01:22:51476 }
477
jamescookac6724332017-03-21 02:54:43478 TrayBluetoothHelper* tray_bluetooth_helper() {
479 return tray_bluetooth_helper_.get();
480 }
481
rsadamc727b6a2014-10-31 18:59:33482 VirtualKeyboardController* virtual_keyboard_controller() {
483 return virtual_keyboard_controller_.get();
484 }
warx533c8f62016-04-12 01:19:43485
486 chromeos::AudioA11yController* audio_a11y_controller() {
487 return audio_a11y_controller_.get();
488 }
[email protected]6ef71d72013-08-10 18:13:44489
jamescookb8dcef522016-06-25 14:42:55490 WindowPositioner* window_positioner() { return window_positioner_.get(); }
[email protected]e9a71312013-10-04 03:20:01491
jamescookb8dcef522016-06-25 14:42:55492 UserMetricsRecorder* metrics() { return user_metrics_recorder_.get(); }
[email protected]5d2ea362013-12-13 08:10:18493
[email protected]2b8a9bb2013-07-01 22:43:40494 void SetTouchHudProjectionEnabled(bool enabled);
495
496 bool is_touch_hud_projection_enabled() const {
497 return is_touch_hud_projection_enabled_;
498 }
499
sky27344382017-03-08 21:30:32500 // NOTE: Prefer ScopedRootWindowForNewWindows when setting temporarily.
mswad3d9552017-05-18 21:23:36501 void set_root_window_for_new_windows(aura::Window* root) {
sky27344382017-03-08 21:30:32502 root_window_for_new_windows_ = root;
503 }
504
[email protected]59ccade2013-10-17 17:56:40505 // Creates instance of FirstRunHelper. Caller is responsible for deleting
506 // returned object.
507 ash::FirstRunHelper* CreateFirstRunHelper();
[email protected]f94c6aa2013-11-08 01:18:54508
yawanodc5533b32017-02-23 11:04:38509 void SetLargeCursorSizeInDip(int large_cursor_size_in_dip);
510
[email protected]87ec2202014-02-06 06:24:27511 // Toggles cursor compositing on/off. Native cursor is disabled when cursor
512 // compositing is enabled, and vice versa.
513 void SetCursorCompositingEnabled(bool enabled);
514
[email protected]08bdabed2013-12-20 07:52:28515 StickyKeysController* sticky_keys_controller() {
516 return sticky_keys_controller_.get();
[email protected]f94c6aa2013-11-08 01:18:54517 }
hidehiko6821ca42016-06-18 11:12:23518
hidehiko6821ca42016-06-18 11:12:23519 ScreenPinningController* screen_pinning_controller() {
520 return screen_pinning_controller_.get();
521 }
522
[email protected]1d2a7212014-01-16 06:09:48523 GPUSupport* gpu_support() { return gpu_support_.get(); }
[email protected]1d2a7212014-01-16 06:09:48524
xdaid4913762017-07-06 00:17:22525 SplitViewController* split_view_controller() {
526 return split_view_controller_.get();
527 }
528
529 // Returns true if split view mode is active.
530 bool IsSplitViewModeActive() const;
531
sky00c813f2017-03-08 22:48:55532 void AddShellObserver(ShellObserver* observer);
533 void RemoveShellObserver(ShellObserver* observer);
534
sky7db5ccf2017-03-14 21:52:29535 // Shows the app list on the active root window.
Alex Newcomer8fdcb9342017-08-08 18:48:44536 void ShowAppList(app_list::AppListShowSource toggle_method);
sky7db5ccf2017-03-14 21:52:29537
MinCheneafaa52e2017-07-31 18:32:52538 // Updates y position and opacity of app list. |is_end_gesture| means it is
539 // the end of the gesture dragging of app list from shelf and should restore
540 // the opacity of the app list.
541 void UpdateAppListYPositionAndOpacity(int y_position_in_screen,
542 float app_list_background_opacity,
543 bool is_end_gesture);
MinChend646ae02017-07-21 23:07:17544
sky7db5ccf2017-03-14 21:52:29545 // Dismisses the app list.
546 void DismissAppList();
547
548 // Shows the app list if it's not visible. Dismisses it otherwise.
Alex Newcomer8fdcb9342017-08-08 18:48:44549 void ToggleAppList(app_list::AppListShowSource toggle_method);
sky7db5ccf2017-03-14 21:52:29550
551 // Returns app list actual visibility. This might differ from
552 // GetAppListTargetVisibility() when hiding animation is still in flight.
553 bool IsAppListVisible() const;
554
555 // Returns app list target visibility.
556 bool GetAppListTargetVisibility() const;
557
sky5ad143a2017-03-22 04:31:23558 // Called when the login status changes.
559 // TODO(oshima): Investigate if we can merge this and |OnLoginStateChanged|.
560 void UpdateAfterLoginStatusChange(LoginStatus status);
561
sky00c813f2017-03-08 22:48:55562 // Notifies observers that overview mode is about to be started (before the
563 // windows get re-arranged).
564 void NotifyOverviewModeStarting();
565
566 // Notifies observers that overview mode has ended.
567 void NotifyOverviewModeEnded();
568
xdaid4913762017-07-06 00:17:22569 // Notifies observers that split view mode is about to be started (before the
570 // window gets snapped and activated).
571 void NotifySplitViewModeStarting();
572
573 // Notifies observers that split view mode has ended.
574 void NotifySplitViewModeEnded();
575
sky00c813f2017-03-08 22:48:55576 // Notifies observers that fullscreen mode has changed for |root_window|.
varkhac71444e52017-05-25 22:51:34577 void NotifyFullscreenStateChanged(bool is_fullscreen,
578 aura::Window* root_window);
sky00c813f2017-03-08 22:48:55579
580 // Notifies observers that |pinned_window| changed its pinned window state.
varkha19d7e6c52017-05-25 21:15:30581 void NotifyPinnedStateChanged(aura::Window* pinned_window);
sky00c813f2017-03-08 22:48:55582
583 // Notifies observers that the virtual keyboard has been
xiyuan38160182017-03-14 22:50:13584 // activated/deactivated for |root_window|.
sky97f9a7432017-05-09 05:14:31585 void NotifyVirtualKeyboardActivated(bool activated,
586 aura::Window* root_window);
sky00c813f2017-03-08 22:48:55587
588 // Notifies observers that the shelf was created for |root_window|.
589 // TODO(jamescook): Move to Shelf.
varkha6b016b0f2017-05-26 16:14:18590 void NotifyShelfCreatedForRootWindow(aura::Window* root_window);
sky00c813f2017-03-08 22:48:55591
592 // Notifies observers that |root_window|'s shelf changed alignment.
593 // TODO(jamescook): Move to Shelf.
varkha6b016b0f2017-05-26 16:14:18594 void NotifyShelfAlignmentChanged(aura::Window* root_window);
sky00c813f2017-03-08 22:48:55595
596 // Notifies observers that |root_window|'s shelf changed auto-hide behavior.
597 // TODO(jamescook): Move to Shelf.
varkha6b016b0f2017-05-26 16:14:18598 void NotifyShelfAutoHideBehaviorChanged(aura::Window* root_window);
sky00c813f2017-03-08 22:48:55599
jamescook518dccbd2017-05-18 04:57:07600 // Used to provide better error messages for Shell::Get() under mash.
601 static void SetIsBrowserProcessWithMash();
602
James Cookbbe5cb12017-08-08 18:32:21603 // Used when Chrome owns the pref service (not mash).
604 void SetLocalStatePrefService(PrefService* local_state);
605
muyuanlid766f2e2017-06-26 20:17:19606 void NotifyAppListVisibilityChanged(bool visible, aura::Window* root_window);
607
Xiaohui Chenba65544e2017-08-12 02:30:14608 void NotifyVoiceInteractionStatusChanged(VoiceInteractionState state);
newcomer2febb9832017-06-12 17:00:23609
Yue Li2564a8d2017-08-21 23:30:32610 void NotifyVoiceInteractionEnabled(bool enabled);
611
[email protected]2b4cd302012-02-24 20:21:13612 private:
[email protected]c39be8f2012-06-15 22:58:36613 FRIEND_TEST_ALL_PREFIXES(ExtendedDesktopTest, TestCursor);
[email protected]1aad3322012-06-06 06:37:09614 FRIEND_TEST_ALL_PREFIXES(WindowManagerTest, MouseEventCursors);
615 FRIEND_TEST_ALL_PREFIXES(WindowManagerTest, TransformActivate);
sky79fa34712017-03-20 23:46:47616 friend class AcceleratorControllerTest;
[email protected]093b8d642014-04-03 20:59:28617 friend class RootWindowController;
sky27344382017-03-08 21:30:32618 friend class ScopedRootWindowForNewWindows;
James Cook317781a2017-07-18 02:08:06619 friend class ShellTestApi;
sky27344382017-03-08 21:30:32620 friend class SmsObserverTest;
[email protected]ad0c8722012-03-02 20:17:45621
skyb073203a2017-03-13 16:59:16622 Shell(std::unique_ptr<ShellDelegate> shell_delegate,
sky11cf8db92017-04-10 23:38:08623 std::unique_ptr<ShellPort> shell_port);
dcheng1f4538e2014-10-27 23:57:05624 ~Shell() override;
[email protected]3266c2b92011-11-14 00:06:08625
[email protected]1b4c7472014-05-15 18:32:23626 void Init(const ShellInitParams& init_params);
[email protected]b0639282011-12-22 21:12:27627
[email protected]a273d33a2013-10-17 12:41:21628 // Initializes the root window so that it can host browser windows.
[email protected]41baaed2013-11-09 04:18:26629 void InitRootWindow(aura::Window* root_window);
[email protected]d90b8392012-06-13 09:34:56630
skyabcae812017-01-18 17:01:34631 // Destroys all child windows including widgets across all roots.
632 void CloseAllRootWindowChildWindows();
633
hariank0dd03dd2016-07-14 23:47:33634 // SystemModalContainerEventFilterDelegate:
dcheng1f4538e2014-10-27 23:57:05635 bool CanWindowReceiveEvents(aura::Window* window) override;
[email protected]c0ce80e2012-10-05 23:28:27636
[email protected]5097e692012-10-30 22:08:41637 // Overridden from ui::EventTarget:
dcheng1f4538e2014-10-27 23:57:05638 bool CanAcceptEvent(const ui::Event& event) override;
639 EventTarget* GetParentTarget() override;
dchenga94547472016-04-08 08:41:11640 std::unique_ptr<ui::EventTargetIterator> GetChildIterator() const override;
dcheng1f4538e2014-10-27 23:57:05641 ui::EventTargeter* GetEventTargeter() override;
[email protected]5097e692012-10-30 22:08:41642
Thiago Farina3b086a02017-05-30 22:32:50643 // wm::ActivationChangeObserver:
sky27344382017-03-08 21:30:32644 void OnWindowActivated(ActivationReason reason,
645 aura::Window* gained_active,
646 aura::Window* lost_active) override;
647
Xiyuan Xia22b1a6c2017-04-18 22:46:01648 // SessionObserver:
Xiyuan Xiab64fd0a2017-04-13 17:53:14649 void OnSessionStateChanged(session_manager::SessionState state) override;
650 void OnLoginStatusChanged(LoginStatus login_status) override;
651 void OnLockStateChanged(bool locked) override;
sky5ad143a2017-03-22 04:31:23652
jamescook788b4fc2017-05-18 16:16:06653 // Finalizes the shelf state. Called after the user session is active and
654 // the profile is available.
655 void InitializeShelf();
656
Sam McNallyf4dab612017-08-16 03:06:33657 // Callback for prefs::ConnectToPrefService.
Sam McNallye36abbc2017-07-20 01:04:28658 void OnLocalStatePrefServiceInitialized(
659 std::unique_ptr<::PrefService> pref_service);
tibellb93c729b2017-03-30 00:45:09660
[email protected]cac10fc62011-10-07 23:22:56661 static Shell* instance_;
662
sky00f98a372017-01-11 06:03:49663 // Only valid in mash, for classic ash this is null.
664 static aura::WindowTreeClient* window_tree_client_;
skya8b222f2017-01-12 15:47:13665 static aura::WindowManagerClient* window_manager_client_;
sky00f98a372017-01-11 06:03:49666
[email protected]9488d4d2012-02-29 18:32:37667 // If set before the Shell is initialized, the mouse cursor will be hidden
668 // when the screen is initially created.
669 static bool initially_hide_cursor_;
670
sky11cf8db92017-04-10 23:38:08671 std::unique_ptr<ShellPort> shell_port_;
sky984c1892016-04-20 00:00:34672
[email protected]1aad3322012-06-06 06:37:09673 // The CompoundEventFilter owned by aura::Env object.
dchenga94547472016-04-08 08:41:11674 std::unique_ptr<::wm::CompoundEventFilter> env_filter_;
[email protected]627a62f2012-02-14 22:59:14675
dchenga94547472016-04-08 08:41:11676 std::unique_ptr<UserMetricsRecorder> user_metrics_recorder_;
dchenga94547472016-04-08 08:41:11677 std::unique_ptr<WindowPositioner> window_positioner_;
[email protected]2b99f8c2011-10-11 19:42:24678
sky81a2d792017-03-17 19:14:39679 std::unique_ptr<AcceleratorController> accelerator_controller_;
sky07a24d42017-03-09 23:57:30680 std::unique_ptr<AccessibilityDelegate> accessibility_delegate_;
Scott Violetd64dac12017-06-02 21:50:08681 std::unique_ptr<AshDisplayController> ash_display_controller_;
sky79fa34712017-03-20 23:46:47682 std::unique_ptr<BrightnessControlDelegate> brightness_control_delegate_;
683 std::unique_ptr<CastConfigController> cast_config_;
dchenga94547472016-04-08 08:41:11684 std::unique_ptr<DragDropController> drag_drop_controller_;
sky79fa34712017-03-20 23:46:47685 std::unique_ptr<FocusCycler> focus_cycler_;
James Cookf0c78fc2017-06-15 14:42:55686 std::unique_ptr<ImeController> ime_controller_;
sky5ab16472017-03-21 19:35:08687 std::unique_ptr<ImmersiveContextAsh> immersive_context_;
sky79fa34712017-03-20 23:46:47688 std::unique_ptr<KeyboardBrightnessControlDelegate>
689 keyboard_brightness_control_delegate_;
690 std::unique_ptr<KeyboardUI> keyboard_ui_;
691 std::unique_ptr<LocaleNotificationController> locale_notification_controller_;
xiaoyinh2bbdd102017-05-18 23:29:42692 std::unique_ptr<LockScreenController> lock_screen_controller_;
sky79fa34712017-03-20 23:46:47693 std::unique_ptr<LogoutConfirmationController> logout_confirmation_controller_;
Mitsuru Oshima0e9b7a62017-07-19 18:23:03694 std::unique_ptr<TabletModeController> tablet_mode_controller_;
sky5ab16472017-03-21 19:35:08695 std::unique_ptr<MediaController> media_controller_;
696 std::unique_ptr<MruWindowTracker> mru_window_tracker_;
697 std::unique_ptr<NewWindowController> new_window_controller_;
sky79fa34712017-03-20 23:46:47698 std::unique_ptr<PaletteDelegate> palette_delegate_;
dchenga94547472016-04-08 08:41:11699 std::unique_ptr<ResizeShadowController> resize_shadow_controller_;
sky5ad143a2017-03-22 04:31:23700 std::unique_ptr<SessionController> session_controller_;
afakhrye4fae852017-05-09 18:49:06701 std::unique_ptr<NightLightController> night_light_controller_;
sky5ad143a2017-03-22 04:31:23702 std::unique_ptr<ShelfController> shelf_controller_;
sky5ad143a2017-03-22 04:31:23703 std::unique_ptr<ShelfWindowWatcher> shelf_window_watcher_;
skyb073203a2017-03-13 16:59:16704 std::unique_ptr<ShellDelegate> shell_delegate_;
sky5b45ed82017-03-27 02:54:23705 std::unique_ptr<ShutdownController> shutdown_controller_;
sky79fa34712017-03-20 23:46:47706 std::unique_ptr<SystemTrayController> system_tray_controller_;
sky5b45ed82017-03-27 02:54:23707 std::unique_ptr<SystemTrayNotifier> system_tray_notifier_;
sky07a24d42017-03-09 23:57:30708 std::unique_ptr<ToastManager> toast_manager_;
tbarzicc78da1ff92017-05-08 20:46:15709 std::unique_ptr<TrayAction> tray_action_;
sky5b45ed82017-03-27 02:54:23710 std::unique_ptr<VpnList> vpn_list_;
sky07a24d42017-03-09 23:57:30711 std::unique_ptr<WallpaperController> wallpaper_controller_;
skyb073203a2017-03-13 16:59:16712 std::unique_ptr<WallpaperDelegate> wallpaper_delegate_;
sky5b45ed82017-03-27 02:54:23713 std::unique_ptr<WindowCycleController> window_cycle_controller_;
714 std::unique_ptr<WindowSelectorController> window_selector_controller_;
dchenga94547472016-04-08 08:41:11715 std::unique_ptr<::wm::ShadowController> shadow_controller_;
716 std::unique_ptr<::wm::VisibilityController> visibility_controller_;
717 std::unique_ptr<::wm::WindowModalityController> window_modality_controller_;
sky7db5ccf2017-03-14 21:52:29718 std::unique_ptr<app_list::AppList> app_list_;
James Cook8532dbc2017-07-31 21:54:51719
James Cookbbe5cb12017-08-08 18:32:21720 // Used in non-mash. Owned by chrome.
721 PrefService* local_state_non_mash_ = nullptr;
722
723 // Used in mash.
724 std::unique_ptr<PrefService> local_state_mash_;
James Cook8532dbc2017-07-31 21:54:51725
dchenga94547472016-04-08 08:41:11726 std::unique_ptr<views::corewm::TooltipController> tooltip_controller_;
yusukes1168eda2016-04-27 07:52:08727 LinkHandlerModelFactory* link_handler_model_factory_;
dchenga94547472016-04-08 08:41:11728 std::unique_ptr<PowerButtonController> power_button_controller_;
729 std::unique_ptr<LockStateController> lock_state_controller_;
dchenga94547472016-04-08 08:41:11730 std::unique_ptr<ui::UserActivityDetector> user_activity_detector_;
731 std::unique_ptr<VideoDetector> video_detector_;
dchenga94547472016-04-08 08:41:11732 std::unique_ptr<WindowTreeHostManager> window_tree_host_manager_;
733 std::unique_ptr<HighContrastController> high_contrast_controller_;
734 std::unique_ptr<MagnificationController> magnification_controller_;
dchenga94547472016-04-08 08:41:11735 std::unique_ptr<AutoclickController> autoclick_controller_;
sky27344382017-03-08 21:30:32736 std::unique_ptr<::wm::FocusController> focus_controller_;
sky984c1892016-04-20 00:00:34737
oshima5a296e82016-04-29 01:32:27738 std::unique_ptr<ScreenshotController> screenshot_controller_;
[email protected]f5c9dbc2014-04-11 08:13:45739
dchenga94547472016-04-08 08:41:11740 std::unique_ptr<MouseCursorEventFilter> mouse_cursor_filter_;
741 std::unique_ptr<ScreenPositionController> screen_position_controller_;
742 std::unique_ptr<SystemModalContainerEventFilter> modality_filter_;
743 std::unique_ptr<EventClientImpl> event_client_;
744 std::unique_ptr<EventTransformationHandler> event_transformation_handler_;
[email protected]ae18b9112011-11-07 16:59:13745
[email protected]0b0b0742012-02-16 13:23:45746 // An event filter that pre-handles key events while the partial
[email protected]a1584a712012-07-30 21:02:26747 // screenshot UI or the keyboard overlay is active.
dchenga94547472016-04-08 08:41:11748 std::unique_ptr<OverlayEventFilter> overlay_filter_;
[email protected]0b0b0742012-02-16 13:23:45749
[email protected]3537d472014-01-15 05:45:31750 // An event filter which handles moving and resizing windows.
dchenga94547472016-04-08 08:41:11751 std::unique_ptr<ToplevelWindowEventHandler> toplevel_window_event_handler_;
[email protected]3537d472014-01-15 05:45:31752
[email protected]435b212e2012-04-05 19:43:37753 // An event filter which handles system level gestures
dchenga94547472016-04-08 08:41:11754 std::unique_ptr<SystemGestureEventFilter> system_gesture_filter_;
[email protected]435b212e2012-04-05 19:43:37755
[email protected]745816be2011-11-22 05:08:30756 // An event filter that pre-handles global accelerators.
dchenga94547472016-04-08 08:41:11757 std::unique_ptr<::wm::AcceleratorFilter> accelerator_filter_;
[email protected]745816be2011-11-22 05:08:30758
rjkroege72f8154f2016-10-29 00:49:02759 std::unique_ptr<display::DisplayManager> display_manager_;
dchenga94547472016-04-08 08:41:11760 std::unique_ptr<DisplayConfigurationController>
761 display_configuration_controller_;
[email protected]6bdf7952012-11-14 10:10:58762
hidehiko6821ca42016-06-18 11:12:23763 std::unique_ptr<ScreenPinningController> screen_pinning_controller_;
[email protected]a9a40462013-07-31 06:22:56764
derat94887a22017-01-20 18:17:25765 // Forwards user activity ui::mojom::UserActivityMonitor to
766 // |user_activity_detector_|. Only initialized for mash.
767 std::unique_ptr<aura::UserActivityForwarder> user_activity_forwarder_;
768
dchenga94547472016-04-08 08:41:11769 std::unique_ptr<PowerEventObserver> power_event_observer_;
770 std::unique_ptr<ui::UserActivityPowerManagerNotifier> user_activity_notifier_;
771 std::unique_ptr<VideoActivityNotifier> video_activity_notifier_;
772 std::unique_ptr<StickyKeysController> sticky_keys_controller_;
773 std::unique_ptr<ResolutionNotificationController>
[email protected]7bc49bd2014-01-22 09:30:34774 resolution_notification_controller_;
dchenga94547472016-04-08 08:41:11775 std::unique_ptr<BluetoothNotificationController>
[email protected]b3142722014-03-04 06:59:50776 bluetooth_notification_controller_;
jamescookac6724332017-03-21 02:54:43777 std::unique_ptr<TrayBluetoothHelper> tray_bluetooth_helper_;
dchenga94547472016-04-08 08:41:11778 std::unique_ptr<VirtualKeyboardController> virtual_keyboard_controller_;
warx533c8f62016-04-12 01:19:43779 std::unique_ptr<chromeos::AudioA11yController> audio_a11y_controller_;
[email protected]70b3e7d52012-06-02 22:12:25780 // Controls video output device state.
kylechar7a067ec2017-01-07 01:16:28781 std::unique_ptr<display::DisplayConfigurator> display_configurator_;
dchenga94547472016-04-08 08:41:11782 std::unique_ptr<DisplayColorManager> display_color_manager_;
783 std::unique_ptr<DisplayErrorObserver> display_error_observer_;
784 std::unique_ptr<ProjectingObserver> projecting_observer_;
[email protected]6bdf7952012-11-14 10:10:58785
[email protected]c1234a42013-08-20 09:35:40786 // Listens for output changes and updates the display manager.
kylecharf2e4e412016-12-04 04:21:35787 std::unique_ptr<display::DisplayChangeObserver> display_change_observer_;
[email protected]3dff2ef2014-02-09 22:50:39788
kylechar98748a52016-12-03 01:33:22789 // Listens for shutdown and updates DisplayConfigurator.
790 std::unique_ptr<ShutdownObserver> shutdown_observer_;
791
yiyix90cfee22017-02-16 05:38:18792 // Listens for new sms messages and shows notifications.
793 std::unique_ptr<SmsObserver> sms_observer_;
794
derat94887a22017-01-20 18:17:25795 // Implements content::ScreenOrientationController for Chrome OS.
dchenga94547472016-04-08 08:41:11796 std::unique_ptr<ScreenOrientationController> screen_orientation_controller_;
yiyixa68ade512016-09-01 17:38:13797 std::unique_ptr<ScreenLayoutObserver> screen_layout_observer_;
jonrossf21fea12014-11-13 01:22:51798
kylechar55f0eaf22017-01-11 22:57:37799 std::unique_ptr<AshTouchTransformController> touch_transformer_controller_;
dnicoara8c3bd1e62014-10-30 19:53:39800
dchenga94547472016-04-08 08:41:11801 std::unique_ptr<ui::EventHandler> magnifier_key_scroll_handler_;
802 std::unique_ptr<ui::EventHandler> speech_feedback_handler_;
sammiequon203ae022016-09-18 17:23:42803 std::unique_ptr<LaserPointerController> laser_pointer_controller_;
804 std::unique_ptr<PartialMagnificationController>
805 partial_magnification_controller_;
Vladislav Kaznacheev6d6aaff2017-07-22 04:06:32806 std::unique_ptr<HighlighterController> highlighter_controller_;
[email protected]70b3e7d52012-06-02 22:12:25807
xdaid4913762017-07-06 00:17:22808 // The split view controller for Chrome OS in tablet mode.
809 std::unique_ptr<SplitViewController> split_view_controller_;
810
[email protected]c0ff0342013-02-27 00:41:29811 // |native_cursor_manager_| is owned by |cursor_manager_|, but we keep a
812 // pointer to vend to test code.
erg36cfb952017-06-21 19:41:45813 NativeCursorManagerAsh* native_cursor_manager_;
[email protected]e76096a5f2014-04-08 04:08:03814
derat94887a22017-01-20 18:17:25815 // Cursor may be hidden on certain key events in Chrome OS, whereas we never
sadrul7a8785e2016-02-12 21:54:35816 // hide the cursor on Windows.
dchenga94547472016-04-08 08:41:11817 std::unique_ptr<::wm::CursorManager> cursor_manager_;
[email protected]4b8003c2012-07-26 00:54:19818
[email protected]852a55d2012-10-17 13:30:30819 // For testing only: simulate that a modal window is open
820 bool simulate_modal_window_open_for_testing_;
821
[email protected]2b8a9bb2013-07-01 22:43:40822 bool is_touch_hud_projection_enabled_;
823
mswad3d9552017-05-18 21:23:36824 // See comment for GetRootWindowForNewWindows().
825 aura::Window* root_window_for_new_windows_ = nullptr;
826 aura::Window* scoped_root_window_for_new_windows_ = nullptr;
sky27344382017-03-08 21:30:32827
[email protected]1d2a7212014-01-16 06:09:48828 // Injected content::GPUDataManager support.
dchenga94547472016-04-08 08:41:11829 std::unique_ptr<GPUSupport> gpu_support_;
[email protected]1d2a7212014-01-16 06:09:48830
skyb7b54092016-08-19 16:00:09831 std::unique_ptr<ImmersiveHandlerFactoryAsh> immersive_handler_factory_;
832
sky15ef0aa2017-01-20 18:55:59833 std::unique_ptr<AppListDelegateImpl> app_list_delegate_impl_;
834
sky00c813f2017-03-08 22:48:55835 base::ObserverList<ShellObserver> shell_observers_;
836
Sam McNallye36abbc2017-07-20 01:04:28837 base::WeakPtrFactory<Shell> weak_factory_;
838
[email protected]87b0d82e2011-10-07 21:02:59839 DISALLOW_COPY_AND_ASSIGN(Shell);
840};
841
[email protected]55f593352011-12-24 05:42:46842} // namespace ash
[email protected]87b0d82e2011-10-07 21:02:59843
[email protected]b65bdda2011-12-23 23:35:31844#endif // ASH_SHELL_H_