blob: e02811f585f7a032f9f72255027a0b855fe4df9b [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"
Jiaquan He20785d5e2018-04-30 21:30:1414#include "ash/public/cpp/app_list/app_list_constants.h"
jamescookd4649fa2016-09-30 17:50:0915#include "ash/public/cpp/shelf_types.h"
Xiyuan Xia22b1a6c2017-04-18 22:46:0116#include "ash/session/session_observer.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"
[email protected]c9390bd2013-11-08 20:33:1323#include "ui/aura/window.h"
James Cookfa4838e2018-08-08 16:30:1524#include "ui/base/ui_base_types.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 {
Scott Violetac410622018-08-11 18:33:2234class Env;
[email protected]35304ce2011-12-14 23:21:0135class RootWindow;
[email protected]87b0d82e2011-10-07 21:02:5936class Window;
Alex Newcomer8fdcb9342017-08-08 18:48:4437} // namespace aura
[email protected]fa4a45832012-04-12 21:32:4838
rjkroege72f8154f2016-10-29 00:49:0239namespace display {
kylecharf2e4e412016-12-04 04:21:3540class DisplayChangeObserver;
kylechar7a067ec2017-01-07 01:16:2841class DisplayConfigurator;
rjkroege72f8154f2016-10-29 00:49:0242class DisplayManager;
Alex Newcomer8fdcb9342017-08-08 18:48:4443} // namespace display
rjkroege72f8154f2016-10-29 00:49:0244
Scott Violet737fb752018-04-11 15:35:2245namespace exo {
46class FileHelper;
Scott Violet737fb752018-04-11 15:35:2247} // namespace exo
48
[email protected]2b99f8c2011-10-11 19:42:2449namespace gfx {
sky4ec2be82017-01-06 17:38:3250class Insets;
James Cookfa4838e2018-08-08 16:30:1551class Point;
[email protected]cac10fc62011-10-07 23:22:5652}
[email protected]b6ba05d902013-10-04 21:38:4553
Scott Violet6c0eb6962018-06-20 01:31:2654namespace service_manager {
55class Connector;
56}
57
[email protected]a8bd1cb2012-02-17 23:05:5458namespace ui {
Scott Violetc8a1c6c2017-11-29 23:17:3659class ContextFactory;
60class ContextFactoryPrivate;
derat2d4e62d2015-01-09 16:09:1761class UserActivityDetector;
[email protected]b0fa7012014-04-16 12:50:5762class UserActivityPowerManagerNotifier;
Alex Newcomer8fdcb9342017-08-08 18:48:4463} // namespace ui
thanhph3f3968512017-06-21 00:37:2364
[email protected]57b8bb352012-01-11 05:11:4665namespace views {
66class NonClientFrameView;
[email protected]57b8bb352012-01-11 05:11:4667class Widget;
[email protected]4a59e4e92012-11-12 21:15:4068namespace corewm {
[email protected]e319c7e2014-03-14 19:56:1469class TooltipController;
70}
Alex Newcomer8fdcb9342017-08-08 18:48:4471} // namespace views
[email protected]e319c7e2014-03-14 19:56:1472
73namespace wm {
[email protected]60d677d2014-05-30 13:07:0274class AcceleratorFilter;
Thiago Farina3b086a02017-05-30 22:32:5075class ActivationClient;
[email protected]4a59e4e92012-11-12 21:15:4076class CompoundEventFilter;
sky27344382017-03-08 21:30:3277class FocusController;
Scott Violet7dbdaeb2018-12-11 22:39:0278class FocusRules;
[email protected]86f2b5e2012-11-14 20:37:0079class ShadowController;
[email protected]b5756e22012-11-30 01:32:0280class VisibilityController;
[email protected]0c2dc012012-12-02 00:00:2381class WindowModalityController;
Alex Newcomer8fdcb9342017-08-08 18:48:4482} // namespace wm
[email protected]87b0d82e2011-10-07 21:02:5983
Scott Violet7e33efc2018-08-29 22:30:1584namespace ws {
85class GpuInterfaceProvider;
86}
87
[email protected]55f593352011-12-24 05:42:4688namespace ash {
[email protected]87b0d82e2011-10-07 21:02:5989
sky81a2d792017-03-17 19:14:3990class AcceleratorController;
James Cookec144952017-09-01 00:05:1691class AccessibilityController;
sky07a24d42017-03-09 23:57:3092class AccessibilityDelegate;
Qiang Xua9591002018-03-15 22:29:3193class AccessibilityFocusRingController;
Jeffrey Kardatzkef108f022018-04-17 17:52:3594class AshDBusServices;
Scott Violetd64dac12017-06-02 21:50:0895class AshDisplayController;
Jiaquan He4b48f912018-03-01 03:59:3996class AppListControllerImpl;
erg36cfb952017-06-21 19:41:4597class NativeCursorManagerAsh;
sky07a24d42017-03-09 23:57:3098class AshTouchTransformController;
David Black00fdce32018-05-10 20:59:1499class AssistantController;
[email protected]55398d2c2013-10-10 19:49:20100class AutoclickController;
Toni Barzic9d0c82f42017-12-06 00:53:52101class BacklightsForcedOffSetter;
[email protected]b31427252014-03-04 06:59:50102class BluetoothNotificationController;
Sonny Sasaka55f69fc2017-08-28 21:29:37103class BluetoothPowerController;
sky79fa34712017-03-20 23:46:47104class BrightnessControlDelegate;
105class CastConfigController;
Scott Violetbed23cb2018-08-22 19:56:12106class DisplayOutputProtection;
Quan Nguyenaf67b64d2018-11-29 19:21:48107class ContainedShellController;
Steven Bennetts2a9b4382018-04-26 23:41:19108class CrosDisplayConfig;
Toni Barzicd6238312018-03-02 18:26:13109class DetachableBaseHandler;
Toni Barzic550419f2018-03-08 03:56:21110class DetachableBaseNotificationController;
robert.bradfordab052492015-05-06 11:09:56111class DisplayColorManager;
stevenjb537c5c3f2016-01-20 23:38:12112class DisplayConfigurationController;
Steven Bennetts9b21fa32018-04-13 23:45:55113class DisplayConfigurationObserver;
[email protected]18b21b2e2013-03-01 20:56:23114class DisplayErrorObserver;
Steven Bennetts3688c6032018-04-13 01:14:23115class DisplayPrefs;
Steven Bennetts7683e342018-01-02 21:29:52116class DisplayShutdownObserver;
Tetsui Ohkubo01421b32018-05-30 16:54:59117class DisplaySpeakerController;
Ahmed Fakhry4bf3f742018-02-06 17:33:36118class DockedMagnifierController;
[email protected]084b6bb2011-11-17 05:18:16119class DragDropController;
[email protected]e67291f12012-10-10 05:52:38120class EventClientImpl;
Mike Wassermanefbf3402018-04-26 00:41:32121class EventRewriterController;
[email protected]682990f2013-01-10 06:49:11122class EventTransformationHandler;
James Cookf5398842018-04-16 20:15:24123class FirstRunHelper;
sky79fa34712017-03-20 23:46:47124class FocusCycler;
[email protected]093b8d642014-04-03 20:59:28125class HighContrastController;
Vladislav Kaznacheev6d6aaff2017-07-22 04:06:32126class HighlighterController;
James Cookbb026732017-06-09 23:01:55127class ImeController;
Xiyuan Xia5f1046e2018-06-01 16:04:44128class ImeFocusHandler;
Evan Stade1467204e2018-10-11 02:03:50129class ImmersiveContext;
David Tseng6792dc82018-05-04 19:18:41130class KeyAccessibilityEnabler;
sky79fa34712017-03-20 23:46:47131class KeyboardBrightnessControlDelegate;
Steven Bennettsa0ea30942018-10-11 22:27:51132class AshKeyboardController;
sammiequon203ae022016-09-18 17:23:42133class LaserPointerController;
Tatsuhisa Yamaguchi440e2d2e2018-12-05 09:16:31134class LocaleUpdateController;
[email protected]093b8d642014-04-03 20:59:28135class LockStateController;
sky79fa34712017-03-20 23:46:47136class LogoutConfirmationController;
Jacob Dufaultffd9b0d2017-11-15 23:07:16137class LoginScreenController;
[email protected]093b8d642014-04-03 20:59:28138class MagnificationController;
Mitsuru Oshima0e9b7a62017-07-19 18:23:03139class TabletModeController;
sky5ab16472017-03-21 19:35:08140class MediaController;
Becca Hughesc6a0a062018-10-25 16:54:13141class MediaNotificationController;
Evan Stade2c43a87b32017-08-31 17:53:10142class MessageCenterController;
[email protected]78d9630c2012-06-22 00:58:07143class MouseCursorEventFilter;
sky5ab16472017-03-21 19:35:08144class MruWindowTracker;
Kyle Horimoto9fc84fc22018-04-27 19:45:15145class MultiDeviceNotificationPresenter;
sky5ab16472017-03-21 19:35:08146class NewWindowController;
afakhrye4fae852017-05-09 18:49:06147class NightLightController;
Vladislav Kaznacheev92edf62e2017-10-13 22:08:01148class NoteTakingController;
[email protected]9ae32df2012-07-26 03:25:18149class OverlayEventFilter;
[email protected]093b8d642014-04-03 20:59:28150class PartialMagnificationController;
Sammie Quon95c6a1c2017-09-12 19:16:55151class PeripheralBatteryNotifier;
Qiang Xud77a90c2018-02-20 19:43:29152class PersistentWindowController;
Qiang Xud8e897e2018-05-24 20:07:57153class PolicyRecommendationRestorer;
[email protected]093b8d642014-04-03 20:59:28154class PowerButtonController;
[email protected]51625052013-10-10 01:40:16155class PowerEventObserver;
Qiang Xu36234e532018-04-11 04:54:02156class PowerPrefs;
[email protected]72bce522014-02-10 21:11:26157class ProjectingObserver;
[email protected]e4a181cc2012-03-17 02:20:57158class ResizeShadowController;
[email protected]6ef71d72013-08-10 18:13:44159class ResolutionNotificationController;
[email protected]d90b8392012-06-13 09:34:56160class RootWindowController;
jamescookac6724332017-03-21 02:54:43161class ScreenLayoutObserver;
jonross0af45212015-01-13 18:55:46162class ScreenOrientationController;
oshima5a296e82016-04-29 01:32:27163class ScreenshotController;
hidehiko6821ca42016-06-18 11:12:23164class ScreenPinningController;
[email protected]8d625fb2012-07-18 16:40:06165class ScreenPositionController;
Tetsui Ohkubo54d50222018-05-10 01:58:11166class ScreenSwitchCheckController;
sky5ad143a2017-03-22 04:31:23167class SessionController;
sky5ad143a2017-03-22 04:31:23168class ShelfController;
sky5ad143a2017-03-22 04:31:23169class ShelfModel;
170class ShelfWindowWatcher;
skyb073203a2017-03-13 16:59:16171class ShellDelegate;
[email protected]1b4c7472014-05-15 18:32:23172struct ShellInitParams;
sky00c813f2017-03-08 22:48:55173class ShellObserver;
James Cook40f7d752018-05-25 18:21:58174class ShellState;
sky5b45ed82017-03-27 02:54:23175class ShutdownController;
yiyix90cfee22017-02-16 05:38:18176class SmsObserver;
xdaid4913762017-07-06 00:17:22177class SplitViewController;
[email protected]093b8d642014-04-03 20:59:28178class StickyKeysController;
[email protected]9ae32df2012-07-26 03:25:18179class SystemGestureEventFilter;
[email protected]c0ce80e2012-10-05 23:28:27180class SystemModalContainerEventFilter;
Tetsui Ohkubo269b5792018-04-26 01:06:32181class SystemNotificationController;
Tetsui Ohkubo21722932018-03-02 02:56:56182class SystemTrayModel;
sky5b45ed82017-03-27 02:54:23183class SystemTrayNotifier;
Scott Violet3c554ae2017-12-13 02:25:41184class TimeToFirstPresentRecorder;
[email protected]093b8d642014-04-03 20:59:28185class ToplevelWindowEventHandler;
sky07a24d42017-03-09 23:57:30186class ToastManager;
Qiang Xuf1400a362017-09-14 02:28:30187class TouchDevicesController;
tbarzicc78da1ff92017-05-08 20:46:15188class TrayAction;
jamescookac6724332017-03-21 02:54:43189class TrayBluetoothHelper;
[email protected]ded58fd2013-10-09 07:56:55190class VideoActivityNotifier;
[email protected]093b8d642014-04-03 20:59:28191class VideoDetector;
Yue Lia33960a2017-11-01 22:06:07192class VoiceInteractionController;
sky5b45ed82017-03-27 02:54:23193class VpnList;
sky07a24d42017-03-09 23:57:30194class WallpaperController;
Scott Violet737fb752018-04-11 15:35:22195class WaylandServerController;
Scott Violetb7f4df22018-05-17 04:43:12196class WindowServiceOwner;
sky5b45ed82017-03-27 02:54:23197class WindowCycleController;
[email protected]093b8d642014-04-03 20:59:28198class WindowPositioner;
sky5b45ed82017-03-27 02:54:23199class WindowSelectorController;
msw607227f82016-08-30 17:22:39200class WindowTreeHostManager;
[email protected]2b99f8c2011-10-11 19:42:24201
sky494c6cbd2017-03-27 20:57:48202enum class LoginStatus;
203
[email protected]87b0d82e2011-10-07 21:02:59204// Shell is a singleton object that presents the Shell API and implements the
[email protected]99f07e02011-12-07 00:02:59205// RootWindow's delegate interface.
[email protected]b0079a92012-01-25 20:13:38206//
207// Upon creation, the Shell sets itself as the RootWindow's delegate, which
208// takes ownership of the Shell.
Xiyuan Xia22b1a6c2017-04-18 22:46:01209class ASH_EXPORT Shell : public SessionObserver,
sky5ad143a2017-03-22 04:31:23210 public SystemModalContainerEventFilterDelegate,
sky27344382017-03-08 21:30:32211 public ui::EventTarget,
Thiago Farina3b086a02017-05-30 22:32:50212 public ::wm::ActivationChangeObserver {
[email protected]87b0d82e2011-10-07 21:02:59213 public:
[email protected]093b8d642014-04-03 20:59:28214 typedef std::vector<RootWindowController*> RootWindowControllerList;
[email protected]be65be362012-06-15 07:38:23215
Scott Violetc8a1c6c2017-11-29 23:17:36216 // Creates the single Shell instance.
217 static Shell* CreateInstance(ShellInitParams init_params);
[email protected]3266c2b92011-11-14 00:06:08218
219 // Should never be called before |CreateInstance()|.
skyb073203a2017-03-13 16:59:16220 static Shell* Get();
[email protected]3266c2b92011-11-14 00:06:08221
[email protected]b3b7bcd2012-03-06 19:35:45222 // Returns true if the ash shell has been instantiated.
223 static bool HasInstance();
224
[email protected]ef589af2011-12-03 01:07:15225 static void DeleteInstance();
[email protected]cac10fc62011-10-07 23:22:56226
[email protected]d90b8392012-06-13 09:34:56227 // Returns the root window controller for the primary root window.
[email protected]a0afeb12012-12-10 22:57:09228 // TODO(oshima): move this to |RootWindowController|
[email protected]093b8d642014-04-03 20:59:28229 static RootWindowController* GetPrimaryRootWindowController();
[email protected]d90b8392012-06-13 09:34:56230
thanhphc90f49ca2017-03-03 17:48:53231 // Returns the RootWindowController for the given display id. If there
232 // is no display for |display_id|, null is returned.
233 static RootWindowController* GetRootWindowControllerWithDisplayId(
234 int64_t display_id);
235
Scott Violet596bb46342017-06-21 14:43:13236 // Returns the root Window for the given display id. If there is no display
237 // for |display_id| null is returned.
238 static aura::Window* GetRootWindowForDisplayId(int64_t display_id);
239
[email protected]cf1c70e2012-08-30 01:13:02240 // Returns all root window controllers.
[email protected]a0afeb12012-12-10 22:57:09241 // TODO(oshima): move this to |RootWindowController|
[email protected]be65be362012-06-15 07:38:23242 static RootWindowControllerList GetAllRootWindowControllers();
243
[email protected]bf9cdb362013-10-25 19:22:45244 // Returns the primary root Window. The primary root Window is the one that
245 // has a launcher.
246 static aura::Window* GetPrimaryRootWindow();
[email protected]e73bd7802012-02-17 20:10:34247
sky27344382017-03-08 21:30:32248 // Returns the root window that newly created windows should be added to.
249 // Value can be temporarily overridden using ScopedRootWindowForNewWindows.
250 // NOTE: this returns the root, newly created window should be added to the
251 // appropriate container in the returned window.
252 static aura::Window* GetRootWindowForNewWindows();
mfomitcheva1a8aa62016-05-03 16:23:26253
[email protected]cf1c70e2012-08-30 01:13:02254 // Returns all root windows.
[email protected]c9390bd2013-11-08 20:33:13255 static aura::Window::Windows GetAllRootWindows();
[email protected]be65be362012-06-15 07:38:23256
[email protected]bf9cdb362013-10-25 19:22:45257 static aura::Window* GetContainer(aura::Window* root_window,
[email protected]7b0f7502012-06-11 00:12:39258 int container_id);
[email protected]bf9cdb362013-10-25 19:22:45259 static const aura::Window* GetContainer(const aura::Window* root_window,
[email protected]e67291f12012-10-10 05:52:38260 int container_id);
[email protected]7b0f7502012-06-11 00:12:39261
James Cook7b7c6a52018-01-04 23:40:03262 // If a system-modal dialog window is currently open, returns the ID of the
263 // system modal window container that contains the window.
264 // If no system-modal dialogs are open it returns -1.
265 static int GetOpenSystemModalWindowContainerId();
266
267 // Returns true if a system-modal dialog window is currently open.
268 static bool IsSystemModalWindowOpen();
269
Scott Violet25848c12018-12-14 18:29:15270 // Returns true if |window| is a proxy window. A proxy window is a window that
271 // was created by way of a WindowService client (e.g. the keyboard shortcut
272 // viewer app under classic ash, or a browser window under mash).
273 static bool IsProxyWindow(aura::Window* window);
James Cooka6066972018-07-31 19:34:07274
Wenzhao Zang56c292932017-08-02 04:58:34275 // Registers all ash related local state prefs to the given |registry|.
Steven Bennettsca108512018-05-02 11:05:03276 static void RegisterLocalStatePrefs(PrefRegistrySimple* registry,
277 bool for_test);
Wenzhao Zang56c292932017-08-02 04:58:34278
Qiang Xu36234e532018-04-11 04:54:02279 // Registers all ash related signin/user profile prefs to the given
280 // |registry|. Can be called before Shell is initialized. When |for_test| is
281 // true this registers foreign user profile prefs (e.g. chrome prefs) as if
282 // they are owned by ash. This allows test code to read the pref values.
283 static void RegisterSigninProfilePrefs(PrefRegistrySimple* registry,
284 bool for_test = false);
285 static void RegisterUserProfilePrefs(PrefRegistrySimple* registry,
286 bool for_test = false);
afakhrye4fae852017-05-09 18:49:06287
Scott Violet737fb752018-04-11 15:35:22288 // If necessary, initializes the Wayland server.
Xiyuan Xia36197372018-04-25 00:45:17289 void InitWaylandServer(std::unique_ptr<exo::FileHelper> file_helper);
Scott Violet737fb752018-04-11 15:35:22290 void DestroyWaylandServer();
291
[email protected]57b8bb352012-01-11 05:11:46292 // Creates a default views::NonClientFrameView for use by windows in the
293 // Ash environment.
294 views::NonClientFrameView* CreateDefaultNonClientFrameView(
295 views::Widget* widget);
296
mswad28b252016-08-09 02:42:07297 // Sets work area insets of the display containing |window|, pings observers.
[email protected]2e236a52012-06-27 22:21:47298 void SetDisplayWorkAreaInsets(aura::Window* window,
[email protected]8a45c972012-03-14 18:22:44299 const gfx::Insets& insets);
[email protected]1a2145b2012-03-13 21:09:17300
[email protected]58868abf2014-01-17 23:45:33301 // Called when a casting session is started or stopped.
302 void OnCastingSessionStartedOrStopped(bool started);
303
[email protected]0e3e7cb2014-04-12 05:18:25304 // Called when a root window is created.
varkhac71444e52017-05-25 22:51:34305 void OnRootWindowAdded(aura::Window* root_window);
[email protected]0e3e7cb2014-04-12 05:18:25306
Zach Helfinsteinbbb6bad2018-05-02 18:21:51307 // Called when dictation is activated.
308 void OnDictationStarted();
309
310 // Called when dictation is ended.
311 void OnDictationEnded();
312
Darren Shenad5dc722018-05-28 00:14:45313 // Enables the keyboard and associate it with the primary root window
314 // controller.
Darren Shenf62db77a2018-06-07 06:22:44315 void EnableKeyboard();
[email protected]51f438112013-11-18 19:32:50316
Darren Shenad5dc722018-05-28 00:14:45317 // Hides and disables the virtual keyboard.
Darren Shenf62db77a2018-06-07 06:22:44318 void DisableKeyboard();
[email protected]e1b299b2014-01-29 23:53:41319
Mitsuru Oshima0e9b7a62017-07-19 18:23:03320 // Test if TabletModeWindowManager is not enabled, and if
321 // TabletModeController is not currently setting a display rotation. Or if
[email protected]da285852014-05-27 19:53:43322 // the |resolution_notification_controller_| is not showing its confirmation
323 // dialog. If true then changes to display settings can be saved.
324 bool ShouldSaveDisplaySettings();
[email protected]da285852014-05-27 19:53:43325
sky81a2d792017-03-17 19:14:39326 AcceleratorController* accelerator_controller() {
327 return accelerator_controller_.get();
sky44a09892016-07-20 17:46:58328 }
James Cookec144952017-09-01 00:05:16329 AccessibilityController* accessibility_controller() {
330 return accessibility_controller_.get();
331 }
sky07a24d42017-03-09 23:57:30332 AccessibilityDelegate* accessibility_delegate() {
333 return accessibility_delegate_.get();
334 }
Qiang Xua9591002018-03-15 22:29:31335 AccessibilityFocusRingController* accessibility_focus_ring_controller() {
336 return accessibility_focus_ring_controller_.get();
337 }
Qiang Xuf1400a362017-09-14 02:28:30338 ::wm::ActivationClient* activation_client();
Jiaquan He4b48f912018-03-01 03:59:39339 AppListControllerImpl* app_list_controller() {
340 return app_list_controller_.get();
341 }
Scott Violetd64dac12017-06-02 21:50:08342 AshDisplayController* ash_display_controller() {
343 return ash_display_controller_.get();
344 }
David Black00fdce32018-05-10 20:59:14345 AssistantController* assistant_controller() {
346 DCHECK(chromeos::switches::IsAssistantEnabled());
347 return assistant_controller_.get();
348 }
Qiang Xuf1400a362017-09-14 02:28:30349 AutoclickController* autoclick_controller() {
350 return autoclick_controller_.get();
351 }
Daniel Erat477c56d2017-12-13 21:42:54352 BacklightsForcedOffSetter* backlights_forced_off_setter() {
353 return backlights_forced_off_setter_.get();
354 }
Qiang Xuf1400a362017-09-14 02:28:30355 BluetoothPowerController* bluetooth_power_controller() {
356 return bluetooth_power_controller_.get();
357 }
sky79fa34712017-03-20 23:46:47358 BrightnessControlDelegate* brightness_control_delegate() {
359 return brightness_control_delegate_.get();
360 }
361 CastConfigController* cast_config() { return cast_config_.get(); }
Scott Violet6c0eb6962018-06-20 01:31:26362 service_manager::Connector* connector() { return connector_; }
Quan Nguyenaf67b64d2018-11-29 19:21:48363 ContainedShellController* contained_shell_controller() {
364 return contained_shell_controller_.get();
365 }
Steven Bennetts2a9b4382018-04-26 23:41:19366 CrosDisplayConfig* cros_display_config() {
367 return cros_display_config_.get();
368 }
Qiang Xuf1400a362017-09-14 02:28:30369 ::wm::CursorManager* cursor_manager() { return cursor_manager_.get(); }
Toni Barzicd6238312018-03-02 18:26:13370 DetachableBaseHandler* detachable_base_handler() {
371 return detachable_base_handler_.get();
372 }
373
rjkroege72f8154f2016-10-29 00:49:02374 display::DisplayManager* display_manager() { return display_manager_.get(); }
Steven Bennetts3688c6032018-04-13 01:14:23375 DisplayPrefs* display_prefs() { return display_prefs_.get(); }
stevenjb537c5c3f2016-01-20 23:38:12376 DisplayConfigurationController* display_configuration_controller() {
377 return display_configuration_controller_.get();
378 }
Qiang Xuf1400a362017-09-14 02:28:30379
380 // TODO(oshima): Move these objects to WindowTreeHostManager.
381 display::DisplayConfigurator* display_configurator() {
382 return display_configurator_.get();
383 }
Ahmed Fakhry46357342018-04-27 00:46:11384 DisplayColorManager* display_color_manager() {
385 return display_color_manager_.get();
386 }
Qiang Xuf1400a362017-09-14 02:28:30387 DisplayErrorObserver* display_error_observer() {
388 return display_error_observer_.get();
389 }
Scott Violetbed23cb2018-08-22 19:56:12390 DisplayOutputProtection* display_output_protection() {
391 return display_output_protection_.get();
392 }
Qiang Xuf1400a362017-09-14 02:28:30393
Ahmed Fakhry4bf3f742018-02-06 17:33:36394 DockedMagnifierController* docked_magnifier_controller();
Scott Violetac410622018-08-11 18:33:22395 aura::Env* aura_env() { return aura_env_; }
jamescookb8dcef522016-06-25 14:42:55396 ::wm::CompoundEventFilter* env_filter() { return env_filter_.get(); }
Mike Wassermanefbf3402018-04-26 00:41:32397 EventRewriterController* event_rewriter_controller() {
398 return event_rewriter_controller_.get();
399 }
Qiang Xuf1400a362017-09-14 02:28:30400 EventClientImpl* event_client() { return event_client_.get(); }
401 EventTransformationHandler* event_transformation_handler() {
402 return event_transformation_handler_.get();
403 }
James Cookf5398842018-04-16 20:15:24404 FirstRunHelper* first_run_helper() { return first_run_helper_.get(); }
Scott Violet319cfb52018-05-23 18:35:28405 ::wm::FocusController* focus_controller() { return focus_controller_.get(); }
Scott Violet7dbdaeb2018-12-11 22:39:02406 ::wm::FocusRules* focus_rules() { return focus_rules_; }
sky79fa34712017-03-20 23:46:47407 FocusCycler* focus_cycler() { return focus_cycler_.get(); }
Qiang Xuf1400a362017-09-14 02:28:30408 HighlighterController* highlighter_controller() {
409 return highlighter_controller_.get();
410 }
411 HighContrastController* high_contrast_controller() {
412 return high_contrast_controller_.get();
413 }
James Cookf0c78fc2017-06-15 14:42:55414 ImeController* ime_controller() { return ime_controller_.get(); }
Evan Stade1467204e2018-10-11 02:03:50415 ImmersiveContext* immersive_context() { return immersive_context_.get(); }
David Tseng6792dc82018-05-04 19:18:41416 KeyAccessibilityEnabler* key_accessibility_enabler() {
417 return key_accessibility_enabler_.get();
418 }
sky79fa34712017-03-20 23:46:47419 KeyboardBrightnessControlDelegate* keyboard_brightness_control_delegate() {
420 return keyboard_brightness_control_delegate_.get();
421 }
Steven Bennettsa0ea30942018-10-11 22:27:51422 AshKeyboardController* ash_keyboard_controller() {
423 return ash_keyboard_controller_.get();
Steven Bennettsa00d64cc82018-10-04 00:17:22424 }
Qiang Xuf1400a362017-09-14 02:28:30425 LaserPointerController* laser_pointer_controller() {
426 return laser_pointer_controller_.get();
427 }
Tatsuhisa Yamaguchi440e2d2e2018-12-05 09:16:31428 LocaleUpdateController* locale_update_controller() {
429 return locale_update_controller_.get();
sky79fa34712017-03-20 23:46:47430 }
Jacob Dufaultffd9b0d2017-11-15 23:07:16431 LoginScreenController* login_screen_controller() {
432 return login_screen_controller_.get();
xiaoyinh2bbdd102017-05-18 23:29:42433 }
Qiang Xuf1400a362017-09-14 02:28:30434 LockStateController* lock_state_controller() {
435 return lock_state_controller_.get();
436 }
437 LogoutConfirmationController* logout_confirmation_controller() {
438 return logout_confirmation_controller_.get();
439 }
440 MagnificationController* magnification_controller() {
441 return magnification_controller_.get();
442 }
sky5ab16472017-03-21 19:35:08443 MediaController* media_controller() { return media_controller_.get(); }
Becca Hughesc6a0a062018-10-25 16:54:13444 MediaNotificationController* media_notification_controller() {
445 return media_notification_controller_.get();
446 }
Evan Stade04c18d02017-10-20 20:53:22447 MessageCenterController* message_center_controller() {
448 return message_center_controller_.get();
449 }
Qiang Xuf1400a362017-09-14 02:28:30450 MouseCursorEventFilter* mouse_cursor_filter() {
451 return mouse_cursor_filter_.get();
452 }
sky5ab16472017-03-21 19:35:08453 MruWindowTracker* mru_window_tracker() { return mru_window_tracker_.get(); }
454 NewWindowController* new_window_controller() {
455 return new_window_controller_.get();
456 }
afakhry9e0a18b32017-06-05 19:23:14457 NightLightController* night_light_controller();
Vladislav Kaznacheev92edf62e2017-10-13 22:08:01458 NoteTakingController* note_taking_controller() {
459 return note_taking_controller_.get();
460 }
Qiang Xuf1400a362017-09-14 02:28:30461 OverlayEventFilter* overlay_filter() { return overlay_filter_.get(); }
Qiang Xuf1400a362017-09-14 02:28:30462 PartialMagnificationController* partial_magnification_controller() {
463 return partial_magnification_controller_.get();
464 }
Qiang Xud8e897e2018-05-24 20:07:57465 PolicyRecommendationRestorer* policy_recommendation_restorer() {
466 return policy_recommendation_restorer_.get();
467 }
Qiang Xuf1400a362017-09-14 02:28:30468 PowerButtonController* power_button_controller() {
469 return power_button_controller_.get();
470 }
471 PowerEventObserver* power_event_observer() {
472 return power_event_observer_.get();
473 }
474 ResizeShadowController* resize_shadow_controller() {
475 return resize_shadow_controller_.get();
476 }
477 ResolutionNotificationController* resolution_notification_controller() {
478 return resolution_notification_controller_.get();
479 }
480 ScreenshotController* screenshot_controller() {
481 return screenshot_controller_.get();
482 }
483 ScreenLayoutObserver* screen_layout_observer() {
484 return screen_layout_observer_.get();
485 }
486 ScreenOrientationController* screen_orientation_controller() {
487 return screen_orientation_controller_.get();
488 }
489 ScreenPinningController* screen_pinning_controller() {
490 return screen_pinning_controller_.get();
491 }
Tetsui Ohkubo54d50222018-05-10 01:58:11492 ScreenSwitchCheckController* screen_switch_check_controller() {
493 return screen_switch_check_controller_.get();
494 }
sky5ad143a2017-03-22 04:31:23495 SessionController* session_controller() { return session_controller_.get(); }
Sammie Quon557418662018-04-25 18:45:51496 ::wm::ShadowController* shadow_controller() {
497 return shadow_controller_.get();
498 }
sky5ad143a2017-03-22 04:31:23499 ShelfController* shelf_controller() { return shelf_controller_.get(); }
sky5ad143a2017-03-22 04:31:23500 ShelfModel* shelf_model();
Qiang Xuf1400a362017-09-14 02:28:30501 ShellDelegate* shell_delegate() { return shell_delegate_.get(); }
James Cook40f7d752018-05-25 18:21:58502 ShellState* shell_state() { return shell_state_.get(); }
sky5b45ed82017-03-27 02:54:23503 ShutdownController* shutdown_controller() {
504 return shutdown_controller_.get();
505 }
Qiang Xuf1400a362017-09-14 02:28:30506 SplitViewController* split_view_controller() {
507 return split_view_controller_.get();
508 }
509 StickyKeysController* sticky_keys_controller() {
510 return sticky_keys_controller_.get();
511 }
Steven Bennetts7fb8a992018-06-12 00:15:05512 SystemNotificationController* system_notification_controller() {
513 return system_notification_controller_.get();
514 }
Tetsui Ohkubo21722932018-03-02 02:56:56515 SystemTrayModel* system_tray_model() { return system_tray_model_.get(); }
sky5b45ed82017-03-27 02:54:23516 SystemTrayNotifier* system_tray_notifier() {
517 return system_tray_notifier_.get();
518 }
Sammie Quona6f96402017-08-24 01:08:37519 TabletModeController* tablet_mode_controller() {
520 return tablet_mode_controller_.get();
521 }
Scott Violet3c554ae2017-12-13 02:25:41522 TimeToFirstPresentRecorder* time_to_first_present_recorder() {
523 return time_to_first_present_recorder_.get();
524 }
Qiang Xuf1400a362017-09-14 02:28:30525 ToastManager* toast_manager() { return toast_manager_.get(); }
[email protected]a1b7a822013-02-23 19:08:04526 views::corewm::TooltipController* tooltip_controller() {
[email protected]862deef2011-12-15 22:07:33527 return tooltip_controller_.get();
[email protected]4a229e902011-12-01 21:21:11528 }
Qiang Xuf1400a362017-09-14 02:28:30529 TouchDevicesController* touch_devices_controller() {
530 return touch_devices_controller_.get();
chirantan40e4cd82015-02-19 01:08:19531 }
kylechar55f0eaf22017-01-11 22:57:37532 AshTouchTransformController* touch_transformer_controller() {
[email protected]03122891a2014-05-13 23:56:49533 return touch_transformer_controller_.get();
534 }
Qiang Xuf1400a362017-09-14 02:28:30535 TrayAction* tray_action() { return tray_action_.get(); }
536 TrayBluetoothHelper* tray_bluetooth_helper() {
537 return tray_bluetooth_helper_.get();
sammiequon203ae022016-09-18 17:23:42538 }
Evan Stade04c18d02017-10-20 20:53:22539 UserMetricsRecorder* metrics() { return user_metrics_recorder_.get(); }
Qiang Xuf1400a362017-09-14 02:28:30540 VideoDetector* video_detector() { return video_detector_.get(); }
Yue Lia33960a2017-11-01 22:06:07541 VoiceInteractionController* voice_interaction_controller() {
542 return voice_interaction_controller_.get();
543 }
Qiang Xuf1400a362017-09-14 02:28:30544 VpnList* vpn_list() { return vpn_list_.get(); }
545 WallpaperController* wallpaper_controller() {
546 return wallpaper_controller_.get();
Vladislav Kaznacheev6d6aaff2017-07-22 04:06:32547 }
Qiang Xuf1400a362017-09-14 02:28:30548 WindowCycleController* window_cycle_controller() {
549 return window_cycle_controller_.get();
mukai19274bdd2015-02-24 22:37:48550 }
Qiang Xuf1400a362017-09-14 02:28:30551 WindowPositioner* window_positioner() { return window_positioner_.get(); }
552 WindowSelectorController* window_selector_controller() {
553 return window_selector_controller_.get();
[email protected]8b7ba87b2012-09-01 00:40:40554 }
Scott Violetb7f4df22018-05-17 04:43:12555 WindowServiceOwner* window_service_owner() {
556 return window_service_owner_.get();
Scott Violet7eb50d22018-05-04 17:12:18557 }
Qiang Xuf1400a362017-09-14 02:28:30558 WindowTreeHostManager* window_tree_host_manager() {
559 return window_tree_host_manager_.get();
[email protected]682990f2013-01-10 06:49:11560 }
[email protected]77f7c132012-11-15 06:52:54561
Mitsuru Oshima89e5c1352018-01-17 07:29:39562 ToplevelWindowEventHandler* toplevel_window_event_handler() {
563 return toplevel_window_event_handler_.get();
564 }
565
[email protected]c758fbf2012-03-25 22:53:59566 // Force the shelf to query for it's current visibility state.
jamescook6afad6d2016-06-01 00:35:01567 // TODO(jamescook): Move to Shelf.
[email protected]c758fbf2012-03-25 22:53:59568 void UpdateShelfVisibility();
569
[email protected]a0afeb12012-12-10 22:57:09570 // Does the primary display have status area?
571 bool HasPrimaryStatusArea();
572
[email protected]f9466702012-09-17 16:35:27573 // Starts the animation that occurs on first login.
574 void DoInitialWorkspaceAnimation();
575
yawanodc5533b32017-02-23 11:04:38576 void SetLargeCursorSizeInDip(int large_cursor_size_in_dip);
577
Weidong Guod07448f2017-10-18 03:35:18578 // Updates cursor compositing on/off. Native cursor is disabled when cursor
[email protected]87ec2202014-02-06 06:24:27579 // compositing is enabled, and vice versa.
Weidong Guod07448f2017-10-18 03:35:18580 void UpdateCursorCompositingEnabled();
[email protected]87ec2202014-02-06 06:24:27581
Weidong Guod07448f2017-10-18 03:35:18582 // Force setting compositing on/off without checking dependency.
583 void SetCursorCompositingEnabled(bool enabled);
xdaid4913762017-07-06 00:17:22584
585 // Returns true if split view mode is active.
586 bool IsSplitViewModeActive() const;
587
James Cookfa4838e2018-08-08 16:30:15588 // Shows the context menu for the wallpaper or shelf at |location_in_screen|.
589 void ShowContextMenu(const gfx::Point& location_in_screen,
590 ui::MenuSourceType source_type);
591
sky00c813f2017-03-08 22:48:55592 void AddShellObserver(ShellObserver* observer);
593 void RemoveShellObserver(ShellObserver* observer);
594
sky5ad143a2017-03-22 04:31:23595 // Called when the login status changes.
596 // TODO(oshima): Investigate if we can merge this and |OnLoginStateChanged|.
597 void UpdateAfterLoginStatusChange(LoginStatus status);
598
sky00c813f2017-03-08 22:48:55599 // Notifies observers that overview mode is about to be started (before the
600 // windows get re-arranged).
601 void NotifyOverviewModeStarting();
602
Sammie Quonbe186062018-10-26 06:40:34603 // Notifies observers that the start overview mode animation has completed.
604 void NotifyOverviewModeStartingAnimationComplete(bool canceled);
605
606 // Notifies observers that overview mode is about to end (before the windows
Xiaoqian Daifb4698ed2018-02-23 20:11:06607 // restore themselves).
608 void NotifyOverviewModeEnding();
609
sky00c813f2017-03-08 22:48:55610 // Notifies observers that overview mode has ended.
611 void NotifyOverviewModeEnded();
612
Sammie Quonbe186062018-10-26 06:40:34613 // Notifies observers that the end overview mode animation has completed.
614 void NotifyOverviewModeEndingAnimationComplete(bool canceled);
Sammie Quon317deb52018-09-06 16:36:28615
xdaid4913762017-07-06 00:17:22616 // Notifies observers that split view mode is about to be started (before the
617 // window gets snapped and activated).
618 void NotifySplitViewModeStarting();
619
Xiaoqian Daibf3771f2018-03-13 18:21:46620 // Notifies observers that split view mode has been started.
621 void NotifySplitViewModeStarted();
622
xdaid4913762017-07-06 00:17:22623 // Notifies observers that split view mode has ended.
624 void NotifySplitViewModeEnded();
625
sky00c813f2017-03-08 22:48:55626 // Notifies observers that fullscreen mode has changed for |root_window|.
varkhac71444e52017-05-25 22:51:34627 void NotifyFullscreenStateChanged(bool is_fullscreen,
628 aura::Window* root_window);
sky00c813f2017-03-08 22:48:55629
630 // Notifies observers that |pinned_window| changed its pinned window state.
varkha19d7e6c52017-05-25 21:15:30631 void NotifyPinnedStateChanged(aura::Window* pinned_window);
sky00c813f2017-03-08 22:48:55632
sky00c813f2017-03-08 22:48:55633 // Notifies observers that |root_window|'s shelf changed alignment.
634 // TODO(jamescook): Move to Shelf.
varkha6b016b0f2017-05-26 16:14:18635 void NotifyShelfAlignmentChanged(aura::Window* root_window);
sky00c813f2017-03-08 22:48:55636
637 // Notifies observers that |root_window|'s shelf changed auto-hide behavior.
638 // TODO(jamescook): Move to Shelf.
varkha6b016b0f2017-05-26 16:14:18639 void NotifyShelfAutoHideBehaviorChanged(aura::Window* root_window);
sky00c813f2017-03-08 22:48:55640
jamescook518dccbd2017-05-18 04:57:07641 // Used to provide better error messages for Shell::Get() under mash.
642 static void SetIsBrowserProcessWithMash();
643
muyuanlid766f2e2017-06-26 20:17:19644 void NotifyAppListVisibilityChanged(bool visible, aura::Window* root_window);
645
[email protected]2b4cd302012-02-24 20:21:13646 private:
[email protected]c39be8f2012-06-15 22:58:36647 FRIEND_TEST_ALL_PREFIXES(ExtendedDesktopTest, TestCursor);
[email protected]1aad3322012-06-06 06:37:09648 FRIEND_TEST_ALL_PREFIXES(WindowManagerTest, MouseEventCursors);
649 FRIEND_TEST_ALL_PREFIXES(WindowManagerTest, TransformActivate);
sky79fa34712017-03-20 23:46:47650 friend class AcceleratorControllerTest;
Sam McNallya853cd82017-08-30 01:55:10651 friend class AshTestHelper;
[email protected]093b8d642014-04-03 20:59:28652 friend class RootWindowController;
sky27344382017-03-08 21:30:32653 friend class ScopedRootWindowForNewWindows;
James Cook317781a02017-07-18 02:08:06654 friend class ShellTestApi;
sky27344382017-03-08 21:30:32655 friend class SmsObserverTest;
[email protected]ad0c8722012-03-02 20:17:45656
skyb073203a2017-03-13 16:59:16657 Shell(std::unique_ptr<ShellDelegate> shell_delegate,
Scott Violete5c79f52018-07-31 00:10:17658 service_manager::Connector* connector);
dcheng1f4538e2014-10-27 23:57:05659 ~Shell() override;
[email protected]3266c2b92011-11-14 00:06:08660
Scott Violet7e33efc2018-08-29 22:30:15661 void Init(ui::ContextFactory* context_factory,
662 ui::ContextFactoryPrivate* context_factory_private,
663 std::unique_ptr<base::Value> initial_display_prefs,
664 std::unique_ptr<ws::GpuInterfaceProvider> gpu_interface_provider);
[email protected]b0639282011-12-22 21:12:27665
Steven Bennetts7683e342018-01-02 21:29:52666 // Initializes the display manager and related components.
667 void InitializeDisplayManager();
668
[email protected]a273d33a2013-10-17 12:41:21669 // Initializes the root window so that it can host browser windows.
[email protected]41baaed2013-11-09 04:18:26670 void InitRootWindow(aura::Window* root_window);
[email protected]d90b8392012-06-13 09:34:56671
skyabcae812017-01-18 17:01:34672 // Destroys all child windows including widgets across all roots.
673 void CloseAllRootWindowChildWindows();
674
hariank0dd03dd2016-07-14 23:47:33675 // SystemModalContainerEventFilterDelegate:
dcheng1f4538e2014-10-27 23:57:05676 bool CanWindowReceiveEvents(aura::Window* window) override;
[email protected]c0ce80e2012-10-05 23:28:27677
[email protected]5097e69c2012-10-30 22:08:41678 // Overridden from ui::EventTarget:
dcheng1f4538e2014-10-27 23:57:05679 bool CanAcceptEvent(const ui::Event& event) override;
680 EventTarget* GetParentTarget() override;
dchenga94547472016-04-08 08:41:11681 std::unique_ptr<ui::EventTargetIterator> GetChildIterator() const override;
dcheng1f4538e2014-10-27 23:57:05682 ui::EventTargeter* GetEventTargeter() override;
[email protected]5097e69c2012-10-30 22:08:41683
Thiago Farina3b086a02017-05-30 22:32:50684 // wm::ActivationChangeObserver:
sky27344382017-03-08 21:30:32685 void OnWindowActivated(ActivationReason reason,
686 aura::Window* gained_active,
687 aura::Window* lost_active) override;
688
Xiyuan Xia22b1a6c2017-04-18 22:46:01689 // SessionObserver:
Steven Bennettsbadc3092018-05-24 21:26:01690 void OnFirstSessionStarted() override;
Xiyuan Xiab64fd0a2017-04-13 17:53:14691 void OnSessionStateChanged(session_manager::SessionState state) override;
692 void OnLoginStatusChanged(LoginStatus login_status) override;
693 void OnLockStateChanged(bool locked) override;
sky5ad143a2017-03-22 04:31:23694
Sam McNallyf4dab612017-08-16 03:06:33695 // Callback for prefs::ConnectToPrefService.
Sam McNallye36abbc2017-07-20 01:04:28696 void OnLocalStatePrefServiceInitialized(
697 std::unique_ptr<::PrefService> pref_service);
tibellb93c729b2017-03-30 00:45:09698
[email protected]cac10fc62011-10-07 23:22:56699 static Shell* instance_;
700
Scott Violetac410622018-08-11 18:33:22701 // |owned_aura_env_| is non-null if Shell created aura::Env. Shell creates
702 // aura::Env only in single-process-mash mode.
703 std::unique_ptr<aura::Env> owned_aura_env_;
704
705 // This is either |owned_aura_env_|, or Env::GetInstance().
706 aura::Env* aura_env_;
707
[email protected]1aad3322012-06-06 06:37:09708 // The CompoundEventFilter owned by aura::Env object.
dchenga94547472016-04-08 08:41:11709 std::unique_ptr<::wm::CompoundEventFilter> env_filter_;
[email protected]627a62f2012-02-14 22:59:14710
Mike Wassermanefbf3402018-04-26 00:41:32711 std::unique_ptr<EventRewriterController> event_rewriter_controller_;
712
dchenga94547472016-04-08 08:41:11713 std::unique_ptr<UserMetricsRecorder> user_metrics_recorder_;
dchenga94547472016-04-08 08:41:11714 std::unique_ptr<WindowPositioner> window_positioner_;
[email protected]2b99f8c2011-10-11 19:42:24715
sky81a2d792017-03-17 19:14:39716 std::unique_ptr<AcceleratorController> accelerator_controller_;
James Cookec144952017-09-01 00:05:16717 std::unique_ptr<AccessibilityController> accessibility_controller_;
sky07a24d42017-03-09 23:57:30718 std::unique_ptr<AccessibilityDelegate> accessibility_delegate_;
Qiang Xua9591002018-03-15 22:29:31719 std::unique_ptr<AccessibilityFocusRingController>
720 accessibility_focus_ring_controller_;
Jiaquan He4b48f912018-03-01 03:59:39721 std::unique_ptr<AppListControllerImpl> app_list_controller_;
Jeffrey Kardatzkef108f022018-04-17 17:52:35722 std::unique_ptr<AshDBusServices> ash_dbus_services_;
Scott Violetd64dac12017-06-02 21:50:08723 std::unique_ptr<AshDisplayController> ash_display_controller_;
David Black00fdce32018-05-10 20:59:14724 std::unique_ptr<AssistantController> assistant_controller_;
Toni Barzic9d0c82f42017-12-06 00:53:52725 std::unique_ptr<BacklightsForcedOffSetter> backlights_forced_off_setter_;
sky79fa34712017-03-20 23:46:47726 std::unique_ptr<BrightnessControlDelegate> brightness_control_delegate_;
727 std::unique_ptr<CastConfigController> cast_config_;
Steven Bennetts2a9b4382018-04-26 23:41:19728 std::unique_ptr<CrosDisplayConfig> cros_display_config_;
Scott Violete5c79f52018-07-31 00:10:17729 service_manager::Connector* const connector_;
Quan Nguyenaf67b64d2018-11-29 19:21:48730 std::unique_ptr<ContainedShellController> contained_shell_controller_;
Toni Barzicd6238312018-03-02 18:26:13731 std::unique_ptr<DetachableBaseHandler> detachable_base_handler_;
Toni Barzic550419f2018-03-08 03:56:21732 std::unique_ptr<DetachableBaseNotificationController>
733 detachable_base_notification_controller_;
Tetsui Ohkubo01421b32018-05-30 16:54:59734 std::unique_ptr<DisplaySpeakerController> display_speaker_controller_;
dchenga94547472016-04-08 08:41:11735 std::unique_ptr<DragDropController> drag_drop_controller_;
James Cookf5398842018-04-16 20:15:24736 std::unique_ptr<FirstRunHelper> first_run_helper_;
sky79fa34712017-03-20 23:46:47737 std::unique_ptr<FocusCycler> focus_cycler_;
James Cookf0c78fc2017-06-15 14:42:55738 std::unique_ptr<ImeController> ime_controller_;
Xiyuan Xia5f1046e2018-06-01 16:04:44739 std::unique_ptr<ImeFocusHandler> ime_focus_handler_;
Evan Stade1467204e2018-10-11 02:03:50740 std::unique_ptr<ImmersiveContext> immersive_context_;
sky79fa34712017-03-20 23:46:47741 std::unique_ptr<KeyboardBrightnessControlDelegate>
742 keyboard_brightness_control_delegate_;
Tatsuhisa Yamaguchi440e2d2e2018-12-05 09:16:31743 std::unique_ptr<LocaleUpdateController> locale_update_controller_;
Jacob Dufaultffd9b0d2017-11-15 23:07:16744 std::unique_ptr<LoginScreenController> login_screen_controller_;
sky79fa34712017-03-20 23:46:47745 std::unique_ptr<LogoutConfirmationController> logout_confirmation_controller_;
Mitsuru Oshima0e9b7a62017-07-19 18:23:03746 std::unique_ptr<TabletModeController> tablet_mode_controller_;
sky5ab16472017-03-21 19:35:08747 std::unique_ptr<MediaController> media_controller_;
Becca Hughesc6a0a062018-10-25 16:54:13748 std::unique_ptr<MediaNotificationController> media_notification_controller_;
sky5ab16472017-03-21 19:35:08749 std::unique_ptr<MruWindowTracker> mru_window_tracker_;
Kyle Horimoto9fc84fc22018-04-27 19:45:15750 std::unique_ptr<MultiDeviceNotificationPresenter>
751 multidevice_notification_presenter_;
sky5ab16472017-03-21 19:35:08752 std::unique_ptr<NewWindowController> new_window_controller_;
dchenga94547472016-04-08 08:41:11753 std::unique_ptr<ResizeShadowController> resize_shadow_controller_;
sky5ad143a2017-03-22 04:31:23754 std::unique_ptr<SessionController> session_controller_;
afakhrye4fae852017-05-09 18:49:06755 std::unique_ptr<NightLightController> night_light_controller_;
Vladislav Kaznacheev92edf62e2017-10-13 22:08:01756 std::unique_ptr<NoteTakingController> note_taking_controller_;
Qiang Xud8e897e2018-05-24 20:07:57757 std::unique_ptr<PolicyRecommendationRestorer> policy_recommendation_restorer_;
Tetsui Ohkubo54d50222018-05-10 01:58:11758 std::unique_ptr<ScreenSwitchCheckController> screen_switch_check_controller_;
sky5ad143a2017-03-22 04:31:23759 std::unique_ptr<ShelfController> shelf_controller_;
sky5ad143a2017-03-22 04:31:23760 std::unique_ptr<ShelfWindowWatcher> shelf_window_watcher_;
skyb073203a2017-03-13 16:59:16761 std::unique_ptr<ShellDelegate> shell_delegate_;
James Cook40f7d752018-05-25 18:21:58762 std::unique_ptr<ShellState> shell_state_;
sky5b45ed82017-03-27 02:54:23763 std::unique_ptr<ShutdownController> shutdown_controller_;
Tetsui Ohkubo269b5792018-04-26 01:06:32764 std::unique_ptr<SystemNotificationController> system_notification_controller_;
Tetsui Ohkubo21722932018-03-02 02:56:56765 std::unique_ptr<SystemTrayModel> system_tray_model_;
sky5b45ed82017-03-27 02:54:23766 std::unique_ptr<SystemTrayNotifier> system_tray_notifier_;
sky07a24d42017-03-09 23:57:30767 std::unique_ptr<ToastManager> toast_manager_;
Qiang Xuf1400a362017-09-14 02:28:30768 std::unique_ptr<TouchDevicesController> touch_devices_controller_;
Scott Violet3c554ae2017-12-13 02:25:41769 std::unique_ptr<TimeToFirstPresentRecorder> time_to_first_present_recorder_;
tbarzicc78da1ff92017-05-08 20:46:15770 std::unique_ptr<TrayAction> tray_action_;
Yue Lia33960a2017-11-01 22:06:07771 std::unique_ptr<VoiceInteractionController> voice_interaction_controller_;
sky5b45ed82017-03-27 02:54:23772 std::unique_ptr<VpnList> vpn_list_;
sky07a24d42017-03-09 23:57:30773 std::unique_ptr<WallpaperController> wallpaper_controller_;
sky5b45ed82017-03-27 02:54:23774 std::unique_ptr<WindowCycleController> window_cycle_controller_;
775 std::unique_ptr<WindowSelectorController> window_selector_controller_;
Scott Violet7dbdaeb2018-12-11 22:39:02776 // Owned by |focus_controller_|.
777 ::wm::FocusRules* focus_rules_ = nullptr;
dchenga94547472016-04-08 08:41:11778 std::unique_ptr<::wm::ShadowController> shadow_controller_;
779 std::unique_ptr<::wm::VisibilityController> visibility_controller_;
780 std::unique_ptr<::wm::WindowModalityController> window_modality_controller_;
Sam McNallya853cd82017-08-30 01:55:10781 std::unique_ptr<PrefService> local_state_;
dchenga94547472016-04-08 08:41:11782 std::unique_ptr<views::corewm::TooltipController> tooltip_controller_;
dchenga94547472016-04-08 08:41:11783 std::unique_ptr<PowerButtonController> power_button_controller_;
784 std::unique_ptr<LockStateController> lock_state_controller_;
dchenga94547472016-04-08 08:41:11785 std::unique_ptr<ui::UserActivityDetector> user_activity_detector_;
786 std::unique_ptr<VideoDetector> video_detector_;
Scott Violet737fb752018-04-11 15:35:22787 std::unique_ptr<WaylandServerController> wayland_server_controller_;
Scott Violetb7f4df22018-05-17 04:43:12788 std::unique_ptr<WindowServiceOwner> window_service_owner_;
dchenga94547472016-04-08 08:41:11789 std::unique_ptr<WindowTreeHostManager> window_tree_host_manager_;
Qiang Xud77a90c2018-02-20 19:43:29790 std::unique_ptr<PersistentWindowController> persistent_window_controller_;
dchenga94547472016-04-08 08:41:11791 std::unique_ptr<HighContrastController> high_contrast_controller_;
792 std::unique_ptr<MagnificationController> magnification_controller_;
dchenga94547472016-04-08 08:41:11793 std::unique_ptr<AutoclickController> autoclick_controller_;
sky27344382017-03-08 21:30:32794 std::unique_ptr<::wm::FocusController> focus_controller_;
sky984c1892016-04-20 00:00:34795
oshima5a296e82016-04-29 01:32:27796 std::unique_ptr<ScreenshotController> screenshot_controller_;
[email protected]f5c9dbc2014-04-11 08:13:45797
dchenga94547472016-04-08 08:41:11798 std::unique_ptr<MouseCursorEventFilter> mouse_cursor_filter_;
799 std::unique_ptr<ScreenPositionController> screen_position_controller_;
800 std::unique_ptr<SystemModalContainerEventFilter> modality_filter_;
801 std::unique_ptr<EventClientImpl> event_client_;
802 std::unique_ptr<EventTransformationHandler> event_transformation_handler_;
[email protected]ae18b9112011-11-07 16:59:13803
[email protected]0b0b0742012-02-16 13:23:45804 // An event filter that pre-handles key events while the partial
[email protected]a1584a712012-07-30 21:02:26805 // screenshot UI or the keyboard overlay is active.
dchenga94547472016-04-08 08:41:11806 std::unique_ptr<OverlayEventFilter> overlay_filter_;
[email protected]0b0b0742012-02-16 13:23:45807
[email protected]3537d472014-01-15 05:45:31808 // An event filter which handles moving and resizing windows.
dchenga94547472016-04-08 08:41:11809 std::unique_ptr<ToplevelWindowEventHandler> toplevel_window_event_handler_;
[email protected]3537d472014-01-15 05:45:31810
[email protected]435b212e2012-04-05 19:43:37811 // An event filter which handles system level gestures
dchenga94547472016-04-08 08:41:11812 std::unique_ptr<SystemGestureEventFilter> system_gesture_filter_;
[email protected]435b212e2012-04-05 19:43:37813
[email protected]745816be2011-11-22 05:08:30814 // An event filter that pre-handles global accelerators.
dchenga94547472016-04-08 08:41:11815 std::unique_ptr<::wm::AcceleratorFilter> accelerator_filter_;
[email protected]745816be2011-11-22 05:08:30816
rjkroege72f8154f2016-10-29 00:49:02817 std::unique_ptr<display::DisplayManager> display_manager_;
Steven Bennetts3688c6032018-04-13 01:14:23818 std::unique_ptr<DisplayPrefs> display_prefs_;
dchenga94547472016-04-08 08:41:11819 std::unique_ptr<DisplayConfigurationController>
820 display_configuration_controller_;
Steven Bennetts9b21fa32018-04-13 23:45:55821 std::unique_ptr<DisplayConfigurationObserver> display_configuration_observer_;
[email protected]6bdf7952012-11-14 10:10:58822
hidehiko6821ca42016-06-18 11:12:23823 std::unique_ptr<ScreenPinningController> screen_pinning_controller_;
[email protected]a9a40462013-07-31 06:22:56824
Sammie Quon95c6a1c2017-09-12 19:16:55825 std::unique_ptr<PeripheralBatteryNotifier> peripheral_battery_notifier_;
dchenga94547472016-04-08 08:41:11826 std::unique_ptr<PowerEventObserver> power_event_observer_;
Qiang Xu36234e532018-04-11 04:54:02827 std::unique_ptr<PowerPrefs> power_prefs_;
dchenga94547472016-04-08 08:41:11828 std::unique_ptr<ui::UserActivityPowerManagerNotifier> user_activity_notifier_;
829 std::unique_ptr<VideoActivityNotifier> video_activity_notifier_;
830 std::unique_ptr<StickyKeysController> sticky_keys_controller_;
831 std::unique_ptr<ResolutionNotificationController>
[email protected]7bc49bd2014-01-22 09:30:34832 resolution_notification_controller_;
dchenga94547472016-04-08 08:41:11833 std::unique_ptr<BluetoothNotificationController>
[email protected]b31427252014-03-04 06:59:50834 bluetooth_notification_controller_;
Sonny Sasaka55f69fc2017-08-28 21:29:37835 std::unique_ptr<BluetoothPowerController> bluetooth_power_controller_;
jamescookac6724332017-03-21 02:54:43836 std::unique_ptr<TrayBluetoothHelper> tray_bluetooth_helper_;
Steven Bennettsa0ea30942018-10-11 22:27:51837 std::unique_ptr<AshKeyboardController> ash_keyboard_controller_;
[email protected]70b3e7d52012-06-02 22:12:25838 // Controls video output device state.
kylechar7a067ec2017-01-07 01:16:28839 std::unique_ptr<display::DisplayConfigurator> display_configurator_;
Scott Violetbed23cb2018-08-22 19:56:12840 std::unique_ptr<DisplayOutputProtection> display_output_protection_;
dchenga94547472016-04-08 08:41:11841 std::unique_ptr<DisplayColorManager> display_color_manager_;
842 std::unique_ptr<DisplayErrorObserver> display_error_observer_;
843 std::unique_ptr<ProjectingObserver> projecting_observer_;
[email protected]6bdf7952012-11-14 10:10:58844
[email protected]c1234a42013-08-20 09:35:40845 // Listens for output changes and updates the display manager.
kylecharf2e4e412016-12-04 04:21:35846 std::unique_ptr<display::DisplayChangeObserver> display_change_observer_;
[email protected]3dff2efd2014-02-09 22:50:39847
kylechar98748a52016-12-03 01:33:22848 // Listens for shutdown and updates DisplayConfigurator.
Steven Bennetts7683e342018-01-02 21:29:52849 std::unique_ptr<DisplayShutdownObserver> display_shutdown_observer_;
kylechar98748a52016-12-03 01:33:22850
yiyix90cfee22017-02-16 05:38:18851 // Listens for new sms messages and shows notifications.
852 std::unique_ptr<SmsObserver> sms_observer_;
853
derat94887a22017-01-20 18:17:25854 // Implements content::ScreenOrientationController for Chrome OS.
dchenga94547472016-04-08 08:41:11855 std::unique_ptr<ScreenOrientationController> screen_orientation_controller_;
yiyixa68ade512016-09-01 17:38:13856 std::unique_ptr<ScreenLayoutObserver> screen_layout_observer_;
jonrossf21fea12014-11-13 01:22:51857
kylechar55f0eaf22017-01-11 22:57:37858 std::unique_ptr<AshTouchTransformController> touch_transformer_controller_;
dnicoara8c3bd1e62014-10-30 19:53:39859
dchenga94547472016-04-08 08:41:11860 std::unique_ptr<ui::EventHandler> magnifier_key_scroll_handler_;
861 std::unique_ptr<ui::EventHandler> speech_feedback_handler_;
sammiequon203ae022016-09-18 17:23:42862 std::unique_ptr<LaserPointerController> laser_pointer_controller_;
863 std::unique_ptr<PartialMagnificationController>
864 partial_magnification_controller_;
Vladislav Kaznacheev6d6aaff2017-07-22 04:06:32865 std::unique_ptr<HighlighterController> highlighter_controller_;
[email protected]70b3e7d52012-06-02 22:12:25866
Ahmed Fakhry4bf3f742018-02-06 17:33:36867 std::unique_ptr<DockedMagnifierController> docked_magnifier_controller_;
868
xdaid4913762017-07-06 00:17:22869 // The split view controller for Chrome OS in tablet mode.
870 std::unique_ptr<SplitViewController> split_view_controller_;
871
[email protected]c0ff0342013-02-27 00:41:29872 // |native_cursor_manager_| is owned by |cursor_manager_|, but we keep a
873 // pointer to vend to test code.
erg36cfb952017-06-21 19:41:45874 NativeCursorManagerAsh* native_cursor_manager_;
[email protected]e76096a5f2014-04-08 04:08:03875
derat94887a22017-01-20 18:17:25876 // Cursor may be hidden on certain key events in Chrome OS, whereas we never
sadrul7a8785e2016-02-12 21:54:35877 // hide the cursor on Windows.
dchenga94547472016-04-08 08:41:11878 std::unique_ptr<::wm::CursorManager> cursor_manager_;
[email protected]4b8003c2012-07-26 00:54:19879
David Tseng6792dc82018-05-04 19:18:41880 // Enables spoken feedback accessibility based on a press and hold of both
881 // volume keys.
882 std::unique_ptr<KeyAccessibilityEnabler> key_accessibility_enabler_;
883
[email protected]852a55d2012-10-17 13:30:30884 // For testing only: simulate that a modal window is open
James Cook7b7c6a52018-01-04 23:40:03885 bool simulate_modal_window_open_for_test_ = false;
[email protected]852a55d2012-10-17 13:30:30886
Evan Stade2c43a87b32017-08-31 17:53:10887 std::unique_ptr<MessageCenterController> message_center_controller_;
888
Trent Apteda250ec3ab2018-08-19 08:52:19889 base::ObserverList<ShellObserver>::Unchecked shell_observers_;
sky00c813f2017-03-08 22:48:55890
Sam McNallye36abbc2017-07-20 01:04:28891 base::WeakPtrFactory<Shell> weak_factory_;
892
[email protected]87b0d82e2011-10-07 21:02:59893 DISALLOW_COPY_AND_ASSIGN(Shell);
894};
895
[email protected]55f593352011-12-24 05:42:46896} // namespace ash
[email protected]87b0d82e2011-10-07 21:02:59897
[email protected]b65bdda2011-12-23 23:35:31898#endif // ASH_SHELL_H_