blob: e9d1b2d266e7e930f1679c43e58a7838f5076f2c [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"
Steven Bennetts38e9bde22019-01-03 17:31:1021#include "chromeos/constants/chromeos_switches.h"
[email protected]c9390bd2013-11-08 20:33:1322#include "ui/aura/window.h"
James Cookfa4838e2018-08-08 16:30:1523#include "ui/base/ui_base_types.h"
oshimaf84b0da722016-04-27 19:47:1924#include "ui/display/screen.h"
[email protected]86ccbd42013-09-18 18:11:5425#include "ui/events/event_target.h"
[email protected]ee3ed10772014-03-11 22:02:0126#include "ui/wm/core/cursor_manager.h"
sky27344382017-03-08 21:30:3227#include "ui/wm/public/activation_change_observer.h"
[email protected]87b0d82e2011-10-07 21:02:5928
afakhrye4fae852017-05-09 18:49:0629class PrefRegistrySimple;
tibellb93c729b2017-03-30 00:45:0930class PrefService;
31
[email protected]87b0d82e2011-10-07 21:02:5932namespace aura {
Scott Violetac410622018-08-11 18:33:2233class Env;
[email protected]35304ce2011-12-14 23:21:0134class RootWindow;
[email protected]87b0d82e2011-10-07 21:02:5935class Window;
Alex Newcomer8fdcb9342017-08-08 18:48:4436} // namespace aura
[email protected]fa4a45832012-04-12 21:32:4837
rjkroege72f8154f2016-10-29 00:49:0238namespace display {
kylecharf2e4e412016-12-04 04:21:3539class DisplayChangeObserver;
kylechar7a067ec2017-01-07 01:16:2840class DisplayConfigurator;
rjkroege72f8154f2016-10-29 00:49:0241class DisplayManager;
Alex Newcomer8fdcb9342017-08-08 18:48:4442} // namespace display
rjkroege72f8154f2016-10-29 00:49:0243
Scott Violet737fb752018-04-11 15:35:2244namespace exo {
45class FileHelper;
Scott Violet737fb752018-04-11 15:35:2246} // namespace exo
47
[email protected]2b99f8c2011-10-11 19:42:2448namespace gfx {
sky4ec2be82017-01-06 17:38:3249class Insets;
James Cookfa4838e2018-08-08 16:30:1550class Point;
Weidong Guo242bf92b2019-01-26 01:19:2351} // namespace gfx
[email protected]b6ba05d902013-10-04 21:38:4552
Jun Mukaif2357792018-12-20 19:58:0053namespace keyboard {
54class KeyboardUIFactory;
55}
56
Scott Violet6c0eb6962018-06-20 01:31:2657namespace service_manager {
58class Connector;
59}
60
[email protected]a8bd1cb2012-02-17 23:05:5461namespace ui {
Scott Violetc8a1c6c2017-11-29 23:17:3662class ContextFactory;
63class ContextFactoryPrivate;
derat2d4e62d2015-01-09 16:09:1764class UserActivityDetector;
[email protected]b0fa7012014-04-16 12:50:5765class UserActivityPowerManagerNotifier;
Alex Newcomer8fdcb9342017-08-08 18:48:4466} // namespace ui
thanhph3f3968512017-06-21 00:37:2367
[email protected]57b8bb352012-01-11 05:11:4668namespace views {
69class NonClientFrameView;
70class Widget;
[email protected]4a59e4e92012-11-12 21:15:4071namespace corewm {
[email protected]e319c7e2014-03-14 19:56:1472class TooltipController;
73}
Alex Newcomer8fdcb9342017-08-08 18:48:4474} // namespace views
[email protected]e319c7e2014-03-14 19:56:1475
76namespace wm {
[email protected]60d677d2014-05-30 13:07:0277class AcceleratorFilter;
Thiago Farina3b086a02017-05-30 22:32:5078class ActivationClient;
[email protected]4a59e4e92012-11-12 21:15:4079class CompoundEventFilter;
sky27344382017-03-08 21:30:3280class FocusController;
Scott Violet7dbdaeb2018-12-11 22:39:0281class FocusRules;
[email protected]86f2b5e2012-11-14 20:37:0082class ShadowController;
[email protected]b5756e22012-11-30 01:32:0283class VisibilityController;
[email protected]0c2dc012012-12-02 00:00:2384class WindowModalityController;
Alex Newcomer8fdcb9342017-08-08 18:48:4485} // namespace wm
[email protected]87b0d82e2011-10-07 21:02:5986
Scott Violet7e33efc2018-08-29 22:30:1587namespace ws {
88class GpuInterfaceProvider;
89}
90
[email protected]55f593352011-12-24 05:42:4691namespace ash {
[email protected]87b0d82e2011-10-07 21:02:5992
sky81a2d792017-03-17 19:14:3993class AcceleratorController;
James Cookec144952017-09-01 00:05:1694class AccessibilityController;
sky07a24d42017-03-09 23:57:3095class AccessibilityDelegate;
Qiang Xua9591002018-03-15 22:29:3196class AccessibilityFocusRingController;
Ryo Hashimotobac835a2019-02-26 03:04:2897class ArcCustomTabController;
Jeffrey Kardatzkef108f022018-04-17 17:52:3598class AshDBusServices;
Scott Violetd64dac12017-06-02 21:50:0899class AshDisplayController;
Jiaquan He4b48f912018-03-01 03:59:39100class AppListControllerImpl;
erg36cfb952017-06-21 19:41:45101class NativeCursorManagerAsh;
sky07a24d42017-03-09 23:57:30102class AshTouchTransformController;
David Black00fdce32018-05-10 20:59:14103class AssistantController;
[email protected]55398d2c2013-10-10 19:49:20104class AutoclickController;
Toni Barzic9d0c82f42017-12-06 00:53:52105class BacklightsForcedOffSetter;
[email protected]b31427252014-03-04 06:59:50106class BluetoothNotificationController;
Sonny Sasaka55f69fc2017-08-28 21:29:37107class BluetoothPowerController;
sky79fa34712017-03-20 23:46:47108class BrightnessControlDelegate;
109class CastConfigController;
Scott Violetbed23cb2018-08-22 19:56:12110class DisplayOutputProtection;
Quan Nguyenaf67b64d2018-11-29 19:21:48111class ContainedShellController;
Steven Bennetts2a9b4382018-04-26 23:41:19112class CrosDisplayConfig;
Ahmed Fakhryc77ce402019-02-13 02:32:00113class DesksController;
Toni Barzicd6238312018-03-02 18:26:13114class DetachableBaseHandler;
Toni Barzic550419f2018-03-08 03:56:21115class DetachableBaseNotificationController;
robert.bradfordab052492015-05-06 11:09:56116class DisplayColorManager;
stevenjb537c5c3f2016-01-20 23:38:12117class DisplayConfigurationController;
Steven Bennetts9b21fa32018-04-13 23:45:55118class DisplayConfigurationObserver;
[email protected]18b21b2e2013-03-01 20:56:23119class DisplayErrorObserver;
Steven Bennetts3688c6032018-04-13 01:14:23120class DisplayPrefs;
Steven Bennetts7683e342018-01-02 21:29:52121class DisplayShutdownObserver;
Tetsui Ohkubo01421b32018-05-30 16:54:59122class DisplaySpeakerController;
Ahmed Fakhry4bf3f742018-02-06 17:33:36123class DockedMagnifierController;
[email protected]084b6bb2011-11-17 05:18:16124class DragDropController;
[email protected]e67291f12012-10-10 05:52:38125class EventClientImpl;
Mike Wassermanefbf3402018-04-26 00:41:32126class EventRewriterController;
[email protected]682990f2013-01-10 06:49:11127class EventTransformationHandler;
James Cookf5398842018-04-16 20:15:24128class FirstRunHelper;
sky79fa34712017-03-20 23:46:47129class FocusCycler;
[email protected]093b8d642014-04-03 20:59:28130class HighContrastController;
Vladislav Kaznacheev6d6aaff2017-07-22 04:06:32131class HighlighterController;
James Cookbb026732017-06-09 23:01:55132class ImeController;
Xiyuan Xia5f1046e2018-06-01 16:04:44133class ImeFocusHandler;
Evan Stade1467204e2018-10-11 02:03:50134class ImmersiveContext;
David Tseng6792dc82018-05-04 19:18:41135class KeyAccessibilityEnabler;
sky79fa34712017-03-20 23:46:47136class KeyboardBrightnessControlDelegate;
Steven Bennettsa0ea30942018-10-11 22:27:51137class AshKeyboardController;
sammiequon203ae022016-09-18 17:23:42138class LaserPointerController;
Tatsuhisa Yamaguchi440e2d2e2018-12-05 09:16:31139class LocaleUpdateController;
[email protected]093b8d642014-04-03 20:59:28140class LockStateController;
sky79fa34712017-03-20 23:46:47141class LogoutConfirmationController;
Jacob Dufaultffd9b0d2017-11-15 23:07:16142class LoginScreenController;
[email protected]093b8d642014-04-03 20:59:28143class MagnificationController;
Mitsuru Oshima0e9b7a62017-07-19 18:23:03144class TabletModeController;
sky5ab16472017-03-21 19:35:08145class MediaController;
Becca Hughesc6a0a062018-10-25 16:54:13146class MediaNotificationController;
Evan Stade2c43a87b32017-08-31 17:53:10147class MessageCenterController;
[email protected]78d9630c2012-06-22 00:58:07148class MouseCursorEventFilter;
sky5ab16472017-03-21 19:35:08149class MruWindowTracker;
Kyle Horimoto9fc84fc22018-04-27 19:45:15150class MultiDeviceNotificationPresenter;
sky5ab16472017-03-21 19:35:08151class NewWindowController;
afakhrye4fae852017-05-09 18:49:06152class NightLightController;
Vladislav Kaznacheev92edf62e2017-10-13 22:08:01153class NoteTakingController;
[email protected]9ae32df2012-07-26 03:25:18154class OverlayEventFilter;
[email protected]093b8d642014-04-03 20:59:28155class PartialMagnificationController;
Sammie Quon95c6a1c2017-09-12 19:16:55156class PeripheralBatteryNotifier;
Qiang Xud77a90c2018-02-20 19:43:29157class PersistentWindowController;
Qiang Xud8e897e2018-05-24 20:07:57158class PolicyRecommendationRestorer;
[email protected]093b8d642014-04-03 20:59:28159class PowerButtonController;
[email protected]51625052013-10-10 01:40:16160class PowerEventObserver;
Abhishek Bhardwaj62aeaad62019-02-28 08:49:34161class NotificationReporter;
Qiang Xu36234e532018-04-11 04:54:02162class PowerPrefs;
[email protected]72bce522014-02-10 21:11:26163class ProjectingObserver;
[email protected]e4a181cc2012-03-17 02:20:57164class ResizeShadowController;
[email protected]6ef71d72013-08-10 18:13:44165class ResolutionNotificationController;
[email protected]d90b8392012-06-13 09:34:56166class RootWindowController;
jamescookac6724332017-03-21 02:54:43167class ScreenLayoutObserver;
jonross0af45212015-01-13 18:55:46168class ScreenOrientationController;
oshima5a296e82016-04-29 01:32:27169class ScreenshotController;
hidehiko6821ca42016-06-18 11:12:23170class ScreenPinningController;
[email protected]8d625fb2012-07-18 16:40:06171class ScreenPositionController;
Tetsui Ohkubo54d50222018-05-10 01:58:11172class ScreenSwitchCheckController;
sky5ad143a2017-03-22 04:31:23173class SessionController;
sky5ad143a2017-03-22 04:31:23174class ShelfController;
sky5ad143a2017-03-22 04:31:23175class ShelfModel;
176class ShelfWindowWatcher;
skyb073203a2017-03-13 16:59:16177class ShellDelegate;
[email protected]1b4c7472014-05-15 18:32:23178struct ShellInitParams;
sky00c813f2017-03-08 22:48:55179class ShellObserver;
James Cook40f7d752018-05-25 18:21:58180class ShellState;
sky5b45ed82017-03-27 02:54:23181class ShutdownController;
yiyix90cfee22017-02-16 05:38:18182class SmsObserver;
xdaid4913762017-07-06 00:17:22183class SplitViewController;
[email protected]093b8d642014-04-03 20:59:28184class StickyKeysController;
[email protected]9ae32df2012-07-26 03:25:18185class SystemGestureEventFilter;
[email protected]c0ce80e2012-10-05 23:28:27186class SystemModalContainerEventFilter;
Tetsui Ohkubo269b5792018-04-26 01:06:32187class SystemNotificationController;
Tetsui Ohkubo21722932018-03-02 02:56:56188class SystemTrayModel;
sky5b45ed82017-03-27 02:54:23189class SystemTrayNotifier;
Scott Violet3c554ae2017-12-13 02:25:41190class TimeToFirstPresentRecorder;
[email protected]093b8d642014-04-03 20:59:28191class ToplevelWindowEventHandler;
sky07a24d42017-03-09 23:57:30192class ToastManager;
Qiang Xuf1400a362017-09-14 02:28:30193class TouchDevicesController;
tbarzicc78da1ff92017-05-08 20:46:15194class TrayAction;
jamescookac6724332017-03-21 02:54:43195class TrayBluetoothHelper;
[email protected]ded58fd2013-10-09 07:56:55196class VideoActivityNotifier;
[email protected]093b8d642014-04-03 20:59:28197class VideoDetector;
Yue Lia33960a2017-11-01 22:06:07198class VoiceInteractionController;
sky5b45ed82017-03-27 02:54:23199class VpnList;
sky07a24d42017-03-09 23:57:30200class WallpaperController;
Scott Violet737fb752018-04-11 15:35:22201class WaylandServerController;
Scott Violetb7f4df22018-05-17 04:43:12202class WindowServiceOwner;
sky5b45ed82017-03-27 02:54:23203class WindowCycleController;
[email protected]093b8d642014-04-03 20:59:28204class WindowPositioner;
Sammie Quon80e82a12019-01-23 19:55:22205class OverviewController;
msw607227f82016-08-30 17:22:39206class WindowTreeHostManager;
[email protected]2b99f8c2011-10-11 19:42:24207
sky494c6cbd2017-03-27 20:57:48208enum class LoginStatus;
209
[email protected]87b0d82e2011-10-07 21:02:59210// Shell is a singleton object that presents the Shell API and implements the
[email protected]99f07e02011-12-07 00:02:59211// RootWindow's delegate interface.
[email protected]b0079a92012-01-25 20:13:38212//
213// Upon creation, the Shell sets itself as the RootWindow's delegate, which
214// takes ownership of the Shell.
Xiyuan Xia22b1a6c2017-04-18 22:46:01215class ASH_EXPORT Shell : public SessionObserver,
sky5ad143a2017-03-22 04:31:23216 public SystemModalContainerEventFilterDelegate,
sky27344382017-03-08 21:30:32217 public ui::EventTarget,
Thiago Farina3b086a02017-05-30 22:32:50218 public ::wm::ActivationChangeObserver {
[email protected]87b0d82e2011-10-07 21:02:59219 public:
[email protected]093b8d642014-04-03 20:59:28220 typedef std::vector<RootWindowController*> RootWindowControllerList;
[email protected]be65be362012-06-15 07:38:23221
Scott Violetc8a1c6c2017-11-29 23:17:36222 // Creates the single Shell instance.
223 static Shell* CreateInstance(ShellInitParams init_params);
[email protected]3266c2b92011-11-14 00:06:08224
225 // Should never be called before |CreateInstance()|.
skyb073203a2017-03-13 16:59:16226 static Shell* Get();
[email protected]3266c2b92011-11-14 00:06:08227
[email protected]b3b7bcd2012-03-06 19:35:45228 // Returns true if the ash shell has been instantiated.
229 static bool HasInstance();
230
[email protected]ef589af2011-12-03 01:07:15231 static void DeleteInstance();
[email protected]cac10fc62011-10-07 23:22:56232
[email protected]d90b8392012-06-13 09:34:56233 // Returns the root window controller for the primary root window.
[email protected]a0afeb12012-12-10 22:57:09234 // TODO(oshima): move this to |RootWindowController|
[email protected]093b8d642014-04-03 20:59:28235 static RootWindowController* GetPrimaryRootWindowController();
[email protected]d90b8392012-06-13 09:34:56236
thanhphc90f49ca2017-03-03 17:48:53237 // Returns the RootWindowController for the given display id. If there
238 // is no display for |display_id|, null is returned.
239 static RootWindowController* GetRootWindowControllerWithDisplayId(
240 int64_t display_id);
241
Scott Violet596bb46342017-06-21 14:43:13242 // Returns the root Window for the given display id. If there is no display
243 // for |display_id| null is returned.
244 static aura::Window* GetRootWindowForDisplayId(int64_t display_id);
245
[email protected]cf1c70e2012-08-30 01:13:02246 // Returns all root window controllers.
[email protected]a0afeb12012-12-10 22:57:09247 // TODO(oshima): move this to |RootWindowController|
[email protected]be65be362012-06-15 07:38:23248 static RootWindowControllerList GetAllRootWindowControllers();
249
[email protected]bf9cdb362013-10-25 19:22:45250 // Returns the primary root Window. The primary root Window is the one that
251 // has a launcher.
252 static aura::Window* GetPrimaryRootWindow();
[email protected]e73bd7802012-02-17 20:10:34253
sky27344382017-03-08 21:30:32254 // Returns the root window that newly created windows should be added to.
255 // Value can be temporarily overridden using ScopedRootWindowForNewWindows.
256 // NOTE: this returns the root, newly created window should be added to the
257 // appropriate container in the returned window.
258 static aura::Window* GetRootWindowForNewWindows();
mfomitcheva1a8aa62016-05-03 16:23:26259
[email protected]cf1c70e2012-08-30 01:13:02260 // Returns all root windows.
[email protected]c9390bd2013-11-08 20:33:13261 static aura::Window::Windows GetAllRootWindows();
[email protected]be65be362012-06-15 07:38:23262
[email protected]bf9cdb362013-10-25 19:22:45263 static aura::Window* GetContainer(aura::Window* root_window,
[email protected]7b0f7502012-06-11 00:12:39264 int container_id);
[email protected]bf9cdb362013-10-25 19:22:45265 static const aura::Window* GetContainer(const aura::Window* root_window,
[email protected]e67291f12012-10-10 05:52:38266 int container_id);
[email protected]7b0f7502012-06-11 00:12:39267
James Cook7b7c6a52018-01-04 23:40:03268 // If a system-modal dialog window is currently open, returns the ID of the
269 // system modal window container that contains the window.
270 // If no system-modal dialogs are open it returns -1.
271 static int GetOpenSystemModalWindowContainerId();
272
273 // Returns true if a system-modal dialog window is currently open.
274 static bool IsSystemModalWindowOpen();
275
Scott Violet25848c12018-12-14 18:29:15276 // Returns true if |window| is a proxy window. A proxy window is a window that
277 // was created by way of a WindowService client (e.g. the keyboard shortcut
278 // viewer app under classic ash, or a browser window under mash).
279 static bool IsProxyWindow(aura::Window* window);
James Cooka6066972018-07-31 19:34:07280
Wenzhao Zang56c292932017-08-02 04:58:34281 // Registers all ash related local state prefs to the given |registry|.
Steven Bennettsca108512018-05-02 11:05:03282 static void RegisterLocalStatePrefs(PrefRegistrySimple* registry,
283 bool for_test);
Wenzhao Zang56c292932017-08-02 04:58:34284
Qiang Xu36234e532018-04-11 04:54:02285 // Registers all ash related signin/user profile prefs to the given
286 // |registry|. Can be called before Shell is initialized. When |for_test| is
287 // true this registers foreign user profile prefs (e.g. chrome prefs) as if
288 // they are owned by ash. This allows test code to read the pref values.
289 static void RegisterSigninProfilePrefs(PrefRegistrySimple* registry,
290 bool for_test = false);
291 static void RegisterUserProfilePrefs(PrefRegistrySimple* registry,
292 bool for_test = false);
afakhrye4fae852017-05-09 18:49:06293
Scott Violet737fb752018-04-11 15:35:22294 // If necessary, initializes the Wayland server.
Xiyuan Xia36197372018-04-25 00:45:17295 void InitWaylandServer(std::unique_ptr<exo::FileHelper> file_helper);
Scott Violet737fb752018-04-11 15:35:22296 void DestroyWaylandServer();
297
[email protected]57b8bb352012-01-11 05:11:46298 // Creates a default views::NonClientFrameView for use by windows in the
299 // Ash environment.
300 views::NonClientFrameView* CreateDefaultNonClientFrameView(
301 views::Widget* widget);
302
mswad28b252016-08-09 02:42:07303 // Sets work area insets of the display containing |window|, pings observers.
[email protected]2e236a52012-06-27 22:21:47304 void SetDisplayWorkAreaInsets(aura::Window* window,
[email protected]8a45c972012-03-14 18:22:44305 const gfx::Insets& insets);
[email protected]1a2145b2012-03-13 21:09:17306
[email protected]58868abf2014-01-17 23:45:33307 // Called when a casting session is started or stopped.
308 void OnCastingSessionStartedOrStopped(bool started);
309
[email protected]0e3e7cb2014-04-12 05:18:25310 // Called when a root window is created.
varkhac71444e52017-05-25 22:51:34311 void OnRootWindowAdded(aura::Window* root_window);
[email protected]0e3e7cb2014-04-12 05:18:25312
Zach Helfinsteinbbb6bad2018-05-02 18:21:51313 // Called when dictation is activated.
314 void OnDictationStarted();
315
316 // Called when dictation is ended.
317 void OnDictationEnded();
318
Darren Shenad5dc722018-05-28 00:14:45319 // Enables the keyboard and associate it with the primary root window
320 // controller.
Darren Shenf62db77a2018-06-07 06:22:44321 void EnableKeyboard();
[email protected]51f438112013-11-18 19:32:50322
Darren Shenad5dc722018-05-28 00:14:45323 // Hides and disables the virtual keyboard.
Darren Shenf62db77a2018-06-07 06:22:44324 void DisableKeyboard();
[email protected]e1b299b2014-01-29 23:53:41325
Mitsuru Oshima0e9b7a62017-07-19 18:23:03326 // Test if TabletModeWindowManager is not enabled, and if
327 // TabletModeController is not currently setting a display rotation. Or if
[email protected]da285852014-05-27 19:53:43328 // the |resolution_notification_controller_| is not showing its confirmation
329 // dialog. If true then changes to display settings can be saved.
330 bool ShouldSaveDisplaySettings();
[email protected]da285852014-05-27 19:53:43331
sky81a2d792017-03-17 19:14:39332 AcceleratorController* accelerator_controller() {
333 return accelerator_controller_.get();
sky44a09892016-07-20 17:46:58334 }
James Cookec144952017-09-01 00:05:16335 AccessibilityController* accessibility_controller() {
336 return accessibility_controller_.get();
337 }
sky07a24d42017-03-09 23:57:30338 AccessibilityDelegate* accessibility_delegate() {
339 return accessibility_delegate_.get();
340 }
Qiang Xua9591002018-03-15 22:29:31341 AccessibilityFocusRingController* accessibility_focus_ring_controller() {
342 return accessibility_focus_ring_controller_.get();
343 }
Qiang Xuf1400a362017-09-14 02:28:30344 ::wm::ActivationClient* activation_client();
Jiaquan He4b48f912018-03-01 03:59:39345 AppListControllerImpl* app_list_controller() {
346 return app_list_controller_.get();
347 }
Ryo Hashimotobac835a2019-02-26 03:04:28348 ArcCustomTabController* arc_custom_tab_controller() {
349 return arc_custom_tab_controller_.get();
350 }
Scott Violetd64dac12017-06-02 21:50:08351 AshDisplayController* ash_display_controller() {
352 return ash_display_controller_.get();
353 }
David Black00fdce32018-05-10 20:59:14354 AssistantController* assistant_controller() {
355 DCHECK(chromeos::switches::IsAssistantEnabled());
356 return assistant_controller_.get();
357 }
Qiang Xuf1400a362017-09-14 02:28:30358 AutoclickController* autoclick_controller() {
359 return autoclick_controller_.get();
360 }
Daniel Erat477c56d2017-12-13 21:42:54361 BacklightsForcedOffSetter* backlights_forced_off_setter() {
362 return backlights_forced_off_setter_.get();
363 }
Qiang Xuf1400a362017-09-14 02:28:30364 BluetoothPowerController* bluetooth_power_controller() {
365 return bluetooth_power_controller_.get();
366 }
sky79fa34712017-03-20 23:46:47367 BrightnessControlDelegate* brightness_control_delegate() {
368 return brightness_control_delegate_.get();
369 }
370 CastConfigController* cast_config() { return cast_config_.get(); }
Scott Violet6c0eb6962018-06-20 01:31:26371 service_manager::Connector* connector() { return connector_; }
Quan Nguyenaf67b64d2018-11-29 19:21:48372 ContainedShellController* contained_shell_controller() {
373 return contained_shell_controller_.get();
374 }
Steven Bennetts2a9b4382018-04-26 23:41:19375 CrosDisplayConfig* cros_display_config() {
376 return cros_display_config_.get();
377 }
Qiang Xuf1400a362017-09-14 02:28:30378 ::wm::CursorManager* cursor_manager() { return cursor_manager_.get(); }
Ahmed Fakhryc77ce402019-02-13 02:32:00379 DesksController* desks_controller() { return desks_controller_.get(); }
Toni Barzicd6238312018-03-02 18:26:13380 DetachableBaseHandler* detachable_base_handler() {
381 return detachable_base_handler_.get();
382 }
383
rjkroege72f8154f2016-10-29 00:49:02384 display::DisplayManager* display_manager() { return display_manager_.get(); }
Steven Bennetts3688c6032018-04-13 01:14:23385 DisplayPrefs* display_prefs() { return display_prefs_.get(); }
stevenjb537c5c3f2016-01-20 23:38:12386 DisplayConfigurationController* display_configuration_controller() {
387 return display_configuration_controller_.get();
388 }
Qiang Xuf1400a362017-09-14 02:28:30389
Joone Hur60b9fd32019-02-23 00:10:26390 display::DisplayConfigurator* display_configurator();
391
Ahmed Fakhry46357342018-04-27 00:46:11392 DisplayColorManager* display_color_manager() {
393 return display_color_manager_.get();
394 }
Qiang Xuf1400a362017-09-14 02:28:30395 DisplayErrorObserver* display_error_observer() {
396 return display_error_observer_.get();
397 }
Scott Violetbed23cb2018-08-22 19:56:12398 DisplayOutputProtection* display_output_protection() {
399 return display_output_protection_.get();
400 }
Qiang Xuf1400a362017-09-14 02:28:30401
Ahmed Fakhry4bf3f742018-02-06 17:33:36402 DockedMagnifierController* docked_magnifier_controller();
Scott Violetac410622018-08-11 18:33:22403 aura::Env* aura_env() { return aura_env_; }
jamescookb8dcef522016-06-25 14:42:55404 ::wm::CompoundEventFilter* env_filter() { return env_filter_.get(); }
Mike Wassermanefbf3402018-04-26 00:41:32405 EventRewriterController* event_rewriter_controller() {
406 return event_rewriter_controller_.get();
407 }
Qiang Xuf1400a362017-09-14 02:28:30408 EventClientImpl* event_client() { return event_client_.get(); }
409 EventTransformationHandler* event_transformation_handler() {
410 return event_transformation_handler_.get();
411 }
James Cookf5398842018-04-16 20:15:24412 FirstRunHelper* first_run_helper() { return first_run_helper_.get(); }
Scott Violet319cfb52018-05-23 18:35:28413 ::wm::FocusController* focus_controller() { return focus_controller_.get(); }
Scott Violet7dbdaeb2018-12-11 22:39:02414 ::wm::FocusRules* focus_rules() { return focus_rules_; }
sky79fa34712017-03-20 23:46:47415 FocusCycler* focus_cycler() { return focus_cycler_.get(); }
Qiang Xuf1400a362017-09-14 02:28:30416 HighlighterController* highlighter_controller() {
417 return highlighter_controller_.get();
418 }
419 HighContrastController* high_contrast_controller() {
420 return high_contrast_controller_.get();
421 }
James Cookf0c78fc2017-06-15 14:42:55422 ImeController* ime_controller() { return ime_controller_.get(); }
Evan Stade1467204e2018-10-11 02:03:50423 ImmersiveContext* immersive_context() { return immersive_context_.get(); }
David Tseng6792dc82018-05-04 19:18:41424 KeyAccessibilityEnabler* key_accessibility_enabler() {
425 return key_accessibility_enabler_.get();
426 }
sky79fa34712017-03-20 23:46:47427 KeyboardBrightnessControlDelegate* keyboard_brightness_control_delegate() {
428 return keyboard_brightness_control_delegate_.get();
429 }
Steven Bennettsa0ea30942018-10-11 22:27:51430 AshKeyboardController* ash_keyboard_controller() {
431 return ash_keyboard_controller_.get();
Steven Bennettsa00d64cc82018-10-04 00:17:22432 }
Qiang Xuf1400a362017-09-14 02:28:30433 LaserPointerController* laser_pointer_controller() {
434 return laser_pointer_controller_.get();
435 }
Tatsuhisa Yamaguchi440e2d2e2018-12-05 09:16:31436 LocaleUpdateController* locale_update_controller() {
437 return locale_update_controller_.get();
sky79fa34712017-03-20 23:46:47438 }
Jacob Dufaultffd9b0d2017-11-15 23:07:16439 LoginScreenController* login_screen_controller() {
440 return login_screen_controller_.get();
xiaoyinh2bbdd102017-05-18 23:29:42441 }
Qiang Xuf1400a362017-09-14 02:28:30442 LockStateController* lock_state_controller() {
443 return lock_state_controller_.get();
444 }
445 LogoutConfirmationController* logout_confirmation_controller() {
446 return logout_confirmation_controller_.get();
447 }
448 MagnificationController* magnification_controller() {
449 return magnification_controller_.get();
450 }
sky5ab16472017-03-21 19:35:08451 MediaController* media_controller() { return media_controller_.get(); }
Becca Hughesc6a0a062018-10-25 16:54:13452 MediaNotificationController* media_notification_controller() {
453 return media_notification_controller_.get();
454 }
Evan Stade04c18d02017-10-20 20:53:22455 MessageCenterController* message_center_controller() {
456 return message_center_controller_.get();
457 }
Qiang Xuf1400a362017-09-14 02:28:30458 MouseCursorEventFilter* mouse_cursor_filter() {
459 return mouse_cursor_filter_.get();
460 }
sky5ab16472017-03-21 19:35:08461 MruWindowTracker* mru_window_tracker() { return mru_window_tracker_.get(); }
462 NewWindowController* new_window_controller() {
463 return new_window_controller_.get();
464 }
afakhry9e0a18b32017-06-05 19:23:14465 NightLightController* night_light_controller();
Vladislav Kaznacheev92edf62e2017-10-13 22:08:01466 NoteTakingController* note_taking_controller() {
467 return note_taking_controller_.get();
468 }
Qiang Xuf1400a362017-09-14 02:28:30469 OverlayEventFilter* overlay_filter() { return overlay_filter_.get(); }
Qiang Xuf1400a362017-09-14 02:28:30470 PartialMagnificationController* partial_magnification_controller() {
471 return partial_magnification_controller_.get();
472 }
Qiang Xud8e897e2018-05-24 20:07:57473 PolicyRecommendationRestorer* policy_recommendation_restorer() {
474 return policy_recommendation_restorer_.get();
475 }
Qiang Xuf1400a362017-09-14 02:28:30476 PowerButtonController* power_button_controller() {
477 return power_button_controller_.get();
478 }
479 PowerEventObserver* power_event_observer() {
480 return power_event_observer_.get();
481 }
482 ResizeShadowController* resize_shadow_controller() {
483 return resize_shadow_controller_.get();
484 }
485 ResolutionNotificationController* resolution_notification_controller() {
486 return resolution_notification_controller_.get();
487 }
488 ScreenshotController* screenshot_controller() {
489 return screenshot_controller_.get();
490 }
491 ScreenLayoutObserver* screen_layout_observer() {
492 return screen_layout_observer_.get();
493 }
494 ScreenOrientationController* screen_orientation_controller() {
495 return screen_orientation_controller_.get();
496 }
497 ScreenPinningController* screen_pinning_controller() {
498 return screen_pinning_controller_.get();
499 }
Tetsui Ohkubo54d50222018-05-10 01:58:11500 ScreenSwitchCheckController* screen_switch_check_controller() {
501 return screen_switch_check_controller_.get();
502 }
sky5ad143a2017-03-22 04:31:23503 SessionController* session_controller() { return session_controller_.get(); }
Sammie Quon557418662018-04-25 18:45:51504 ::wm::ShadowController* shadow_controller() {
505 return shadow_controller_.get();
506 }
sky5ad143a2017-03-22 04:31:23507 ShelfController* shelf_controller() { return shelf_controller_.get(); }
sky5ad143a2017-03-22 04:31:23508 ShelfModel* shelf_model();
Qiang Xuf1400a362017-09-14 02:28:30509 ShellDelegate* shell_delegate() { return shell_delegate_.get(); }
James Cook40f7d752018-05-25 18:21:58510 ShellState* shell_state() { return shell_state_.get(); }
sky5b45ed82017-03-27 02:54:23511 ShutdownController* shutdown_controller() {
512 return shutdown_controller_.get();
513 }
Qiang Xuf1400a362017-09-14 02:28:30514 SplitViewController* split_view_controller() {
515 return split_view_controller_.get();
516 }
517 StickyKeysController* sticky_keys_controller() {
518 return sticky_keys_controller_.get();
519 }
Steven Bennetts7fb8a992018-06-12 00:15:05520 SystemNotificationController* system_notification_controller() {
521 return system_notification_controller_.get();
522 }
Tetsui Ohkubo21722932018-03-02 02:56:56523 SystemTrayModel* system_tray_model() { return system_tray_model_.get(); }
sky5b45ed82017-03-27 02:54:23524 SystemTrayNotifier* system_tray_notifier() {
525 return system_tray_notifier_.get();
526 }
Sammie Quona6f96402017-08-24 01:08:37527 TabletModeController* tablet_mode_controller() {
528 return tablet_mode_controller_.get();
529 }
Scott Violet3c554ae2017-12-13 02:25:41530 TimeToFirstPresentRecorder* time_to_first_present_recorder() {
531 return time_to_first_present_recorder_.get();
532 }
Qiang Xuf1400a362017-09-14 02:28:30533 ToastManager* toast_manager() { return toast_manager_.get(); }
[email protected]a1b7a822013-02-23 19:08:04534 views::corewm::TooltipController* tooltip_controller() {
[email protected]862deef2011-12-15 22:07:33535 return tooltip_controller_.get();
[email protected]4a229e902011-12-01 21:21:11536 }
Qiang Xuf1400a362017-09-14 02:28:30537 TouchDevicesController* touch_devices_controller() {
538 return touch_devices_controller_.get();
chirantan40e4cd82015-02-19 01:08:19539 }
kylechar55f0eaf22017-01-11 22:57:37540 AshTouchTransformController* touch_transformer_controller() {
[email protected]03122891a2014-05-13 23:56:49541 return touch_transformer_controller_.get();
542 }
Qiang Xuf1400a362017-09-14 02:28:30543 TrayAction* tray_action() { return tray_action_.get(); }
544 TrayBluetoothHelper* tray_bluetooth_helper() {
545 return tray_bluetooth_helper_.get();
sammiequon203ae022016-09-18 17:23:42546 }
Evan Stade04c18d02017-10-20 20:53:22547 UserMetricsRecorder* metrics() { return user_metrics_recorder_.get(); }
Qiang Xuf1400a362017-09-14 02:28:30548 VideoDetector* video_detector() { return video_detector_.get(); }
Yue Lia33960a2017-11-01 22:06:07549 VoiceInteractionController* voice_interaction_controller() {
550 return voice_interaction_controller_.get();
551 }
Qiang Xuf1400a362017-09-14 02:28:30552 VpnList* vpn_list() { return vpn_list_.get(); }
553 WallpaperController* wallpaper_controller() {
554 return wallpaper_controller_.get();
Vladislav Kaznacheev6d6aaff2017-07-22 04:06:32555 }
Qiang Xuf1400a362017-09-14 02:28:30556 WindowCycleController* window_cycle_controller() {
557 return window_cycle_controller_.get();
mukai19274bdd2015-02-24 22:37:48558 }
Qiang Xuf1400a362017-09-14 02:28:30559 WindowPositioner* window_positioner() { return window_positioner_.get(); }
Sammie Quon80e82a12019-01-23 19:55:22560 OverviewController* overview_controller() {
561 return overview_controller_.get();
[email protected]8b7ba87b2012-09-01 00:40:40562 }
Scott Violetb7f4df22018-05-17 04:43:12563 WindowServiceOwner* window_service_owner() {
564 return window_service_owner_.get();
Scott Violet7eb50d22018-05-04 17:12:18565 }
Qiang Xuf1400a362017-09-14 02:28:30566 WindowTreeHostManager* window_tree_host_manager() {
567 return window_tree_host_manager_.get();
[email protected]682990f2013-01-10 06:49:11568 }
[email protected]77f7c132012-11-15 06:52:54569
Mitsuru Oshima89e5c1352018-01-17 07:29:39570 ToplevelWindowEventHandler* toplevel_window_event_handler() {
571 return toplevel_window_event_handler_.get();
572 }
573
[email protected]c758fbf2012-03-25 22:53:59574 // Force the shelf to query for it's current visibility state.
jamescook6afad6d2016-06-01 00:35:01575 // TODO(jamescook): Move to Shelf.
[email protected]c758fbf2012-03-25 22:53:59576 void UpdateShelfVisibility();
577
[email protected]a0afeb12012-12-10 22:57:09578 // Does the primary display have status area?
579 bool HasPrimaryStatusArea();
580
[email protected]f9466702012-09-17 16:35:27581 // Starts the animation that occurs on first login.
582 void DoInitialWorkspaceAnimation();
583
yawanodc5533b32017-02-23 11:04:38584 void SetLargeCursorSizeInDip(int large_cursor_size_in_dip);
585
Weidong Guod07448f2017-10-18 03:35:18586 // Updates cursor compositing on/off. Native cursor is disabled when cursor
[email protected]87ec2202014-02-06 06:24:27587 // compositing is enabled, and vice versa.
Weidong Guod07448f2017-10-18 03:35:18588 void UpdateCursorCompositingEnabled();
[email protected]87ec2202014-02-06 06:24:27589
Weidong Guod07448f2017-10-18 03:35:18590 // Force setting compositing on/off without checking dependency.
591 void SetCursorCompositingEnabled(bool enabled);
xdaid4913762017-07-06 00:17:22592
593 // Returns true if split view mode is active.
594 bool IsSplitViewModeActive() const;
595
James Cookfa4838e2018-08-08 16:30:15596 // Shows the context menu for the wallpaper or shelf at |location_in_screen|.
597 void ShowContextMenu(const gfx::Point& location_in_screen,
598 ui::MenuSourceType source_type);
599
sky00c813f2017-03-08 22:48:55600 void AddShellObserver(ShellObserver* observer);
601 void RemoveShellObserver(ShellObserver* observer);
602
sky5ad143a2017-03-22 04:31:23603 // Called when the login status changes.
604 // TODO(oshima): Investigate if we can merge this and |OnLoginStateChanged|.
605 void UpdateAfterLoginStatusChange(LoginStatus status);
606
xdaid4913762017-07-06 00:17:22607 // Notifies observers that split view mode is about to be started (before the
608 // window gets snapped and activated).
609 void NotifySplitViewModeStarting();
610
Xiaoqian Daibf3771f2018-03-13 18:21:46611 // Notifies observers that split view mode has been started.
612 void NotifySplitViewModeStarted();
613
xdaid4913762017-07-06 00:17:22614 // Notifies observers that split view mode has ended.
615 void NotifySplitViewModeEnded();
616
sky00c813f2017-03-08 22:48:55617 // Notifies observers that fullscreen mode has changed for |root_window|.
varkhac71444e52017-05-25 22:51:34618 void NotifyFullscreenStateChanged(bool is_fullscreen,
619 aura::Window* root_window);
sky00c813f2017-03-08 22:48:55620
621 // Notifies observers that |pinned_window| changed its pinned window state.
varkha19d7e6c52017-05-25 21:15:30622 void NotifyPinnedStateChanged(aura::Window* pinned_window);
sky00c813f2017-03-08 22:48:55623
sky00c813f2017-03-08 22:48:55624 // Notifies observers that |root_window|'s shelf changed alignment.
625 // TODO(jamescook): Move to Shelf.
varkha6b016b0f2017-05-26 16:14:18626 void NotifyShelfAlignmentChanged(aura::Window* root_window);
sky00c813f2017-03-08 22:48:55627
628 // Notifies observers that |root_window|'s shelf changed auto-hide behavior.
629 // TODO(jamescook): Move to Shelf.
varkha6b016b0f2017-05-26 16:14:18630 void NotifyShelfAutoHideBehaviorChanged(aura::Window* root_window);
sky00c813f2017-03-08 22:48:55631
jamescook518dccbd2017-05-18 04:57:07632 // Used to provide better error messages for Shell::Get() under mash.
633 static void SetIsBrowserProcessWithMash();
634
[email protected]2b4cd302012-02-24 20:21:13635 private:
[email protected]c39be8f2012-06-15 22:58:36636 FRIEND_TEST_ALL_PREFIXES(ExtendedDesktopTest, TestCursor);
[email protected]1aad3322012-06-06 06:37:09637 FRIEND_TEST_ALL_PREFIXES(WindowManagerTest, MouseEventCursors);
638 FRIEND_TEST_ALL_PREFIXES(WindowManagerTest, TransformActivate);
sky79fa34712017-03-20 23:46:47639 friend class AcceleratorControllerTest;
Sam McNallya853cd82017-08-30 01:55:10640 friend class AshTestHelper;
[email protected]093b8d642014-04-03 20:59:28641 friend class RootWindowController;
sky27344382017-03-08 21:30:32642 friend class ScopedRootWindowForNewWindows;
James Cook317781a02017-07-18 02:08:06643 friend class ShellTestApi;
sky27344382017-03-08 21:30:32644 friend class SmsObserverTest;
[email protected]ad0c8722012-03-02 20:17:45645
skyb073203a2017-03-13 16:59:16646 Shell(std::unique_ptr<ShellDelegate> shell_delegate,
Scott Violete5c79f52018-07-31 00:10:17647 service_manager::Connector* connector);
dcheng1f4538e2014-10-27 23:57:05648 ~Shell() override;
[email protected]3266c2b92011-11-14 00:06:08649
Scott Violet7e33efc2018-08-29 22:30:15650 void Init(ui::ContextFactory* context_factory,
651 ui::ContextFactoryPrivate* context_factory_private,
652 std::unique_ptr<base::Value> initial_display_prefs,
Jun Mukaif2357792018-12-20 19:58:00653 std::unique_ptr<ws::GpuInterfaceProvider> gpu_interface_provider,
654 std::unique_ptr<keyboard::KeyboardUIFactory> keyboard_ui_factory);
[email protected]b0639282011-12-22 21:12:27655
Steven Bennetts7683e342018-01-02 21:29:52656 // Initializes the display manager and related components.
657 void InitializeDisplayManager();
658
[email protected]a273d33a2013-10-17 12:41:21659 // Initializes the root window so that it can host browser windows.
[email protected]41baaed2013-11-09 04:18:26660 void InitRootWindow(aura::Window* root_window);
[email protected]d90b8392012-06-13 09:34:56661
skyabcae812017-01-18 17:01:34662 // Destroys all child windows including widgets across all roots.
663 void CloseAllRootWindowChildWindows();
664
hariank0dd03dd2016-07-14 23:47:33665 // SystemModalContainerEventFilterDelegate:
dcheng1f4538e2014-10-27 23:57:05666 bool CanWindowReceiveEvents(aura::Window* window) override;
[email protected]c0ce80e2012-10-05 23:28:27667
[email protected]5097e69c2012-10-30 22:08:41668 // Overridden from ui::EventTarget:
dcheng1f4538e2014-10-27 23:57:05669 bool CanAcceptEvent(const ui::Event& event) override;
670 EventTarget* GetParentTarget() override;
dchenga94547472016-04-08 08:41:11671 std::unique_ptr<ui::EventTargetIterator> GetChildIterator() const override;
dcheng1f4538e2014-10-27 23:57:05672 ui::EventTargeter* GetEventTargeter() override;
[email protected]5097e69c2012-10-30 22:08:41673
Thiago Farina3b086a02017-05-30 22:32:50674 // wm::ActivationChangeObserver:
sky27344382017-03-08 21:30:32675 void OnWindowActivated(ActivationReason reason,
676 aura::Window* gained_active,
677 aura::Window* lost_active) override;
678
Xiyuan Xia22b1a6c2017-04-18 22:46:01679 // SessionObserver:
Steven Bennettsbadc3092018-05-24 21:26:01680 void OnFirstSessionStarted() override;
Xiyuan Xiab64fd0a2017-04-13 17:53:14681 void OnSessionStateChanged(session_manager::SessionState state) override;
682 void OnLoginStatusChanged(LoginStatus login_status) override;
683 void OnLockStateChanged(bool locked) override;
sky5ad143a2017-03-22 04:31:23684
Sam McNallyf4dab612017-08-16 03:06:33685 // Callback for prefs::ConnectToPrefService.
Sam McNallye36abbc2017-07-20 01:04:28686 void OnLocalStatePrefServiceInitialized(
687 std::unique_ptr<::PrefService> pref_service);
tibellb93c729b2017-03-30 00:45:09688
[email protected]cac10fc62011-10-07 23:22:56689 static Shell* instance_;
690
Scott Violetac410622018-08-11 18:33:22691 // |owned_aura_env_| is non-null if Shell created aura::Env. Shell creates
692 // aura::Env only in single-process-mash mode.
693 std::unique_ptr<aura::Env> owned_aura_env_;
694
695 // This is either |owned_aura_env_|, or Env::GetInstance().
696 aura::Env* aura_env_;
697
[email protected]1aad3322012-06-06 06:37:09698 // The CompoundEventFilter owned by aura::Env object.
dchenga94547472016-04-08 08:41:11699 std::unique_ptr<::wm::CompoundEventFilter> env_filter_;
[email protected]627a62f2012-02-14 22:59:14700
Mike Wassermanefbf3402018-04-26 00:41:32701 std::unique_ptr<EventRewriterController> event_rewriter_controller_;
702
dchenga94547472016-04-08 08:41:11703 std::unique_ptr<UserMetricsRecorder> user_metrics_recorder_;
dchenga94547472016-04-08 08:41:11704 std::unique_ptr<WindowPositioner> window_positioner_;
[email protected]2b99f8c2011-10-11 19:42:24705
sky81a2d792017-03-17 19:14:39706 std::unique_ptr<AcceleratorController> accelerator_controller_;
James Cookec144952017-09-01 00:05:16707 std::unique_ptr<AccessibilityController> accessibility_controller_;
sky07a24d42017-03-09 23:57:30708 std::unique_ptr<AccessibilityDelegate> accessibility_delegate_;
Qiang Xua9591002018-03-15 22:29:31709 std::unique_ptr<AccessibilityFocusRingController>
710 accessibility_focus_ring_controller_;
Jiaquan He4b48f912018-03-01 03:59:39711 std::unique_ptr<AppListControllerImpl> app_list_controller_;
Ryo Hashimotobac835a2019-02-26 03:04:28712 std::unique_ptr<ArcCustomTabController> arc_custom_tab_controller_;
Jeffrey Kardatzkef108f022018-04-17 17:52:35713 std::unique_ptr<AshDBusServices> ash_dbus_services_;
Scott Violetd64dac12017-06-02 21:50:08714 std::unique_ptr<AshDisplayController> ash_display_controller_;
David Black00fdce32018-05-10 20:59:14715 std::unique_ptr<AssistantController> assistant_controller_;
Toni Barzic9d0c82f42017-12-06 00:53:52716 std::unique_ptr<BacklightsForcedOffSetter> backlights_forced_off_setter_;
sky79fa34712017-03-20 23:46:47717 std::unique_ptr<BrightnessControlDelegate> brightness_control_delegate_;
718 std::unique_ptr<CastConfigController> cast_config_;
Steven Bennetts2a9b4382018-04-26 23:41:19719 std::unique_ptr<CrosDisplayConfig> cros_display_config_;
Scott Violete5c79f52018-07-31 00:10:17720 service_manager::Connector* const connector_;
Quan Nguyenaf67b64d2018-11-29 19:21:48721 std::unique_ptr<ContainedShellController> contained_shell_controller_;
Ahmed Fakhryc77ce402019-02-13 02:32:00722 std::unique_ptr<DesksController> desks_controller_;
Toni Barzicd6238312018-03-02 18:26:13723 std::unique_ptr<DetachableBaseHandler> detachable_base_handler_;
Toni Barzic550419f2018-03-08 03:56:21724 std::unique_ptr<DetachableBaseNotificationController>
725 detachable_base_notification_controller_;
Tetsui Ohkubo01421b32018-05-30 16:54:59726 std::unique_ptr<DisplaySpeakerController> display_speaker_controller_;
dchenga94547472016-04-08 08:41:11727 std::unique_ptr<DragDropController> drag_drop_controller_;
James Cookf5398842018-04-16 20:15:24728 std::unique_ptr<FirstRunHelper> first_run_helper_;
sky79fa34712017-03-20 23:46:47729 std::unique_ptr<FocusCycler> focus_cycler_;
James Cookf0c78fc2017-06-15 14:42:55730 std::unique_ptr<ImeController> ime_controller_;
Xiyuan Xia5f1046e2018-06-01 16:04:44731 std::unique_ptr<ImeFocusHandler> ime_focus_handler_;
Evan Stade1467204e2018-10-11 02:03:50732 std::unique_ptr<ImmersiveContext> immersive_context_;
sky79fa34712017-03-20 23:46:47733 std::unique_ptr<KeyboardBrightnessControlDelegate>
734 keyboard_brightness_control_delegate_;
Tatsuhisa Yamaguchi440e2d2e2018-12-05 09:16:31735 std::unique_ptr<LocaleUpdateController> locale_update_controller_;
Jacob Dufaultffd9b0d2017-11-15 23:07:16736 std::unique_ptr<LoginScreenController> login_screen_controller_;
sky79fa34712017-03-20 23:46:47737 std::unique_ptr<LogoutConfirmationController> logout_confirmation_controller_;
Mitsuru Oshima0e9b7a62017-07-19 18:23:03738 std::unique_ptr<TabletModeController> tablet_mode_controller_;
sky5ab16472017-03-21 19:35:08739 std::unique_ptr<MediaController> media_controller_;
Becca Hughesc6a0a062018-10-25 16:54:13740 std::unique_ptr<MediaNotificationController> media_notification_controller_;
sky5ab16472017-03-21 19:35:08741 std::unique_ptr<MruWindowTracker> mru_window_tracker_;
Kyle Horimoto9fc84fc22018-04-27 19:45:15742 std::unique_ptr<MultiDeviceNotificationPresenter>
743 multidevice_notification_presenter_;
sky5ab16472017-03-21 19:35:08744 std::unique_ptr<NewWindowController> new_window_controller_;
dchenga94547472016-04-08 08:41:11745 std::unique_ptr<ResizeShadowController> resize_shadow_controller_;
sky5ad143a2017-03-22 04:31:23746 std::unique_ptr<SessionController> session_controller_;
afakhrye4fae852017-05-09 18:49:06747 std::unique_ptr<NightLightController> night_light_controller_;
Vladislav Kaznacheev92edf62e2017-10-13 22:08:01748 std::unique_ptr<NoteTakingController> note_taking_controller_;
Qiang Xud8e897e2018-05-24 20:07:57749 std::unique_ptr<PolicyRecommendationRestorer> policy_recommendation_restorer_;
Tetsui Ohkubo54d50222018-05-10 01:58:11750 std::unique_ptr<ScreenSwitchCheckController> screen_switch_check_controller_;
sky5ad143a2017-03-22 04:31:23751 std::unique_ptr<ShelfController> shelf_controller_;
sky5ad143a2017-03-22 04:31:23752 std::unique_ptr<ShelfWindowWatcher> shelf_window_watcher_;
skyb073203a2017-03-13 16:59:16753 std::unique_ptr<ShellDelegate> shell_delegate_;
James Cook40f7d752018-05-25 18:21:58754 std::unique_ptr<ShellState> shell_state_;
sky5b45ed82017-03-27 02:54:23755 std::unique_ptr<ShutdownController> shutdown_controller_;
Tetsui Ohkubo269b5792018-04-26 01:06:32756 std::unique_ptr<SystemNotificationController> system_notification_controller_;
Tetsui Ohkubo21722932018-03-02 02:56:56757 std::unique_ptr<SystemTrayModel> system_tray_model_;
sky5b45ed82017-03-27 02:54:23758 std::unique_ptr<SystemTrayNotifier> system_tray_notifier_;
sky07a24d42017-03-09 23:57:30759 std::unique_ptr<ToastManager> toast_manager_;
Qiang Xuf1400a362017-09-14 02:28:30760 std::unique_ptr<TouchDevicesController> touch_devices_controller_;
Scott Violet3c554ae2017-12-13 02:25:41761 std::unique_ptr<TimeToFirstPresentRecorder> time_to_first_present_recorder_;
tbarzicc78da1ff92017-05-08 20:46:15762 std::unique_ptr<TrayAction> tray_action_;
Yue Lia33960a2017-11-01 22:06:07763 std::unique_ptr<VoiceInteractionController> voice_interaction_controller_;
sky5b45ed82017-03-27 02:54:23764 std::unique_ptr<VpnList> vpn_list_;
sky07a24d42017-03-09 23:57:30765 std::unique_ptr<WallpaperController> wallpaper_controller_;
sky5b45ed82017-03-27 02:54:23766 std::unique_ptr<WindowCycleController> window_cycle_controller_;
Sammie Quon80e82a12019-01-23 19:55:22767 std::unique_ptr<OverviewController> overview_controller_;
Scott Violet7dbdaeb2018-12-11 22:39:02768 // Owned by |focus_controller_|.
769 ::wm::FocusRules* focus_rules_ = nullptr;
dchenga94547472016-04-08 08:41:11770 std::unique_ptr<::wm::ShadowController> shadow_controller_;
771 std::unique_ptr<::wm::VisibilityController> visibility_controller_;
772 std::unique_ptr<::wm::WindowModalityController> window_modality_controller_;
Sam McNallya853cd82017-08-30 01:55:10773 std::unique_ptr<PrefService> local_state_;
dchenga94547472016-04-08 08:41:11774 std::unique_ptr<views::corewm::TooltipController> tooltip_controller_;
dchenga94547472016-04-08 08:41:11775 std::unique_ptr<PowerButtonController> power_button_controller_;
776 std::unique_ptr<LockStateController> lock_state_controller_;
dchenga94547472016-04-08 08:41:11777 std::unique_ptr<ui::UserActivityDetector> user_activity_detector_;
778 std::unique_ptr<VideoDetector> video_detector_;
Scott Violet737fb752018-04-11 15:35:22779 std::unique_ptr<WaylandServerController> wayland_server_controller_;
Scott Violetb7f4df22018-05-17 04:43:12780 std::unique_ptr<WindowServiceOwner> window_service_owner_;
dchenga94547472016-04-08 08:41:11781 std::unique_ptr<WindowTreeHostManager> window_tree_host_manager_;
Qiang Xud77a90c2018-02-20 19:43:29782 std::unique_ptr<PersistentWindowController> persistent_window_controller_;
dchenga94547472016-04-08 08:41:11783 std::unique_ptr<HighContrastController> high_contrast_controller_;
784 std::unique_ptr<MagnificationController> magnification_controller_;
dchenga94547472016-04-08 08:41:11785 std::unique_ptr<AutoclickController> autoclick_controller_;
sky27344382017-03-08 21:30:32786 std::unique_ptr<::wm::FocusController> focus_controller_;
sky984c1892016-04-20 00:00:34787
oshima5a296e82016-04-29 01:32:27788 std::unique_ptr<ScreenshotController> screenshot_controller_;
[email protected]f5c9dbc2014-04-11 08:13:45789
dchenga94547472016-04-08 08:41:11790 std::unique_ptr<MouseCursorEventFilter> mouse_cursor_filter_;
791 std::unique_ptr<ScreenPositionController> screen_position_controller_;
792 std::unique_ptr<SystemModalContainerEventFilter> modality_filter_;
793 std::unique_ptr<EventClientImpl> event_client_;
794 std::unique_ptr<EventTransformationHandler> event_transformation_handler_;
[email protected]ae18b9112011-11-07 16:59:13795
[email protected]0b0b0742012-02-16 13:23:45796 // An event filter that pre-handles key events while the partial
[email protected]a1584a712012-07-30 21:02:26797 // screenshot UI or the keyboard overlay is active.
dchenga94547472016-04-08 08:41:11798 std::unique_ptr<OverlayEventFilter> overlay_filter_;
[email protected]0b0b0742012-02-16 13:23:45799
[email protected]3537d472014-01-15 05:45:31800 // An event filter which handles moving and resizing windows.
dchenga94547472016-04-08 08:41:11801 std::unique_ptr<ToplevelWindowEventHandler> toplevel_window_event_handler_;
[email protected]3537d472014-01-15 05:45:31802
[email protected]435b212e2012-04-05 19:43:37803 // An event filter which handles system level gestures
dchenga94547472016-04-08 08:41:11804 std::unique_ptr<SystemGestureEventFilter> system_gesture_filter_;
[email protected]435b212e2012-04-05 19:43:37805
[email protected]745816be2011-11-22 05:08:30806 // An event filter that pre-handles global accelerators.
dchenga94547472016-04-08 08:41:11807 std::unique_ptr<::wm::AcceleratorFilter> accelerator_filter_;
[email protected]745816be2011-11-22 05:08:30808
rjkroege72f8154f2016-10-29 00:49:02809 std::unique_ptr<display::DisplayManager> display_manager_;
Steven Bennetts3688c6032018-04-13 01:14:23810 std::unique_ptr<DisplayPrefs> display_prefs_;
dchenga94547472016-04-08 08:41:11811 std::unique_ptr<DisplayConfigurationController>
812 display_configuration_controller_;
Steven Bennetts9b21fa32018-04-13 23:45:55813 std::unique_ptr<DisplayConfigurationObserver> display_configuration_observer_;
[email protected]6bdf7952012-11-14 10:10:58814
hidehiko6821ca42016-06-18 11:12:23815 std::unique_ptr<ScreenPinningController> screen_pinning_controller_;
[email protected]a9a40462013-07-31 06:22:56816
Sammie Quon95c6a1c2017-09-12 19:16:55817 std::unique_ptr<PeripheralBatteryNotifier> peripheral_battery_notifier_;
dchenga94547472016-04-08 08:41:11818 std::unique_ptr<PowerEventObserver> power_event_observer_;
Qiang Xu36234e532018-04-11 04:54:02819 std::unique_ptr<PowerPrefs> power_prefs_;
dchenga94547472016-04-08 08:41:11820 std::unique_ptr<ui::UserActivityPowerManagerNotifier> user_activity_notifier_;
821 std::unique_ptr<VideoActivityNotifier> video_activity_notifier_;
822 std::unique_ptr<StickyKeysController> sticky_keys_controller_;
823 std::unique_ptr<ResolutionNotificationController>
[email protected]7bc49bd2014-01-22 09:30:34824 resolution_notification_controller_;
dchenga94547472016-04-08 08:41:11825 std::unique_ptr<BluetoothNotificationController>
[email protected]b31427252014-03-04 06:59:50826 bluetooth_notification_controller_;
Sonny Sasaka55f69fc2017-08-28 21:29:37827 std::unique_ptr<BluetoothPowerController> bluetooth_power_controller_;
jamescookac6724332017-03-21 02:54:43828 std::unique_ptr<TrayBluetoothHelper> tray_bluetooth_helper_;
Steven Bennettsa0ea30942018-10-11 22:27:51829 std::unique_ptr<AshKeyboardController> ash_keyboard_controller_;
[email protected]70b3e7d52012-06-02 22:12:25830 // Controls video output device state.
Scott Violetbed23cb2018-08-22 19:56:12831 std::unique_ptr<DisplayOutputProtection> display_output_protection_;
dchenga94547472016-04-08 08:41:11832 std::unique_ptr<DisplayColorManager> display_color_manager_;
833 std::unique_ptr<DisplayErrorObserver> display_error_observer_;
834 std::unique_ptr<ProjectingObserver> projecting_observer_;
[email protected]6bdf7952012-11-14 10:10:58835
[email protected]c1234a42013-08-20 09:35:40836 // Listens for output changes and updates the display manager.
kylecharf2e4e412016-12-04 04:21:35837 std::unique_ptr<display::DisplayChangeObserver> display_change_observer_;
[email protected]3dff2efd2014-02-09 22:50:39838
kylechar98748a52016-12-03 01:33:22839 // Listens for shutdown and updates DisplayConfigurator.
Steven Bennetts7683e342018-01-02 21:29:52840 std::unique_ptr<DisplayShutdownObserver> display_shutdown_observer_;
kylechar98748a52016-12-03 01:33:22841
yiyix90cfee22017-02-16 05:38:18842 // Listens for new sms messages and shows notifications.
843 std::unique_ptr<SmsObserver> sms_observer_;
844
derat94887a22017-01-20 18:17:25845 // Implements content::ScreenOrientationController for Chrome OS.
dchenga94547472016-04-08 08:41:11846 std::unique_ptr<ScreenOrientationController> screen_orientation_controller_;
yiyixa68ade512016-09-01 17:38:13847 std::unique_ptr<ScreenLayoutObserver> screen_layout_observer_;
jonrossf21fea12014-11-13 01:22:51848
kylechar55f0eaf22017-01-11 22:57:37849 std::unique_ptr<AshTouchTransformController> touch_transformer_controller_;
dnicoara8c3bd1e62014-10-30 19:53:39850
dchenga94547472016-04-08 08:41:11851 std::unique_ptr<ui::EventHandler> magnifier_key_scroll_handler_;
852 std::unique_ptr<ui::EventHandler> speech_feedback_handler_;
sammiequon203ae022016-09-18 17:23:42853 std::unique_ptr<LaserPointerController> laser_pointer_controller_;
854 std::unique_ptr<PartialMagnificationController>
855 partial_magnification_controller_;
Vladislav Kaznacheev6d6aaff2017-07-22 04:06:32856 std::unique_ptr<HighlighterController> highlighter_controller_;
[email protected]70b3e7d52012-06-02 22:12:25857
Ahmed Fakhry4bf3f742018-02-06 17:33:36858 std::unique_ptr<DockedMagnifierController> docked_magnifier_controller_;
859
xdaid4913762017-07-06 00:17:22860 // The split view controller for Chrome OS in tablet mode.
861 std::unique_ptr<SplitViewController> split_view_controller_;
862
[email protected]c0ff0342013-02-27 00:41:29863 // |native_cursor_manager_| is owned by |cursor_manager_|, but we keep a
864 // pointer to vend to test code.
erg36cfb952017-06-21 19:41:45865 NativeCursorManagerAsh* native_cursor_manager_;
[email protected]e76096a5f2014-04-08 04:08:03866
derat94887a22017-01-20 18:17:25867 // Cursor may be hidden on certain key events in Chrome OS, whereas we never
sadrul7a8785e2016-02-12 21:54:35868 // hide the cursor on Windows.
dchenga94547472016-04-08 08:41:11869 std::unique_ptr<::wm::CursorManager> cursor_manager_;
[email protected]4b8003c2012-07-26 00:54:19870
David Tseng6792dc82018-05-04 19:18:41871 // Enables spoken feedback accessibility based on a press and hold of both
872 // volume keys.
873 std::unique_ptr<KeyAccessibilityEnabler> key_accessibility_enabler_;
874
[email protected]852a55d2012-10-17 13:30:30875 // For testing only: simulate that a modal window is open
James Cook7b7c6a52018-01-04 23:40:03876 bool simulate_modal_window_open_for_test_ = false;
[email protected]852a55d2012-10-17 13:30:30877
Evan Stade2c43a87b32017-08-31 17:53:10878 std::unique_ptr<MessageCenterController> message_center_controller_;
879
Abhishek Bhardwaj62aeaad62019-02-28 08:49:34880 std::unique_ptr<NotificationReporter> notification_reporter_;
881
Trent Apteda250ec3ab2018-08-19 08:52:19882 base::ObserverList<ShellObserver>::Unchecked shell_observers_;
sky00c813f2017-03-08 22:48:55883
Sam McNallye36abbc2017-07-20 01:04:28884 base::WeakPtrFactory<Shell> weak_factory_;
885
[email protected]87b0d82e2011-10-07 21:02:59886 DISALLOW_COPY_AND_ASSIGN(Shell);
887};
888
[email protected]55f593352011-12-24 05:42:46889} // namespace ash
[email protected]87b0d82e2011-10-07 21:02:59890
[email protected]b65bdda2011-12-23 23:35:31891#endif // ASH_SHELL_H_