blob: e7ef9f1a7a36779b5e9518da8c9903e94e776f84 [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"
James Cook934abaf2017-09-19 22:21:5816#include "ash/wm/cursor_manager_chromeos.h"
[email protected]c0ce80e2012-10-05 23:28:2717#include "ash/wm/system_modal_container_event_filter_delegate.h"
[email protected]b0639282011-12-22 21:12:2718#include "base/gtest_prod_util.h"
avidb567a8a2015-12-20 17:07:2419#include "base/macros.h"
[email protected]6f67df52013-10-29 01:07:1520#include "base/memory/weak_ptr.h"
[email protected]1a2145b2012-03-13 21:09:1721#include "base/observer_list.h"
David Blackb92487842018-03-29 18:45:2822#include "chromeos/chromeos_switches.h"
Alex Newcomer8fdcb9342017-08-08 18:48:4423#include "ui/app_list/app_list_constants.h"
[email protected]c9390bd2013-11-08 20:33:1324#include "ui/aura/window.h"
oshimaf84b0da722016-04-27 19:47:1925#include "ui/display/screen.h"
[email protected]86ccbd42013-09-18 18:11:5426#include "ui/events/event_target.h"
[email protected]ee3ed10772014-03-11 22:02:0127#include "ui/wm/core/cursor_manager.h"
sky27344382017-03-08 21:30:3228#include "ui/wm/public/activation_change_observer.h"
[email protected]87b0d82e2011-10-07 21:02:5929
afakhrye4fae852017-05-09 18:49:0630class PrefRegistrySimple;
tibellb93c729b2017-03-30 00:45:0931class PrefService;
32
[email protected]87b0d82e2011-10-07 21:02:5933namespace aura {
[email protected]35304ce2011-12-14 23:21:0134class RootWindow;
derat94887a22017-01-20 18:17:2535class UserActivityForwarder;
[email protected]87b0d82e2011-10-07 21:02:5936class Window;
skya8b222f2017-01-12 15:47:1337class WindowManagerClient;
sky00f98a372017-01-11 06:03:4938class WindowTreeClient;
Alex Newcomer8fdcb9342017-08-08 18:48:4439} // namespace aura
[email protected]fa4a45832012-04-12 21:32:4840
rjkroege72f8154f2016-10-29 00:49:0241namespace display {
kylecharf2e4e412016-12-04 04:21:3542class DisplayChangeObserver;
kylechar7a067ec2017-01-07 01:16:2843class DisplayConfigurator;
rjkroege72f8154f2016-10-29 00:49:0244class DisplayManager;
Alex Newcomer8fdcb9342017-08-08 18:48:4445} // namespace display
rjkroege72f8154f2016-10-29 00:49:0246
[email protected]2b99f8c2011-10-11 19:42:2447namespace gfx {
sky4ec2be82017-01-06 17:38:3248class Insets;
[email protected]cac10fc62011-10-07 23:22:5649}
[email protected]b6ba05d902013-10-04 21:38:4550
[email protected]a8bd1cb2012-02-17 23:05:5451namespace ui {
Scott Violetc8a1c6c2017-11-29 23:17:3652class ContextFactory;
53class ContextFactoryPrivate;
derat2d4e62d2015-01-09 16:09:1754class UserActivityDetector;
[email protected]b0fa7012014-04-16 12:50:5755class UserActivityPowerManagerNotifier;
Alex Newcomer8fdcb9342017-08-08 18:48:4456} // namespace ui
thanhph3f3968512017-06-21 00:37:2357
[email protected]57b8bb352012-01-11 05:11:4658namespace views {
59class NonClientFrameView;
60class Widget;
[email protected]4a59e4e2012-11-12 21:15:4061namespace corewm {
[email protected]e319c7e2014-03-14 19:56:1462class TooltipController;
63}
Alex Newcomer8fdcb9342017-08-08 18:48:4464} // namespace views
[email protected]e319c7e2014-03-14 19:56:1465
66namespace wm {
[email protected]60d677d2014-05-30 13:07:0267class AcceleratorFilter;
Thiago Farina3b086a02017-05-30 22:32:5068class ActivationClient;
[email protected]4a59e4e2012-11-12 21:15:4069class CompoundEventFilter;
sky27344382017-03-08 21:30:3270class FocusController;
[email protected]86f2b5e2012-11-14 20:37:0071class ShadowController;
[email protected]b5756e22012-11-30 01:32:0272class VisibilityController;
[email protected]0c2dc012012-12-02 00:00:2373class WindowModalityController;
Alex Newcomer8fdcb9342017-08-08 18:48:4474} // namespace wm
[email protected]87b0d82e2011-10-07 21:02:5975
[email protected]55f593352011-12-24 05:42:4676namespace ash {
[email protected]87b0d82e2011-10-07 21:02:5977
sky81a2d792017-03-17 19:14:3978class AcceleratorController;
James Cookec144952017-09-01 00:05:1679class AccessibilityController;
sky07a24d42017-03-09 23:57:3080class AccessibilityDelegate;
Qiang Xua9591002018-03-15 22:29:3181class AccessibilityFocusRingController;
David Blacke8f815042018-03-28 18:59:3782class AshAssistantController;
Scott Violetd64dac12017-06-02 21:50:0883class AshDisplayController;
Jiaquan He4b48f912018-03-01 03:59:3984class AppListControllerImpl;
erg36cfb952017-06-21 19:41:4585class NativeCursorManagerAsh;
sky07a24d42017-03-09 23:57:3086class AshTouchTransformController;
[email protected]55398d22013-10-10 19:49:2087class AutoclickController;
Toni Barzic9d0c82f42017-12-06 00:53:5288class BacklightsForcedOffSetter;
[email protected]b3142722014-03-04 06:59:5089class BluetoothNotificationController;
Sonny Sasaka55f69fc2017-08-28 21:29:3790class BluetoothPowerController;
sky79fa34712017-03-20 23:46:4791class BrightnessControlDelegate;
Tetsui Ohkubo5e2499532018-04-04 02:01:3992class CapsLockNotificationController;
sky79fa34712017-03-20 23:46:4793class CastConfigController;
Toni Barzicd6238312018-03-02 18:26:1394class DetachableBaseHandler;
Toni Barzic550419f2018-03-08 03:56:2195class DetachableBaseNotificationController;
robert.bradfordab052492015-05-06 11:09:5696class DisplayColorManager;
stevenjb537c5c3f2016-01-20 23:38:1297class DisplayConfigurationController;
[email protected]18b21b2e2013-03-01 20:56:2398class DisplayErrorObserver;
Steven Bennetts7683e342018-01-02 21:29:5299class DisplayShutdownObserver;
Ahmed Fakhry4bf3f742018-02-06 17:33:36100class DockedMagnifierController;
[email protected]084b6bb2011-11-17 05:18:16101class DragDropController;
[email protected]e67291f12012-10-10 05:52:38102class EventClientImpl;
[email protected]682990f2013-01-10 06:49:11103class EventTransformationHandler;
sky79fa34712017-03-20 23:46:47104class FocusCycler;
[email protected]093b8d642014-04-03 20:59:28105class 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;
sky79fa34712017-03-20 23:46:47113class LocaleNotificationController;
[email protected]093b8d642014-04-03 20:59:28114class LockStateController;
sky79fa34712017-03-20 23:46:47115class LogoutConfirmationController;
Jacob Dufaultffd9b0d2017-11-15 23:07:16116class LoginScreenController;
[email protected]093b8d642014-04-03 20:59:28117class MagnificationController;
Mitsuru Oshima0e9b7a62017-07-19 18:23:03118class TabletModeController;
sky5ab16472017-03-21 19:35:08119class MediaController;
Evan Stade2c43a87b32017-08-31 17:53:10120class MessageCenterController;
[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;
Vladislav Kaznacheev92edf62e2017-10-13 22:08:01125class NoteTakingController;
[email protected]9ae32df2012-07-26 03:25:18126class OverlayEventFilter;
[email protected]093b8d642014-04-03 20:59:28127class PartialMagnificationController;
Sammie Quon95c6a1c2017-09-12 19:16:55128class PeripheralBatteryNotifier;
Qiang Xud77a90c2018-02-20 19:43:29129class PersistentWindowController;
[email protected]093b8d642014-04-03 20:59:28130class PowerButtonController;
[email protected]51625052013-10-10 01:40:16131class PowerEventObserver;
Qiang Xu36234e532018-04-11 04:54:02132class PowerPrefs;
[email protected]72bce522014-02-10 21:11:26133class ProjectingObserver;
[email protected]e4a181cc2012-03-17 02:20:57134class ResizeShadowController;
[email protected]6ef71d72013-08-10 18:13:44135class ResolutionNotificationController;
[email protected]d90b8392012-06-13 09:34:56136class RootWindowController;
sky11cf8db92017-04-10 23:38:08137class ShellPort;
jamescookac6724332017-03-21 02:54:43138class ScreenLayoutObserver;
jonross0af45212015-01-13 18:55:46139class ScreenOrientationController;
oshima5a296e82016-04-29 01:32:27140class ScreenshotController;
hidehiko6821ca42016-06-18 11:12:23141class ScreenPinningController;
[email protected]8d625fb2012-07-18 16:40:06142class ScreenPositionController;
Tetsui Ohkubo3a92f0d92018-03-30 18:33:29143class ScreenSecurityNotificationController;
sky5ad143a2017-03-22 04:31:23144class SessionController;
sky5ad143a2017-03-22 04:31:23145class ShelfController;
sky5ad143a2017-03-22 04:31:23146class ShelfModel;
147class ShelfWindowWatcher;
skyb073203a2017-03-13 16:59:16148class ShellDelegate;
[email protected]1b4c7472014-05-15 18:32:23149struct ShellInitParams;
sky00c813f2017-03-08 22:48:55150class ShellObserver;
sky5b45ed82017-03-27 02:54:23151class ShutdownController;
yiyix90cfee22017-02-16 05:38:18152class SmsObserver;
xdaid4913762017-07-06 00:17:22153class SplitViewController;
[email protected]093b8d642014-04-03 20:59:28154class StickyKeysController;
[email protected]9ae32df2012-07-26 03:25:18155class SystemGestureEventFilter;
[email protected]c0ce80e2012-10-05 23:28:27156class SystemModalContainerEventFilter;
[email protected]093b8d642014-04-03 20:59:28157class SystemTray;
sky79fa34712017-03-20 23:46:47158class SystemTrayController;
Tetsui Ohkubo21722932018-03-02 02:56:56159class SystemTrayModel;
sky5b45ed82017-03-27 02:54:23160class SystemTrayNotifier;
Scott Violet3c554ae2017-12-13 02:25:41161class TimeToFirstPresentRecorder;
[email protected]093b8d642014-04-03 20:59:28162class ToplevelWindowEventHandler;
sky07a24d42017-03-09 23:57:30163class ToastManager;
Qiang Xuf1400a362017-09-14 02:28:30164class TouchDevicesController;
tbarzicc78da1ff92017-05-08 20:46:15165class TrayAction;
jamescookac6724332017-03-21 02:54:43166class TrayBluetoothHelper;
bsheeaae09a2014-09-22 23:16:52167class VirtualKeyboardController;
[email protected]ded58fd2013-10-09 07:56:55168class VideoActivityNotifier;
[email protected]093b8d642014-04-03 20:59:28169class VideoDetector;
Yue Lia33960a2017-11-01 22:06:07170class VoiceInteractionController;
sky5b45ed82017-03-27 02:54:23171class VpnList;
sky07a24d42017-03-09 23:57:30172class WallpaperController;
[email protected]093b8d642014-04-03 20:59:28173class WebNotificationTray;
sky5b45ed82017-03-27 02:54:23174class WindowCycleController;
[email protected]093b8d642014-04-03 20:59:28175class WindowPositioner;
sky5b45ed82017-03-27 02:54:23176class WindowSelectorController;
msw607227f82016-08-30 17:22:39177class WindowTreeHostManager;
[email protected]2b99f8c2011-10-11 19:42:24178
sky494c6cbd2017-03-27 20:57:48179enum class Config;
180enum class LoginStatus;
181
[email protected]87b0d82e2011-10-07 21:02:59182// Shell is a singleton object that presents the Shell API and implements the
[email protected]99f07e02011-12-07 00:02:59183// RootWindow's delegate interface.
[email protected]b0079a92012-01-25 20:13:38184//
185// Upon creation, the Shell sets itself as the RootWindow's delegate, which
186// takes ownership of the Shell.
Xiyuan Xia22b1a6c2017-04-18 22:46:01187class ASH_EXPORT Shell : public SessionObserver,
sky5ad143a2017-03-22 04:31:23188 public SystemModalContainerEventFilterDelegate,
sky27344382017-03-08 21:30:32189 public ui::EventTarget,
Thiago Farina3b086a02017-05-30 22:32:50190 public ::wm::ActivationChangeObserver {
[email protected]87b0d82e2011-10-07 21:02:59191 public:
[email protected]093b8d642014-04-03 20:59:28192 typedef std::vector<RootWindowController*> RootWindowControllerList;
[email protected]be65be362012-06-15 07:38:23193
Scott Violetc8a1c6c2017-11-29 23:17:36194 // Creates the single Shell instance.
195 static Shell* CreateInstance(ShellInitParams init_params);
[email protected]3266c2b92011-11-14 00:06:08196
197 // Should never be called before |CreateInstance()|.
skyb073203a2017-03-13 16:59:16198 static Shell* Get();
[email protected]3266c2b92011-11-14 00:06:08199
[email protected]b3b7bcd2012-03-06 19:35:45200 // Returns true if the ash shell has been instantiated.
201 static bool HasInstance();
202
[email protected]ef589af2011-12-03 01:07:15203 static void DeleteInstance();
[email protected]cac10fc62011-10-07 23:22:56204
[email protected]d90b8392012-06-13 09:34:56205 // Returns the root window controller for the primary root window.
[email protected]a0afeb12012-12-10 22:57:09206 // TODO(oshima): move this to |RootWindowController|
[email protected]093b8d642014-04-03 20:59:28207 static RootWindowController* GetPrimaryRootWindowController();
[email protected]d90b8392012-06-13 09:34:56208
thanhphc90f49ca2017-03-03 17:48:53209 // Returns the RootWindowController for the given display id. If there
210 // is no display for |display_id|, null is returned.
211 static RootWindowController* GetRootWindowControllerWithDisplayId(
212 int64_t display_id);
213
Scott Violet596bb46342017-06-21 14:43:13214 // Returns the root Window for the given display id. If there is no display
215 // for |display_id| null is returned.
216 static aura::Window* GetRootWindowForDisplayId(int64_t display_id);
217
[email protected]cf1c70e2012-08-30 01:13:02218 // Returns all root window controllers.
[email protected]a0afeb12012-12-10 22:57:09219 // TODO(oshima): move this to |RootWindowController|
[email protected]be65be362012-06-15 07:38:23220 static RootWindowControllerList GetAllRootWindowControllers();
221
[email protected]bf9cdb362013-10-25 19:22:45222 // Returns the primary root Window. The primary root Window is the one that
223 // has a launcher.
224 static aura::Window* GetPrimaryRootWindow();
[email protected]e73bd7802012-02-17 20:10:34225
sky27344382017-03-08 21:30:32226 // Returns the root window that newly created windows should be added to.
227 // Value can be temporarily overridden using ScopedRootWindowForNewWindows.
228 // NOTE: this returns the root, newly created window should be added to the
229 // appropriate container in the returned window.
230 static aura::Window* GetRootWindowForNewWindows();
mfomitcheva1a8aa62016-05-03 16:23:26231
[email protected]cf1c70e2012-08-30 01:13:02232 // Returns all root windows.
[email protected]c9390bd2013-11-08 20:33:13233 static aura::Window::Windows GetAllRootWindows();
[email protected]be65be362012-06-15 07:38:23234
[email protected]bf9cdb362013-10-25 19:22:45235 static aura::Window* GetContainer(aura::Window* root_window,
[email protected]7b0f7502012-06-11 00:12:39236 int container_id);
[email protected]bf9cdb362013-10-25 19:22:45237 static const aura::Window* GetContainer(const aura::Window* root_window,
[email protected]e67291f12012-10-10 05:52:38238 int container_id);
[email protected]7b0f7502012-06-11 00:12:39239
James Cook7b7c6a52018-01-04 23:40:03240 // If a system-modal dialog window is currently open, returns the ID of the
241 // system modal window container that contains the window.
242 // If no system-modal dialogs are open it returns -1.
243 static int GetOpenSystemModalWindowContainerId();
244
245 // Returns true if a system-modal dialog window is currently open.
246 static bool IsSystemModalWindowOpen();
247
skya8b222f2017-01-12 15:47:13248 // TODO(sky): move this and WindowManagerClient into ShellMash that is owned
249 // by Shell. Doing the move is gated on having mash create Shell.
sky00f98a372017-01-11 06:03:49250 static void set_window_tree_client(aura::WindowTreeClient* client) {
251 window_tree_client_ = client;
252 }
253
254 static aura::WindowTreeClient* window_tree_client() {
255 return window_tree_client_;
256 }
257
skya8b222f2017-01-12 15:47:13258 static void set_window_manager_client(aura::WindowManagerClient* client) {
259 window_manager_client_ = client;
260 }
261 static aura::WindowManagerClient* window_manager_client() {
262 return window_manager_client_;
263 }
264
jamescook0dfe5632017-04-05 18:49:02265 static Config GetAshConfig();
moshayedic229a522017-05-05 18:14:26266 static bool ShouldUseIMEService();
sky494c6cbd2017-03-27 20:57:48267
Wenzhao Zang56c292932017-08-02 04:58:34268 // Registers all ash related local state prefs to the given |registry|.
269 static void RegisterLocalStatePrefs(PrefRegistrySimple* registry);
270
Qiang Xu36234e532018-04-11 04:54:02271 // Registers all ash related signin/user profile prefs to the given
272 // |registry|. Can be called before Shell is initialized. When |for_test| is
273 // true this registers foreign user profile prefs (e.g. chrome prefs) as if
274 // they are owned by ash. This allows test code to read the pref values.
275 static void RegisterSigninProfilePrefs(PrefRegistrySimple* registry,
276 bool for_test = false);
277 static void RegisterUserProfilePrefs(PrefRegistrySimple* registry,
278 bool for_test = false);
afakhrye4fae852017-05-09 18:49:06279
[email protected]57b8bb352012-01-11 05:11:46280 // Creates a default views::NonClientFrameView for use by windows in the
281 // Ash environment.
282 views::NonClientFrameView* CreateDefaultNonClientFrameView(
283 views::Widget* widget);
284
mswad28b252016-08-09 02:42:07285 // Sets work area insets of the display containing |window|, pings observers.
[email protected]2e236a52012-06-27 22:21:47286 void SetDisplayWorkAreaInsets(aura::Window* window,
[email protected]8a45c972012-03-14 18:22:44287 const gfx::Insets& insets);
[email protected]1a2145b2012-03-13 21:09:17288
[email protected]58868abf2014-01-17 23:45:33289 // Called when a casting session is started or stopped.
290 void OnCastingSessionStartedOrStopped(bool started);
291
[email protected]0e3e7cb2014-04-12 05:18:25292 // Called when a root window is created.
varkhac71444e52017-05-25 22:51:34293 void OnRootWindowAdded(aura::Window* root_window);
[email protected]0e3e7cb2014-04-12 05:18:25294
Keigo Okae82281a2017-06-14 13:59:14295 // Creates a keyboard controller and associate it with the primary root window
296 // controller. Destroys the old keyboard controller if it already exists.
[email protected]51f438112013-11-18 19:32:50297 void CreateKeyboard();
298
Keigo Okac7617a42017-06-14 11:33:24299 // Destroys the virtual keyboard.
300 void DestroyKeyboard();
[email protected]e1b299b2014-01-29 23:53:41301
Mitsuru Oshima0e9b7a62017-07-19 18:23:03302 // Test if TabletModeWindowManager is not enabled, and if
303 // TabletModeController is not currently setting a display rotation. Or if
[email protected]da285852014-05-27 19:53:43304 // the |resolution_notification_controller_| is not showing its confirmation
305 // dialog. If true then changes to display settings can be saved.
306 bool ShouldSaveDisplaySettings();
[email protected]da285852014-05-27 19:53:43307
sky81a2d792017-03-17 19:14:39308 AcceleratorController* accelerator_controller() {
309 return accelerator_controller_.get();
sky44a09892016-07-20 17:46:58310 }
James Cookec144952017-09-01 00:05:16311 AccessibilityController* accessibility_controller() {
312 return accessibility_controller_.get();
313 }
sky07a24d42017-03-09 23:57:30314 AccessibilityDelegate* accessibility_delegate() {
315 return accessibility_delegate_.get();
316 }
Qiang Xua9591002018-03-15 22:29:31317 AccessibilityFocusRingController* accessibility_focus_ring_controller() {
318 return accessibility_focus_ring_controller_.get();
319 }
Qiang Xuf1400a362017-09-14 02:28:30320 ::wm::ActivationClient* activation_client();
Jiaquan He4b48f912018-03-01 03:59:39321 AppListControllerImpl* app_list_controller() {
322 return app_list_controller_.get();
323 }
David Blacke8f815042018-03-28 18:59:37324 AshAssistantController* ash_assistant_controller() {
David Blackb92487842018-03-29 18:45:28325 DCHECK(chromeos::switches::IsAssistantEnabled());
David Blacke8f815042018-03-28 18:59:37326 return ash_assistant_controller_.get();
327 }
Scott Violetd64dac12017-06-02 21:50:08328 AshDisplayController* ash_display_controller() {
329 return ash_display_controller_.get();
330 }
Qiang Xuf1400a362017-09-14 02:28:30331 AutoclickController* autoclick_controller() {
332 return autoclick_controller_.get();
333 }
Daniel Erat477c56d2017-12-13 21:42:54334 BacklightsForcedOffSetter* backlights_forced_off_setter() {
335 return backlights_forced_off_setter_.get();
336 }
Qiang Xuf1400a362017-09-14 02:28:30337 BluetoothPowerController* bluetooth_power_controller() {
338 return bluetooth_power_controller_.get();
339 }
sky79fa34712017-03-20 23:46:47340 BrightnessControlDelegate* brightness_control_delegate() {
341 return brightness_control_delegate_.get();
342 }
343 CastConfigController* cast_config() { return cast_config_.get(); }
Steven Bennettsa866fca2017-11-07 19:39:35344
345 // Returns nullptr in mash which has no global cursor manager.
Qiang Xuf1400a362017-09-14 02:28:30346 ::wm::CursorManager* cursor_manager() { return cursor_manager_.get(); }
Steven Bennettsa866fca2017-11-07 19:39:35347
Toni Barzicd6238312018-03-02 18:26:13348 DetachableBaseHandler* detachable_base_handler() {
349 return detachable_base_handler_.get();
350 }
351
rjkroege72f8154f2016-10-29 00:49:02352 display::DisplayManager* display_manager() { return display_manager_.get(); }
stevenjb537c5c3f2016-01-20 23:38:12353 DisplayConfigurationController* display_configuration_controller() {
354 return display_configuration_controller_.get();
355 }
Qiang Xuf1400a362017-09-14 02:28:30356
357 // TODO(oshima): Move these objects to WindowTreeHostManager.
358 display::DisplayConfigurator* display_configurator() {
359 return display_configurator_.get();
360 }
361 DisplayErrorObserver* display_error_observer() {
362 return display_error_observer_.get();
363 }
364
Ahmed Fakhry4bf3f742018-02-06 17:33:36365 DockedMagnifierController* docked_magnifier_controller();
jamescookb8dcef522016-06-25 14:42:55366 ::wm::CompoundEventFilter* env_filter() { return env_filter_.get(); }
Qiang Xuf1400a362017-09-14 02:28:30367 EventClientImpl* event_client() { return event_client_.get(); }
368 EventTransformationHandler* event_transformation_handler() {
369 return event_transformation_handler_.get();
370 }
sky79fa34712017-03-20 23:46:47371 FocusCycler* focus_cycler() { return focus_cycler_.get(); }
Qiang Xuf1400a362017-09-14 02:28:30372 HighlighterController* highlighter_controller() {
373 return highlighter_controller_.get();
374 }
375 HighContrastController* high_contrast_controller() {
376 return high_contrast_controller_.get();
377 }
James Cookf0c78fc2017-06-15 14:42:55378 ImeController* ime_controller() { return ime_controller_.get(); }
sky79fa34712017-03-20 23:46:47379 KeyboardBrightnessControlDelegate* keyboard_brightness_control_delegate() {
380 return keyboard_brightness_control_delegate_.get();
381 }
382 KeyboardUI* keyboard_ui() { return keyboard_ui_.get(); }
Qiang Xuf1400a362017-09-14 02:28:30383 LaserPointerController* laser_pointer_controller() {
384 return laser_pointer_controller_.get();
385 }
sky79fa34712017-03-20 23:46:47386 LocaleNotificationController* locale_notification_controller() {
387 return locale_notification_controller_.get();
388 }
Jacob Dufaultffd9b0d2017-11-15 23:07:16389 LoginScreenController* login_screen_controller() {
390 return login_screen_controller_.get();
xiaoyinh2bbdd102017-05-18 23:29:42391 }
Qiang Xuf1400a362017-09-14 02:28:30392 LockStateController* lock_state_controller() {
393 return lock_state_controller_.get();
394 }
395 LogoutConfirmationController* logout_confirmation_controller() {
396 return logout_confirmation_controller_.get();
397 }
398 MagnificationController* magnification_controller() {
399 return magnification_controller_.get();
400 }
sky5ab16472017-03-21 19:35:08401 MediaController* media_controller() { return media_controller_.get(); }
Evan Stade04c18d02017-10-20 20:53:22402 MessageCenterController* message_center_controller() {
403 return message_center_controller_.get();
404 }
Qiang Xuf1400a362017-09-14 02:28:30405 MouseCursorEventFilter* mouse_cursor_filter() {
406 return mouse_cursor_filter_.get();
407 }
sky5ab16472017-03-21 19:35:08408 MruWindowTracker* mru_window_tracker() { return mru_window_tracker_.get(); }
409 NewWindowController* new_window_controller() {
410 return new_window_controller_.get();
411 }
afakhry9e0a18b32017-06-05 19:23:14412 NightLightController* night_light_controller();
Vladislav Kaznacheev92edf62e2017-10-13 22:08:01413 NoteTakingController* note_taking_controller() {
414 return note_taking_controller_.get();
415 }
Qiang Xuf1400a362017-09-14 02:28:30416 OverlayEventFilter* overlay_filter() { return overlay_filter_.get(); }
Qiang Xuf1400a362017-09-14 02:28:30417 PartialMagnificationController* partial_magnification_controller() {
418 return partial_magnification_controller_.get();
419 }
420 PowerButtonController* power_button_controller() {
421 return power_button_controller_.get();
422 }
423 PowerEventObserver* power_event_observer() {
424 return power_event_observer_.get();
425 }
426 ResizeShadowController* resize_shadow_controller() {
427 return resize_shadow_controller_.get();
428 }
429 ResolutionNotificationController* resolution_notification_controller() {
430 return resolution_notification_controller_.get();
431 }
432 ScreenshotController* screenshot_controller() {
433 return screenshot_controller_.get();
434 }
435 ScreenLayoutObserver* screen_layout_observer() {
436 return screen_layout_observer_.get();
437 }
438 ScreenOrientationController* screen_orientation_controller() {
439 return screen_orientation_controller_.get();
440 }
441 ScreenPinningController* screen_pinning_controller() {
442 return screen_pinning_controller_.get();
443 }
sky5ad143a2017-03-22 04:31:23444 SessionController* session_controller() { return session_controller_.get(); }
445 ShelfController* shelf_controller() { return shelf_controller_.get(); }
sky5ad143a2017-03-22 04:31:23446 ShelfModel* shelf_model();
Qiang Xuf1400a362017-09-14 02:28:30447 ShellDelegate* shell_delegate() { return shell_delegate_.get(); }
sky5b45ed82017-03-27 02:54:23448 ShutdownController* shutdown_controller() {
449 return shutdown_controller_.get();
450 }
Qiang Xuf1400a362017-09-14 02:28:30451 SplitViewController* split_view_controller() {
452 return split_view_controller_.get();
453 }
454 StickyKeysController* sticky_keys_controller() {
455 return sticky_keys_controller_.get();
456 }
sky79fa34712017-03-20 23:46:47457 SystemTrayController* system_tray_controller() {
458 return system_tray_controller_.get();
459 }
Tetsui Ohkubo21722932018-03-02 02:56:56460 SystemTrayModel* system_tray_model() { return system_tray_model_.get(); }
sky5b45ed82017-03-27 02:54:23461 SystemTrayNotifier* system_tray_notifier() {
462 return system_tray_notifier_.get();
463 }
Sammie Quona6f96402017-08-24 01:08:37464 TabletModeController* tablet_mode_controller() {
465 return tablet_mode_controller_.get();
466 }
Scott Violet3c554ae2017-12-13 02:25:41467 TimeToFirstPresentRecorder* time_to_first_present_recorder() {
468 return time_to_first_present_recorder_.get();
469 }
Qiang Xuf1400a362017-09-14 02:28:30470 ToastManager* toast_manager() { return toast_manager_.get(); }
[email protected]a1b7a822013-02-23 19:08:04471 views::corewm::TooltipController* tooltip_controller() {
[email protected]862deef2011-12-15 22:07:33472 return tooltip_controller_.get();
[email protected]4a229e902011-12-01 21:21:11473 }
Qiang Xuf1400a362017-09-14 02:28:30474 TouchDevicesController* touch_devices_controller() {
475 return touch_devices_controller_.get();
chirantan40e4cd82015-02-19 01:08:19476 }
kylechar55f0eaf22017-01-11 22:57:37477 AshTouchTransformController* touch_transformer_controller() {
[email protected]03122891a2014-05-13 23:56:49478 return touch_transformer_controller_.get();
479 }
Qiang Xuf1400a362017-09-14 02:28:30480 TrayAction* tray_action() { return tray_action_.get(); }
481 TrayBluetoothHelper* tray_bluetooth_helper() {
482 return tray_bluetooth_helper_.get();
sammiequon203ae022016-09-18 17:23:42483 }
Evan Stade04c18d02017-10-20 20:53:22484 UserMetricsRecorder* metrics() { return user_metrics_recorder_.get(); }
Qiang Xuf1400a362017-09-14 02:28:30485 VideoDetector* video_detector() { return video_detector_.get(); }
486 VirtualKeyboardController* virtual_keyboard_controller() {
487 return virtual_keyboard_controller_.get();
sammiequon203ae022016-09-18 17:23:42488 }
Yue Lia33960a2017-11-01 22:06:07489 VoiceInteractionController* voice_interaction_controller() {
490 return voice_interaction_controller_.get();
491 }
Qiang Xuf1400a362017-09-14 02:28:30492 VpnList* vpn_list() { return vpn_list_.get(); }
493 WallpaperController* wallpaper_controller() {
494 return wallpaper_controller_.get();
Vladislav Kaznacheev6d6aaff2017-07-22 04:06:32495 }
Qiang Xuf1400a362017-09-14 02:28:30496 WindowCycleController* window_cycle_controller() {
497 return window_cycle_controller_.get();
mukai19274bdd2015-02-24 22:37:48498 }
Qiang Xuf1400a362017-09-14 02:28:30499 WindowPositioner* window_positioner() { return window_positioner_.get(); }
500 WindowSelectorController* window_selector_controller() {
501 return window_selector_controller_.get();
[email protected]8b7ba87b2012-09-01 00:40:40502 }
Qiang Xuf1400a362017-09-14 02:28:30503 WindowTreeHostManager* window_tree_host_manager() {
504 return window_tree_host_manager_.get();
[email protected]682990f2013-01-10 06:49:11505 }
[email protected]77f7c132012-11-15 06:52:54506
Mitsuru Oshima89e5c1352018-01-17 07:29:39507 ToplevelWindowEventHandler* toplevel_window_event_handler() {
508 return toplevel_window_event_handler_.get();
509 }
510
[email protected]c758fbf2012-03-25 22:53:59511 // Force the shelf to query for it's current visibility state.
jamescook6afad6d2016-06-01 00:35:01512 // TODO(jamescook): Move to Shelf.
[email protected]c758fbf2012-03-25 22:53:59513 void UpdateShelfVisibility();
514
[email protected]88d71122012-10-18 07:11:01515 // Returns WebNotificationTray on the primary root window.
516 WebNotificationTray* GetWebNotificationTray();
[email protected]6d6546e2012-05-30 23:12:02517
[email protected]a0afeb12012-12-10 22:57:09518 // Does the primary display have status area?
519 bool HasPrimaryStatusArea();
520
521 // Returns the system tray on primary display.
522 SystemTray* GetPrimarySystemTray();
[email protected]bfb411312012-02-27 20:59:27523
[email protected]f9466702012-09-17 16:35:27524 // Starts the animation that occurs on first login.
525 void DoInitialWorkspaceAnimation();
526
sky27344382017-03-08 21:30:32527 // NOTE: Prefer ScopedRootWindowForNewWindows when setting temporarily.
mswad3d9552017-05-18 21:23:36528 void set_root_window_for_new_windows(aura::Window* root) {
sky27344382017-03-08 21:30:32529 root_window_for_new_windows_ = root;
530 }
531
yawanodc5533b32017-02-23 11:04:38532 void SetLargeCursorSizeInDip(int large_cursor_size_in_dip);
533
Weidong Guod07448f2017-10-18 03:35:18534 // Updates cursor compositing on/off. Native cursor is disabled when cursor
[email protected]87ec2202014-02-06 06:24:27535 // compositing is enabled, and vice versa.
Weidong Guod07448f2017-10-18 03:35:18536 void UpdateCursorCompositingEnabled();
[email protected]87ec2202014-02-06 06:24:27537
Weidong Guod07448f2017-10-18 03:35:18538 // Force setting compositing on/off without checking dependency.
539 void SetCursorCompositingEnabled(bool enabled);
xdaid4913762017-07-06 00:17:22540
541 // Returns true if split view mode is active.
542 bool IsSplitViewModeActive() const;
543
sky00c813f2017-03-08 22:48:55544 void AddShellObserver(ShellObserver* observer);
545 void RemoveShellObserver(ShellObserver* observer);
546
sky5ad143a2017-03-22 04:31:23547 // Called when the login status changes.
548 // TODO(oshima): Investigate if we can merge this and |OnLoginStateChanged|.
549 void UpdateAfterLoginStatusChange(LoginStatus status);
550
sky00c813f2017-03-08 22:48:55551 // Notifies observers that overview mode is about to be started (before the
552 // windows get re-arranged).
553 void NotifyOverviewModeStarting();
554
Xiaoqian Daifb4698ed2018-02-23 20:11:06555 // Notifies observers that overview mode is about to end (bofore the windows
556 // restore themselves).
557 void NotifyOverviewModeEnding();
558
sky00c813f2017-03-08 22:48:55559 // Notifies observers that overview mode has ended.
560 void NotifyOverviewModeEnded();
561
xdaid4913762017-07-06 00:17:22562 // Notifies observers that split view mode is about to be started (before the
563 // window gets snapped and activated).
564 void NotifySplitViewModeStarting();
565
Xiaoqian Daibf3771f2018-03-13 18:21:46566 // Notifies observers that split view mode has been started.
567 void NotifySplitViewModeStarted();
568
xdaid4913762017-07-06 00:17:22569 // Notifies observers that split view mode has ended.
570 void NotifySplitViewModeEnded();
571
sky00c813f2017-03-08 22:48:55572 // Notifies observers that fullscreen mode has changed for |root_window|.
varkhac71444e52017-05-25 22:51:34573 void NotifyFullscreenStateChanged(bool is_fullscreen,
574 aura::Window* root_window);
sky00c813f2017-03-08 22:48:55575
576 // Notifies observers that |pinned_window| changed its pinned window state.
varkha19d7e6c52017-05-25 21:15:30577 void NotifyPinnedStateChanged(aura::Window* pinned_window);
sky00c813f2017-03-08 22:48:55578
579 // Notifies observers that the virtual keyboard has been
xiyuan38160182017-03-14 22:50:13580 // activated/deactivated for |root_window|.
sky97f9a7432017-05-09 05:14:31581 void NotifyVirtualKeyboardActivated(bool activated,
582 aura::Window* root_window);
sky00c813f2017-03-08 22:48:55583
584 // Notifies observers that the shelf was created for |root_window|.
585 // TODO(jamescook): Move to Shelf.
varkha6b016b0f2017-05-26 16:14:18586 void NotifyShelfCreatedForRootWindow(aura::Window* root_window);
sky00c813f2017-03-08 22:48:55587
588 // Notifies observers that |root_window|'s shelf changed alignment.
589 // TODO(jamescook): Move to Shelf.
varkha6b016b0f2017-05-26 16:14:18590 void NotifyShelfAlignmentChanged(aura::Window* root_window);
sky00c813f2017-03-08 22:48:55591
592 // Notifies observers that |root_window|'s shelf changed auto-hide behavior.
593 // TODO(jamescook): Move to Shelf.
varkha6b016b0f2017-05-26 16:14:18594 void NotifyShelfAutoHideBehaviorChanged(aura::Window* root_window);
sky00c813f2017-03-08 22:48:55595
jamescook518dccbd2017-05-18 04:57:07596 // Used to provide better error messages for Shell::Get() under mash.
597 static void SetIsBrowserProcessWithMash();
598
muyuanlid766f2e2017-06-26 20:17:19599 void NotifyAppListVisibilityChanged(bool visible, aura::Window* root_window);
600
[email protected]2b4cd302012-02-24 20:21:13601 private:
[email protected]c39be8f2012-06-15 22:58:36602 FRIEND_TEST_ALL_PREFIXES(ExtendedDesktopTest, TestCursor);
[email protected]1aad3322012-06-06 06:37:09603 FRIEND_TEST_ALL_PREFIXES(WindowManagerTest, MouseEventCursors);
604 FRIEND_TEST_ALL_PREFIXES(WindowManagerTest, TransformActivate);
sky79fa34712017-03-20 23:46:47605 friend class AcceleratorControllerTest;
Sam McNallya853cd82017-08-30 01:55:10606 friend class AshTestHelper;
[email protected]093b8d642014-04-03 20:59:28607 friend class RootWindowController;
sky27344382017-03-08 21:30:32608 friend class ScopedRootWindowForNewWindows;
James Cook317781a2017-07-18 02:08:06609 friend class ShellTestApi;
sky27344382017-03-08 21:30:32610 friend class SmsObserverTest;
[email protected]ad0c8722012-03-02 20:17:45611
skyb073203a2017-03-13 16:59:16612 Shell(std::unique_ptr<ShellDelegate> shell_delegate,
sky11cf8db92017-04-10 23:38:08613 std::unique_ptr<ShellPort> shell_port);
dcheng1f4538e2014-10-27 23:57:05614 ~Shell() override;
[email protected]3266c2b92011-11-14 00:06:08615
Scott Violetc8a1c6c2017-11-29 23:17:36616 void Init(ui::ContextFactory* context_factory,
617 ui::ContextFactoryPrivate* context_factory_private);
[email protected]b0639282011-12-22 21:12:27618
Steven Bennetts7683e342018-01-02 21:29:52619 // Initializes the display manager and related components.
620 void InitializeDisplayManager();
621
[email protected]a273d33a2013-10-17 12:41:21622 // Initializes the root window so that it can host browser windows.
[email protected]41baaed2013-11-09 04:18:26623 void InitRootWindow(aura::Window* root_window);
[email protected]d90b8392012-06-13 09:34:56624
skyabcae812017-01-18 17:01:34625 // Destroys all child windows including widgets across all roots.
626 void CloseAllRootWindowChildWindows();
627
hariank0dd03dd2016-07-14 23:47:33628 // SystemModalContainerEventFilterDelegate:
dcheng1f4538e2014-10-27 23:57:05629 bool CanWindowReceiveEvents(aura::Window* window) override;
[email protected]c0ce80e2012-10-05 23:28:27630
[email protected]5097e692012-10-30 22:08:41631 // Overridden from ui::EventTarget:
dcheng1f4538e2014-10-27 23:57:05632 bool CanAcceptEvent(const ui::Event& event) override;
633 EventTarget* GetParentTarget() override;
dchenga94547472016-04-08 08:41:11634 std::unique_ptr<ui::EventTargetIterator> GetChildIterator() const override;
dcheng1f4538e2014-10-27 23:57:05635 ui::EventTargeter* GetEventTargeter() override;
[email protected]5097e692012-10-30 22:08:41636
Thiago Farina3b086a02017-05-30 22:32:50637 // wm::ActivationChangeObserver:
sky27344382017-03-08 21:30:32638 void OnWindowActivated(ActivationReason reason,
639 aura::Window* gained_active,
640 aura::Window* lost_active) override;
641
Xiyuan Xia22b1a6c2017-04-18 22:46:01642 // SessionObserver:
Xiyuan Xiab64fd0a2017-04-13 17:53:14643 void OnSessionStateChanged(session_manager::SessionState state) override;
644 void OnLoginStatusChanged(LoginStatus login_status) override;
645 void OnLockStateChanged(bool locked) override;
sky5ad143a2017-03-22 04:31:23646
Sam McNallyf4dab612017-08-16 03:06:33647 // Callback for prefs::ConnectToPrefService.
Sam McNallye36abbc2017-07-20 01:04:28648 void OnLocalStatePrefServiceInitialized(
649 std::unique_ptr<::PrefService> pref_service);
tibellb93c729b2017-03-30 00:45:09650
[email protected]cac10fc62011-10-07 23:22:56651 static Shell* instance_;
652
sky00f98a372017-01-11 06:03:49653 // Only valid in mash, for classic ash this is null.
654 static aura::WindowTreeClient* window_tree_client_;
skya8b222f2017-01-12 15:47:13655 static aura::WindowManagerClient* window_manager_client_;
sky00f98a372017-01-11 06:03:49656
sky11cf8db92017-04-10 23:38:08657 std::unique_ptr<ShellPort> shell_port_;
sky984c1892016-04-20 00:00:34658
[email protected]1aad3322012-06-06 06:37:09659 // The CompoundEventFilter owned by aura::Env object.
dchenga94547472016-04-08 08:41:11660 std::unique_ptr<::wm::CompoundEventFilter> env_filter_;
[email protected]627a62f2012-02-14 22:59:14661
dchenga94547472016-04-08 08:41:11662 std::unique_ptr<UserMetricsRecorder> user_metrics_recorder_;
dchenga94547472016-04-08 08:41:11663 std::unique_ptr<WindowPositioner> window_positioner_;
[email protected]2b99f8c2011-10-11 19:42:24664
sky81a2d792017-03-17 19:14:39665 std::unique_ptr<AcceleratorController> accelerator_controller_;
James Cookec144952017-09-01 00:05:16666 std::unique_ptr<AccessibilityController> accessibility_controller_;
sky07a24d42017-03-09 23:57:30667 std::unique_ptr<AccessibilityDelegate> accessibility_delegate_;
Qiang Xua9591002018-03-15 22:29:31668 std::unique_ptr<AccessibilityFocusRingController>
669 accessibility_focus_ring_controller_;
Jiaquan He4b48f912018-03-01 03:59:39670 std::unique_ptr<AppListControllerImpl> app_list_controller_;
David Blacke8f815042018-03-28 18:59:37671 std::unique_ptr<AshAssistantController> ash_assistant_controller_;
Scott Violetd64dac12017-06-02 21:50:08672 std::unique_ptr<AshDisplayController> ash_display_controller_;
Toni Barzic9d0c82f42017-12-06 00:53:52673 std::unique_ptr<BacklightsForcedOffSetter> backlights_forced_off_setter_;
sky79fa34712017-03-20 23:46:47674 std::unique_ptr<BrightnessControlDelegate> brightness_control_delegate_;
Tetsui Ohkubo5e2499532018-04-04 02:01:39675 std::unique_ptr<CapsLockNotificationController>
676 caps_lock_notification_controller_;
sky79fa34712017-03-20 23:46:47677 std::unique_ptr<CastConfigController> cast_config_;
Toni Barzicd6238312018-03-02 18:26:13678 std::unique_ptr<DetachableBaseHandler> detachable_base_handler_;
Toni Barzic550419f2018-03-08 03:56:21679 std::unique_ptr<DetachableBaseNotificationController>
680 detachable_base_notification_controller_;
dchenga94547472016-04-08 08:41:11681 std::unique_ptr<DragDropController> drag_drop_controller_;
sky79fa34712017-03-20 23:46:47682 std::unique_ptr<FocusCycler> focus_cycler_;
James Cookf0c78fc2017-06-15 14:42:55683 std::unique_ptr<ImeController> ime_controller_;
sky5ab16472017-03-21 19:35:08684 std::unique_ptr<ImmersiveContextAsh> immersive_context_;
sky79fa34712017-03-20 23:46:47685 std::unique_ptr<KeyboardBrightnessControlDelegate>
686 keyboard_brightness_control_delegate_;
687 std::unique_ptr<KeyboardUI> keyboard_ui_;
688 std::unique_ptr<LocaleNotificationController> locale_notification_controller_;
Jacob Dufaultffd9b0d2017-11-15 23:07:16689 std::unique_ptr<LoginScreenController> login_screen_controller_;
sky79fa34712017-03-20 23:46:47690 std::unique_ptr<LogoutConfirmationController> logout_confirmation_controller_;
Mitsuru Oshima0e9b7a62017-07-19 18:23:03691 std::unique_ptr<TabletModeController> tablet_mode_controller_;
sky5ab16472017-03-21 19:35:08692 std::unique_ptr<MediaController> media_controller_;
693 std::unique_ptr<MruWindowTracker> mru_window_tracker_;
694 std::unique_ptr<NewWindowController> new_window_controller_;
dchenga94547472016-04-08 08:41:11695 std::unique_ptr<ResizeShadowController> resize_shadow_controller_;
sky5ad143a2017-03-22 04:31:23696 std::unique_ptr<SessionController> session_controller_;
afakhrye4fae852017-05-09 18:49:06697 std::unique_ptr<NightLightController> night_light_controller_;
Vladislav Kaznacheev92edf62e2017-10-13 22:08:01698 std::unique_ptr<NoteTakingController> note_taking_controller_;
Tetsui Ohkubo3a92f0d92018-03-30 18:33:29699 std::unique_ptr<ScreenSecurityNotificationController>
700 screen_security_notification_controller_;
sky5ad143a2017-03-22 04:31:23701 std::unique_ptr<ShelfController> shelf_controller_;
sky5ad143a2017-03-22 04:31:23702 std::unique_ptr<ShelfWindowWatcher> shelf_window_watcher_;
skyb073203a2017-03-13 16:59:16703 std::unique_ptr<ShellDelegate> shell_delegate_;
sky5b45ed82017-03-27 02:54:23704 std::unique_ptr<ShutdownController> shutdown_controller_;
sky79fa34712017-03-20 23:46:47705 std::unique_ptr<SystemTrayController> system_tray_controller_;
Tetsui Ohkubo21722932018-03-02 02:56:56706 std::unique_ptr<SystemTrayModel> system_tray_model_;
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_;
Qiang Xuf1400a362017-09-14 02:28:30709 std::unique_ptr<TouchDevicesController> touch_devices_controller_;
Scott Violet3c554ae2017-12-13 02:25:41710 std::unique_ptr<TimeToFirstPresentRecorder> time_to_first_present_recorder_;
tbarzicc78da1ff92017-05-08 20:46:15711 std::unique_ptr<TrayAction> tray_action_;
Yue Lia33960a2017-11-01 22:06:07712 std::unique_ptr<VoiceInteractionController> voice_interaction_controller_;
sky5b45ed82017-03-27 02:54:23713 std::unique_ptr<VpnList> vpn_list_;
sky07a24d42017-03-09 23:57:30714 std::unique_ptr<WallpaperController> wallpaper_controller_;
sky5b45ed82017-03-27 02:54:23715 std::unique_ptr<WindowCycleController> window_cycle_controller_;
716 std::unique_ptr<WindowSelectorController> window_selector_controller_;
dchenga94547472016-04-08 08:41:11717 std::unique_ptr<::wm::ShadowController> shadow_controller_;
718 std::unique_ptr<::wm::VisibilityController> visibility_controller_;
719 std::unique_ptr<::wm::WindowModalityController> window_modality_controller_;
Sam McNallya853cd82017-08-30 01:55:10720 std::unique_ptr<PrefService> local_state_;
dchenga94547472016-04-08 08:41:11721 std::unique_ptr<views::corewm::TooltipController> tooltip_controller_;
dchenga94547472016-04-08 08:41:11722 std::unique_ptr<PowerButtonController> power_button_controller_;
723 std::unique_ptr<LockStateController> lock_state_controller_;
dchenga94547472016-04-08 08:41:11724 std::unique_ptr<ui::UserActivityDetector> user_activity_detector_;
725 std::unique_ptr<VideoDetector> video_detector_;
dchenga94547472016-04-08 08:41:11726 std::unique_ptr<WindowTreeHostManager> window_tree_host_manager_;
Qiang Xud77a90c2018-02-20 19:43:29727 std::unique_ptr<PersistentWindowController> persistent_window_controller_;
dchenga94547472016-04-08 08:41:11728 std::unique_ptr<HighContrastController> high_contrast_controller_;
729 std::unique_ptr<MagnificationController> magnification_controller_;
dchenga94547472016-04-08 08:41:11730 std::unique_ptr<AutoclickController> autoclick_controller_;
sky27344382017-03-08 21:30:32731 std::unique_ptr<::wm::FocusController> focus_controller_;
sky984c1892016-04-20 00:00:34732
oshima5a296e82016-04-29 01:32:27733 std::unique_ptr<ScreenshotController> screenshot_controller_;
[email protected]f5c9dbc2014-04-11 08:13:45734
dchenga94547472016-04-08 08:41:11735 std::unique_ptr<MouseCursorEventFilter> mouse_cursor_filter_;
736 std::unique_ptr<ScreenPositionController> screen_position_controller_;
737 std::unique_ptr<SystemModalContainerEventFilter> modality_filter_;
738 std::unique_ptr<EventClientImpl> event_client_;
739 std::unique_ptr<EventTransformationHandler> event_transformation_handler_;
[email protected]ae18b9112011-11-07 16:59:13740
[email protected]0b0b0742012-02-16 13:23:45741 // An event filter that pre-handles key events while the partial
[email protected]a1584a712012-07-30 21:02:26742 // screenshot UI or the keyboard overlay is active.
dchenga94547472016-04-08 08:41:11743 std::unique_ptr<OverlayEventFilter> overlay_filter_;
[email protected]0b0b0742012-02-16 13:23:45744
[email protected]3537d472014-01-15 05:45:31745 // An event filter which handles moving and resizing windows.
dchenga94547472016-04-08 08:41:11746 std::unique_ptr<ToplevelWindowEventHandler> toplevel_window_event_handler_;
[email protected]3537d472014-01-15 05:45:31747
[email protected]435b212e2012-04-05 19:43:37748 // An event filter which handles system level gestures
dchenga94547472016-04-08 08:41:11749 std::unique_ptr<SystemGestureEventFilter> system_gesture_filter_;
[email protected]435b212e2012-04-05 19:43:37750
[email protected]745816be2011-11-22 05:08:30751 // An event filter that pre-handles global accelerators.
dchenga94547472016-04-08 08:41:11752 std::unique_ptr<::wm::AcceleratorFilter> accelerator_filter_;
[email protected]745816be2011-11-22 05:08:30753
rjkroege72f8154f2016-10-29 00:49:02754 std::unique_ptr<display::DisplayManager> display_manager_;
dchenga94547472016-04-08 08:41:11755 std::unique_ptr<DisplayConfigurationController>
756 display_configuration_controller_;
[email protected]6bdf7952012-11-14 10:10:58757
hidehiko6821ca42016-06-18 11:12:23758 std::unique_ptr<ScreenPinningController> screen_pinning_controller_;
[email protected]a9a40462013-07-31 06:22:56759
derat94887a22017-01-20 18:17:25760 // Forwards user activity ui::mojom::UserActivityMonitor to
761 // |user_activity_detector_|. Only initialized for mash.
762 std::unique_ptr<aura::UserActivityForwarder> user_activity_forwarder_;
763
Sammie Quon95c6a1c2017-09-12 19:16:55764 std::unique_ptr<PeripheralBatteryNotifier> peripheral_battery_notifier_;
dchenga94547472016-04-08 08:41:11765 std::unique_ptr<PowerEventObserver> power_event_observer_;
Qiang Xu36234e532018-04-11 04:54:02766 std::unique_ptr<PowerPrefs> power_prefs_;
dchenga94547472016-04-08 08:41:11767 std::unique_ptr<ui::UserActivityPowerManagerNotifier> user_activity_notifier_;
768 std::unique_ptr<VideoActivityNotifier> video_activity_notifier_;
769 std::unique_ptr<StickyKeysController> sticky_keys_controller_;
770 std::unique_ptr<ResolutionNotificationController>
[email protected]7bc49bd2014-01-22 09:30:34771 resolution_notification_controller_;
dchenga94547472016-04-08 08:41:11772 std::unique_ptr<BluetoothNotificationController>
[email protected]b3142722014-03-04 06:59:50773 bluetooth_notification_controller_;
Sonny Sasaka55f69fc2017-08-28 21:29:37774 std::unique_ptr<BluetoothPowerController> bluetooth_power_controller_;
jamescookac6724332017-03-21 02:54:43775 std::unique_ptr<TrayBluetoothHelper> tray_bluetooth_helper_;
dchenga94547472016-04-08 08:41:11776 std::unique_ptr<VirtualKeyboardController> virtual_keyboard_controller_;
[email protected]70b3e7d52012-06-02 22:12:25777 // Controls video output device state.
kylechar7a067ec2017-01-07 01:16:28778 std::unique_ptr<display::DisplayConfigurator> display_configurator_;
dchenga94547472016-04-08 08:41:11779 std::unique_ptr<DisplayColorManager> display_color_manager_;
780 std::unique_ptr<DisplayErrorObserver> display_error_observer_;
781 std::unique_ptr<ProjectingObserver> projecting_observer_;
[email protected]6bdf7952012-11-14 10:10:58782
[email protected]c1234a42013-08-20 09:35:40783 // Listens for output changes and updates the display manager.
kylecharf2e4e412016-12-04 04:21:35784 std::unique_ptr<display::DisplayChangeObserver> display_change_observer_;
[email protected]3dff2ef2014-02-09 22:50:39785
kylechar98748a52016-12-03 01:33:22786 // Listens for shutdown and updates DisplayConfigurator.
Steven Bennetts7683e342018-01-02 21:29:52787 std::unique_ptr<DisplayShutdownObserver> display_shutdown_observer_;
kylechar98748a52016-12-03 01:33:22788
yiyix90cfee22017-02-16 05:38:18789 // Listens for new sms messages and shows notifications.
790 std::unique_ptr<SmsObserver> sms_observer_;
791
derat94887a22017-01-20 18:17:25792 // Implements content::ScreenOrientationController for Chrome OS.
dchenga94547472016-04-08 08:41:11793 std::unique_ptr<ScreenOrientationController> screen_orientation_controller_;
yiyixa68ade512016-09-01 17:38:13794 std::unique_ptr<ScreenLayoutObserver> screen_layout_observer_;
jonrossf21fea12014-11-13 01:22:51795
kylechar55f0eaf22017-01-11 22:57:37796 std::unique_ptr<AshTouchTransformController> touch_transformer_controller_;
dnicoara8c3bd1e62014-10-30 19:53:39797
dchenga94547472016-04-08 08:41:11798 std::unique_ptr<ui::EventHandler> magnifier_key_scroll_handler_;
799 std::unique_ptr<ui::EventHandler> speech_feedback_handler_;
sammiequon203ae022016-09-18 17:23:42800 std::unique_ptr<LaserPointerController> laser_pointer_controller_;
801 std::unique_ptr<PartialMagnificationController>
802 partial_magnification_controller_;
Vladislav Kaznacheev6d6aaff2017-07-22 04:06:32803 std::unique_ptr<HighlighterController> highlighter_controller_;
[email protected]70b3e7d52012-06-02 22:12:25804
Ahmed Fakhry4bf3f742018-02-06 17:33:36805 std::unique_ptr<DockedMagnifierController> docked_magnifier_controller_;
806
xdaid4913762017-07-06 00:17:22807 // The split view controller for Chrome OS in tablet mode.
808 std::unique_ptr<SplitViewController> split_view_controller_;
809
[email protected]c0ff0342013-02-27 00:41:29810 // |native_cursor_manager_| is owned by |cursor_manager_|, but we keep a
811 // pointer to vend to test code.
erg36cfb952017-06-21 19:41:45812 NativeCursorManagerAsh* native_cursor_manager_;
[email protected]e76096a5f2014-04-08 04:08:03813
derat94887a22017-01-20 18:17:25814 // Cursor may be hidden on certain key events in Chrome OS, whereas we never
sadrul7a8785e2016-02-12 21:54:35815 // hide the cursor on Windows.
dchenga94547472016-04-08 08:41:11816 std::unique_ptr<::wm::CursorManager> cursor_manager_;
[email protected]4b8003c2012-07-26 00:54:19817
[email protected]852a55d2012-10-17 13:30:30818 // For testing only: simulate that a modal window is open
James Cook7b7c6a52018-01-04 23:40:03819 bool simulate_modal_window_open_for_test_ = false;
[email protected]852a55d2012-10-17 13:30:30820
mswad3d9552017-05-18 21:23:36821 // See comment for GetRootWindowForNewWindows().
822 aura::Window* root_window_for_new_windows_ = nullptr;
823 aura::Window* scoped_root_window_for_new_windows_ = nullptr;
sky27344382017-03-08 21:30:32824
skyb7b54092016-08-19 16:00:09825 std::unique_ptr<ImmersiveHandlerFactoryAsh> immersive_handler_factory_;
826
Evan Stade2c43a87b32017-08-31 17:53:10827 std::unique_ptr<MessageCenterController> message_center_controller_;
828
sky00c813f2017-03-08 22:48:55829 base::ObserverList<ShellObserver> shell_observers_;
830
Sam McNallye36abbc2017-07-20 01:04:28831 base::WeakPtrFactory<Shell> weak_factory_;
832
[email protected]87b0d82e2011-10-07 21:02:59833 DISALLOW_COPY_AND_ASSIGN(Shell);
834};
835
[email protected]55f593352011-12-24 05:42:46836} // namespace ash
[email protected]87b0d82e2011-10-07 21:02:59837
[email protected]b65bdda2011-12-23 23:35:31838#endif // ASH_SHELL_H_