blob: af921f48e35af9d1d99675f29f8710364d02c7a6 [file] [log] [blame]
[email protected]e0d22e82012-01-04 00:46:571// Copyright (c) 2012 The Chromium Authors. All rights reserved.
[email protected]87b0d82e2011-10-07 21:02:592// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
[email protected]b65bdda2011-12-23 23:35:315#ifndef ASH_SHELL_H_
6#define ASH_SHELL_H_
[email protected]87b0d82e2011-10-07 21:02:597
dchenga94547472016-04-08 08:41:118#include <memory>
[email protected]cac10fc62011-10-07 23:22:569#include <utility>
10#include <vector>
11
[email protected]b65bdda2011-12-23 23:35:3112#include "ash/ash_export.h"
[email protected]5d2ea362013-12-13 08:10:1813#include "ash/metrics/user_metrics_recorder.h"
jamescookd4649fa2016-09-30 17:50:0914#include "ash/public/cpp/shelf_types.h"
Xiyuan Xia22b1a6c2017-04-18 22:46:0115#include "ash/session/session_observer.h"
James Cook934abaf2017-09-19 22:21:5816#include "ash/wm/cursor_manager_chromeos.h"
[email protected]c0ce80e2012-10-05 23:28:2717#include "ash/wm/system_modal_container_event_filter_delegate.h"
[email protected]b0639282011-12-22 21:12:2718#include "base/gtest_prod_util.h"
avidb567a8a2015-12-20 17:07:2419#include "base/macros.h"
[email protected]6f67df52013-10-29 01:07:1520#include "base/memory/weak_ptr.h"
[email protected]1a2145b2012-03-13 21:09:1721#include "base/observer_list.h"
David Blackb92487842018-03-29 18:45:2822#include "chromeos/chromeos_switches.h"
Alex Newcomer8fdcb9342017-08-08 18:48:4423#include "ui/app_list/app_list_constants.h"
[email protected]c9390bd2013-11-08 20:33:1324#include "ui/aura/window.h"
oshimaf84b0da722016-04-27 19:47:1925#include "ui/display/screen.h"
[email protected]86ccbd42013-09-18 18:11:5426#include "ui/events/event_target.h"
[email protected]ee3ed10772014-03-11 22:02:0127#include "ui/wm/core/cursor_manager.h"
sky27344382017-03-08 21:30:3228#include "ui/wm/public/activation_change_observer.h"
[email protected]87b0d82e2011-10-07 21:02:5929
afakhrye4fae852017-05-09 18:49:0630class PrefRegistrySimple;
tibellb93c729b2017-03-30 00:45:0931class PrefService;
32
[email protected]87b0d82e2011-10-07 21:02:5933namespace aura {
[email protected]35304ce2011-12-14 23:21:0134class RootWindow;
derat94887a22017-01-20 18:17:2535class UserActivityForwarder;
[email protected]87b0d82e2011-10-07 21:02:5936class Window;
skya8b222f2017-01-12 15:47:1337class WindowManagerClient;
sky00f98a372017-01-11 06:03:4938class WindowTreeClient;
Alex Newcomer8fdcb9342017-08-08 18:48:4439} // namespace aura
[email protected]fa4a45832012-04-12 21:32:4840
rjkroege72f8154f2016-10-29 00:49:0241namespace display {
kylecharf2e4e412016-12-04 04:21:3542class DisplayChangeObserver;
kylechar7a067ec2017-01-07 01:16:2843class DisplayConfigurator;
rjkroege72f8154f2016-10-29 00:49:0244class DisplayManager;
Alex Newcomer8fdcb9342017-08-08 18:48:4445} // namespace display
rjkroege72f8154f2016-10-29 00:49:0246
Scott Violet737fb752018-04-11 15:35:2247namespace exo {
48class FileHelper;
49class NotificationSurfaceManager;
50} // namespace exo
51
[email protected]2b99f8c2011-10-11 19:42:2452namespace gfx {
sky4ec2be82017-01-06 17:38:3253class Insets;
[email protected]cac10fc62011-10-07 23:22:5654}
[email protected]b6ba05d902013-10-04 21:38:4555
[email protected]a8bd1cb2012-02-17 23:05:5456namespace ui {
Scott Violetc8a1c6c2017-11-29 23:17:3657class ContextFactory;
58class ContextFactoryPrivate;
derat2d4e62d2015-01-09 16:09:1759class UserActivityDetector;
[email protected]b0fa7012014-04-16 12:50:5760class UserActivityPowerManagerNotifier;
Alex Newcomer8fdcb9342017-08-08 18:48:4461} // namespace ui
thanhph3f3968512017-06-21 00:37:2362
[email protected]57b8bb352012-01-11 05:11:4663namespace views {
64class NonClientFrameView;
65class Widget;
[email protected]4a59e4e92012-11-12 21:15:4066namespace corewm {
[email protected]e319c7e2014-03-14 19:56:1467class TooltipController;
68}
Alex Newcomer8fdcb9342017-08-08 18:48:4469} // namespace views
[email protected]e319c7e2014-03-14 19:56:1470
71namespace wm {
[email protected]60d677d2014-05-30 13:07:0272class AcceleratorFilter;
Thiago Farina3b086a02017-05-30 22:32:5073class ActivationClient;
[email protected]4a59e4e92012-11-12 21:15:4074class CompoundEventFilter;
sky27344382017-03-08 21:30:3275class FocusController;
[email protected]86f2b5e2012-11-14 20:37:0076class ShadowController;
[email protected]b5756e22012-11-30 01:32:0277class VisibilityController;
[email protected]0c2dc012012-12-02 00:00:2378class WindowModalityController;
Alex Newcomer8fdcb9342017-08-08 18:48:4479} // namespace wm
[email protected]87b0d82e2011-10-07 21:02:5980
[email protected]55f593352011-12-24 05:42:4681namespace ash {
[email protected]87b0d82e2011-10-07 21:02:5982
sky81a2d792017-03-17 19:14:3983class AcceleratorController;
James Cookec144952017-09-01 00:05:1684class AccessibilityController;
sky07a24d42017-03-09 23:57:3085class AccessibilityDelegate;
Qiang Xua9591002018-03-15 22:29:3186class AccessibilityFocusRingController;
David Blacke8f815042018-03-28 18:59:3787class AshAssistantController;
Scott Violetd64dac12017-06-02 21:50:0888class AshDisplayController;
Jiaquan He4b48f912018-03-01 03:59:3989class AppListControllerImpl;
erg36cfb952017-06-21 19:41:4590class NativeCursorManagerAsh;
sky07a24d42017-03-09 23:57:3091class AshTouchTransformController;
[email protected]55398d2c2013-10-10 19:49:2092class AutoclickController;
Toni Barzic9d0c82f42017-12-06 00:53:5293class BacklightsForcedOffSetter;
[email protected]b31427252014-03-04 06:59:5094class BluetoothNotificationController;
Sonny Sasaka55f69fc2017-08-28 21:29:3795class BluetoothPowerController;
sky79fa34712017-03-20 23:46:4796class BrightnessControlDelegate;
Tetsui Ohkubo5e2499532018-04-04 02:01:3997class CapsLockNotificationController;
sky79fa34712017-03-20 23:46:4798class CastConfigController;
Toni Barzicd6238312018-03-02 18:26:1399class DetachableBaseHandler;
Toni Barzic550419f2018-03-08 03:56:21100class DetachableBaseNotificationController;
robert.bradfordab052492015-05-06 11:09:56101class DisplayColorManager;
stevenjb537c5c3f2016-01-20 23:38:12102class DisplayConfigurationController;
Steven Bennetts9b21fa32018-04-13 23:45:55103class DisplayConfigurationObserver;
[email protected]18b21b2e2013-03-01 20:56:23104class DisplayErrorObserver;
Steven Bennetts3688c6032018-04-13 01:14:23105class DisplayPrefs;
Steven Bennetts7683e342018-01-02 21:29:52106class DisplayShutdownObserver;
Ahmed Fakhry4bf3f742018-02-06 17:33:36107class DockedMagnifierController;
[email protected]084b6bb2011-11-17 05:18:16108class DragDropController;
[email protected]e67291f12012-10-10 05:52:38109class EventClientImpl;
[email protected]682990f2013-01-10 06:49:11110class EventTransformationHandler;
James Cookf5398842018-04-16 20:15:24111class FirstRunHelper;
sky79fa34712017-03-20 23:46:47112class FocusCycler;
[email protected]093b8d642014-04-03 20:59:28113class HighContrastController;
Vladislav Kaznacheev6d6aaff2017-07-22 04:06:32114class HighlighterController;
James Cookbb026732017-06-09 23:01:55115class ImeController;
sky5ab16472017-03-21 19:35:08116class ImmersiveContextAsh;
skyb7b54092016-08-19 16:00:09117class ImmersiveHandlerFactoryAsh;
sky79fa34712017-03-20 23:46:47118class KeyboardBrightnessControlDelegate;
119class KeyboardUI;
sammiequon203ae022016-09-18 17:23:42120class LaserPointerController;
sky79fa34712017-03-20 23:46:47121class LocaleNotificationController;
[email protected]093b8d642014-04-03 20:59:28122class LockStateController;
sky79fa34712017-03-20 23:46:47123class LogoutConfirmationController;
Jacob Dufaultffd9b0d2017-11-15 23:07:16124class LoginScreenController;
[email protected]093b8d642014-04-03 20:59:28125class MagnificationController;
Mitsuru Oshima0e9b7a62017-07-19 18:23:03126class TabletModeController;
sky5ab16472017-03-21 19:35:08127class MediaController;
Evan Stade2c43a87b32017-08-31 17:53:10128class MessageCenterController;
[email protected]78d9630c2012-06-22 00:58:07129class MouseCursorEventFilter;
sky5ab16472017-03-21 19:35:08130class MruWindowTracker;
131class NewWindowController;
afakhrye4fae852017-05-09 18:49:06132class NightLightController;
Vladislav Kaznacheev92edf62e2017-10-13 22:08:01133class NoteTakingController;
[email protected]9ae32df2012-07-26 03:25:18134class OverlayEventFilter;
[email protected]093b8d642014-04-03 20:59:28135class PartialMagnificationController;
Sammie Quon95c6a1c2017-09-12 19:16:55136class PeripheralBatteryNotifier;
Qiang Xud77a90c2018-02-20 19:43:29137class PersistentWindowController;
[email protected]093b8d642014-04-03 20:59:28138class PowerButtonController;
[email protected]51625052013-10-10 01:40:16139class PowerEventObserver;
Qiang Xu36234e532018-04-11 04:54:02140class PowerPrefs;
[email protected]72bce522014-02-10 21:11:26141class ProjectingObserver;
[email protected]e4a181cc2012-03-17 02:20:57142class ResizeShadowController;
[email protected]6ef71d72013-08-10 18:13:44143class ResolutionNotificationController;
[email protected]d90b8392012-06-13 09:34:56144class RootWindowController;
sky11cf8db92017-04-10 23:38:08145class ShellPort;
jamescookac6724332017-03-21 02:54:43146class ScreenLayoutObserver;
jonross0af45212015-01-13 18:55:46147class ScreenOrientationController;
oshima5a296e82016-04-29 01:32:27148class ScreenshotController;
hidehiko6821ca42016-06-18 11:12:23149class ScreenPinningController;
[email protected]8d625fb2012-07-18 16:40:06150class ScreenPositionController;
Tetsui Ohkubo3a92f0d92018-03-30 18:33:29151class ScreenSecurityNotificationController;
sky5ad143a2017-03-22 04:31:23152class SessionController;
sky5ad143a2017-03-22 04:31:23153class ShelfController;
sky5ad143a2017-03-22 04:31:23154class ShelfModel;
155class ShelfWindowWatcher;
skyb073203a2017-03-13 16:59:16156class ShellDelegate;
[email protected]1b4c7472014-05-15 18:32:23157struct ShellInitParams;
sky00c813f2017-03-08 22:48:55158class ShellObserver;
sky5b45ed82017-03-27 02:54:23159class ShutdownController;
yiyix90cfee22017-02-16 05:38:18160class SmsObserver;
xdaid4913762017-07-06 00:17:22161class SplitViewController;
[email protected]093b8d642014-04-03 20:59:28162class StickyKeysController;
[email protected]9ae32df2012-07-26 03:25:18163class SystemGestureEventFilter;
[email protected]c0ce80e2012-10-05 23:28:27164class SystemModalContainerEventFilter;
[email protected]093b8d642014-04-03 20:59:28165class SystemTray;
sky79fa34712017-03-20 23:46:47166class SystemTrayController;
Tetsui Ohkubo21722932018-03-02 02:56:56167class SystemTrayModel;
sky5b45ed82017-03-27 02:54:23168class SystemTrayNotifier;
Scott Violet3c554ae2017-12-13 02:25:41169class TimeToFirstPresentRecorder;
[email protected]093b8d642014-04-03 20:59:28170class ToplevelWindowEventHandler;
sky07a24d42017-03-09 23:57:30171class ToastManager;
Qiang Xuf1400a362017-09-14 02:28:30172class TouchDevicesController;
tbarzicc78da1ff92017-05-08 20:46:15173class TrayAction;
jamescookac6724332017-03-21 02:54:43174class TrayBluetoothHelper;
bsheeaae09a2014-09-22 23:16:52175class VirtualKeyboardController;
[email protected]ded58fd2013-10-09 07:56:55176class VideoActivityNotifier;
[email protected]093b8d642014-04-03 20:59:28177class VideoDetector;
Yue Lia33960a2017-11-01 22:06:07178class VoiceInteractionController;
sky5b45ed82017-03-27 02:54:23179class VpnList;
sky07a24d42017-03-09 23:57:30180class WallpaperController;
Scott Violet737fb752018-04-11 15:35:22181class WaylandServerController;
[email protected]093b8d642014-04-03 20:59:28182class WebNotificationTray;
sky5b45ed82017-03-27 02:54:23183class WindowCycleController;
[email protected]093b8d642014-04-03 20:59:28184class WindowPositioner;
sky5b45ed82017-03-27 02:54:23185class WindowSelectorController;
msw607227f82016-08-30 17:22:39186class WindowTreeHostManager;
[email protected]2b99f8c2011-10-11 19:42:24187
sky494c6cbd2017-03-27 20:57:48188enum class Config;
189enum class LoginStatus;
190
[email protected]87b0d82e2011-10-07 21:02:59191// Shell is a singleton object that presents the Shell API and implements the
[email protected]99f07e02011-12-07 00:02:59192// RootWindow's delegate interface.
[email protected]b0079a92012-01-25 20:13:38193//
194// Upon creation, the Shell sets itself as the RootWindow's delegate, which
195// takes ownership of the Shell.
Xiyuan Xia22b1a6c2017-04-18 22:46:01196class ASH_EXPORT Shell : public SessionObserver,
sky5ad143a2017-03-22 04:31:23197 public SystemModalContainerEventFilterDelegate,
sky27344382017-03-08 21:30:32198 public ui::EventTarget,
Thiago Farina3b086a02017-05-30 22:32:50199 public ::wm::ActivationChangeObserver {
[email protected]87b0d82e2011-10-07 21:02:59200 public:
[email protected]093b8d642014-04-03 20:59:28201 typedef std::vector<RootWindowController*> RootWindowControllerList;
[email protected]be65be362012-06-15 07:38:23202
Scott Violetc8a1c6c2017-11-29 23:17:36203 // Creates the single Shell instance.
204 static Shell* CreateInstance(ShellInitParams init_params);
[email protected]3266c2b92011-11-14 00:06:08205
206 // Should never be called before |CreateInstance()|.
skyb073203a2017-03-13 16:59:16207 static Shell* Get();
[email protected]3266c2b92011-11-14 00:06:08208
[email protected]b3b7bcd2012-03-06 19:35:45209 // Returns true if the ash shell has been instantiated.
210 static bool HasInstance();
211
[email protected]ef589af2011-12-03 01:07:15212 static void DeleteInstance();
[email protected]cac10fc62011-10-07 23:22:56213
[email protected]d90b8392012-06-13 09:34:56214 // Returns the root window controller for the primary root window.
[email protected]a0afeb12012-12-10 22:57:09215 // TODO(oshima): move this to |RootWindowController|
[email protected]093b8d642014-04-03 20:59:28216 static RootWindowController* GetPrimaryRootWindowController();
[email protected]d90b8392012-06-13 09:34:56217
thanhphc90f49ca2017-03-03 17:48:53218 // Returns the RootWindowController for the given display id. If there
219 // is no display for |display_id|, null is returned.
220 static RootWindowController* GetRootWindowControllerWithDisplayId(
221 int64_t display_id);
222
Scott Violet596bb46342017-06-21 14:43:13223 // Returns the root Window for the given display id. If there is no display
224 // for |display_id| null is returned.
225 static aura::Window* GetRootWindowForDisplayId(int64_t display_id);
226
[email protected]cf1c70e2012-08-30 01:13:02227 // Returns all root window controllers.
[email protected]a0afeb12012-12-10 22:57:09228 // TODO(oshima): move this to |RootWindowController|
[email protected]be65be362012-06-15 07:38:23229 static RootWindowControllerList GetAllRootWindowControllers();
230
[email protected]bf9cdb362013-10-25 19:22:45231 // Returns the primary root Window. The primary root Window is the one that
232 // has a launcher.
233 static aura::Window* GetPrimaryRootWindow();
[email protected]e73bd7802012-02-17 20:10:34234
sky27344382017-03-08 21:30:32235 // Returns the root window that newly created windows should be added to.
236 // Value can be temporarily overridden using ScopedRootWindowForNewWindows.
237 // NOTE: this returns the root, newly created window should be added to the
238 // appropriate container in the returned window.
239 static aura::Window* GetRootWindowForNewWindows();
mfomitcheva1a8aa62016-05-03 16:23:26240
[email protected]cf1c70e2012-08-30 01:13:02241 // Returns all root windows.
[email protected]c9390bd2013-11-08 20:33:13242 static aura::Window::Windows GetAllRootWindows();
[email protected]be65be362012-06-15 07:38:23243
[email protected]bf9cdb362013-10-25 19:22:45244 static aura::Window* GetContainer(aura::Window* root_window,
[email protected]7b0f7502012-06-11 00:12:39245 int container_id);
[email protected]bf9cdb362013-10-25 19:22:45246 static const aura::Window* GetContainer(const aura::Window* root_window,
[email protected]e67291f12012-10-10 05:52:38247 int container_id);
[email protected]7b0f7502012-06-11 00:12:39248
James Cook7b7c6a52018-01-04 23:40:03249 // If a system-modal dialog window is currently open, returns the ID of the
250 // system modal window container that contains the window.
251 // If no system-modal dialogs are open it returns -1.
252 static int GetOpenSystemModalWindowContainerId();
253
254 // Returns true if a system-modal dialog window is currently open.
255 static bool IsSystemModalWindowOpen();
256
skya8b222f2017-01-12 15:47:13257 // TODO(sky): move this and WindowManagerClient into ShellMash that is owned
258 // by Shell. Doing the move is gated on having mash create Shell.
sky00f98a372017-01-11 06:03:49259 static void set_window_tree_client(aura::WindowTreeClient* client) {
260 window_tree_client_ = client;
261 }
262
263 static aura::WindowTreeClient* window_tree_client() {
264 return window_tree_client_;
265 }
266
skya8b222f2017-01-12 15:47:13267 static void set_window_manager_client(aura::WindowManagerClient* client) {
268 window_manager_client_ = client;
269 }
270 static aura::WindowManagerClient* window_manager_client() {
271 return window_manager_client_;
272 }
273
jamescook0dfe5632017-04-05 18:49:02274 static Config GetAshConfig();
moshayedic229a522017-05-05 18:14:26275 static bool ShouldUseIMEService();
sky494c6cbd2017-03-27 20:57:48276
Wenzhao Zang56c292932017-08-02 04:58:34277 // Registers all ash related local state prefs to the given |registry|.
278 static void RegisterLocalStatePrefs(PrefRegistrySimple* registry);
279
Qiang Xu36234e532018-04-11 04:54:02280 // Registers all ash related signin/user profile prefs to the given
281 // |registry|. Can be called before Shell is initialized. When |for_test| is
282 // true this registers foreign user profile prefs (e.g. chrome prefs) as if
283 // they are owned by ash. This allows test code to read the pref values.
284 static void RegisterSigninProfilePrefs(PrefRegistrySimple* registry,
285 bool for_test = false);
286 static void RegisterUserProfilePrefs(PrefRegistrySimple* registry,
287 bool for_test = false);
afakhrye4fae852017-05-09 18:49:06288
Scott Violet737fb752018-04-11 15:35:22289 // If necessary, initializes the Wayland server.
290 void InitWaylandServer(
291 exo::NotificationSurfaceManager* notification_surface_manager,
292 std::unique_ptr<exo::FileHelper> file_helper);
293 void DestroyWaylandServer();
294
[email protected]57b8bb352012-01-11 05:11:46295 // Creates a default views::NonClientFrameView for use by windows in the
296 // Ash environment.
297 views::NonClientFrameView* CreateDefaultNonClientFrameView(
298 views::Widget* widget);
299
mswad28b252016-08-09 02:42:07300 // Sets work area insets of the display containing |window|, pings observers.
[email protected]2e236a52012-06-27 22:21:47301 void SetDisplayWorkAreaInsets(aura::Window* window,
[email protected]8a45c972012-03-14 18:22:44302 const gfx::Insets& insets);
[email protected]1a2145b2012-03-13 21:09:17303
[email protected]58868abf2014-01-17 23:45:33304 // Called when a casting session is started or stopped.
305 void OnCastingSessionStartedOrStopped(bool started);
306
[email protected]0e3e7cb2014-04-12 05:18:25307 // Called when a root window is created.
varkhac71444e52017-05-25 22:51:34308 void OnRootWindowAdded(aura::Window* root_window);
[email protected]0e3e7cb2014-04-12 05:18:25309
Keigo Okae82281a2017-06-14 13:59:14310 // Creates a keyboard controller and associate it with the primary root window
311 // controller. Destroys the old keyboard controller if it already exists.
[email protected]51f438112013-11-18 19:32:50312 void CreateKeyboard();
313
Keigo Okac7617a42017-06-14 11:33:24314 // Destroys the virtual keyboard.
315 void DestroyKeyboard();
[email protected]e1b299b2014-01-29 23:53:41316
Mitsuru Oshima0e9b7a62017-07-19 18:23:03317 // Test if TabletModeWindowManager is not enabled, and if
318 // TabletModeController is not currently setting a display rotation. Or if
[email protected]da285852014-05-27 19:53:43319 // the |resolution_notification_controller_| is not showing its confirmation
320 // dialog. If true then changes to display settings can be saved.
321 bool ShouldSaveDisplaySettings();
[email protected]da285852014-05-27 19:53:43322
sky81a2d792017-03-17 19:14:39323 AcceleratorController* accelerator_controller() {
324 return accelerator_controller_.get();
sky44a09892016-07-20 17:46:58325 }
James Cookec144952017-09-01 00:05:16326 AccessibilityController* accessibility_controller() {
327 return accessibility_controller_.get();
328 }
sky07a24d42017-03-09 23:57:30329 AccessibilityDelegate* accessibility_delegate() {
330 return accessibility_delegate_.get();
331 }
Qiang Xua9591002018-03-15 22:29:31332 AccessibilityFocusRingController* accessibility_focus_ring_controller() {
333 return accessibility_focus_ring_controller_.get();
334 }
Qiang Xuf1400a362017-09-14 02:28:30335 ::wm::ActivationClient* activation_client();
Jiaquan He4b48f912018-03-01 03:59:39336 AppListControllerImpl* app_list_controller() {
337 return app_list_controller_.get();
338 }
David Blacke8f815042018-03-28 18:59:37339 AshAssistantController* ash_assistant_controller() {
David Blackb92487842018-03-29 18:45:28340 DCHECK(chromeos::switches::IsAssistantEnabled());
David Blacke8f815042018-03-28 18:59:37341 return ash_assistant_controller_.get();
342 }
Scott Violetd64dac12017-06-02 21:50:08343 AshDisplayController* ash_display_controller() {
344 return ash_display_controller_.get();
345 }
Qiang Xuf1400a362017-09-14 02:28:30346 AutoclickController* autoclick_controller() {
347 return autoclick_controller_.get();
348 }
Daniel Erat477c56d2017-12-13 21:42:54349 BacklightsForcedOffSetter* backlights_forced_off_setter() {
350 return backlights_forced_off_setter_.get();
351 }
Qiang Xuf1400a362017-09-14 02:28:30352 BluetoothPowerController* bluetooth_power_controller() {
353 return bluetooth_power_controller_.get();
354 }
sky79fa34712017-03-20 23:46:47355 BrightnessControlDelegate* brightness_control_delegate() {
356 return brightness_control_delegate_.get();
357 }
358 CastConfigController* cast_config() { return cast_config_.get(); }
Steven Bennettsa866fca72017-11-07 19:39:35359
360 // Returns nullptr in mash which has no global cursor manager.
Qiang Xuf1400a362017-09-14 02:28:30361 ::wm::CursorManager* cursor_manager() { return cursor_manager_.get(); }
Steven Bennettsa866fca72017-11-07 19:39:35362
Toni Barzicd6238312018-03-02 18:26:13363 DetachableBaseHandler* detachable_base_handler() {
364 return detachable_base_handler_.get();
365 }
366
rjkroege72f8154f2016-10-29 00:49:02367 display::DisplayManager* display_manager() { return display_manager_.get(); }
Steven Bennetts3688c6032018-04-13 01:14:23368 DisplayPrefs* display_prefs() { return display_prefs_.get(); }
stevenjb537c5c3f2016-01-20 23:38:12369 DisplayConfigurationController* display_configuration_controller() {
370 return display_configuration_controller_.get();
371 }
Qiang Xuf1400a362017-09-14 02:28:30372
373 // TODO(oshima): Move these objects to WindowTreeHostManager.
374 display::DisplayConfigurator* display_configurator() {
375 return display_configurator_.get();
376 }
377 DisplayErrorObserver* display_error_observer() {
378 return display_error_observer_.get();
379 }
380
Ahmed Fakhry4bf3f742018-02-06 17:33:36381 DockedMagnifierController* docked_magnifier_controller();
jamescookb8dcef522016-06-25 14:42:55382 ::wm::CompoundEventFilter* env_filter() { return env_filter_.get(); }
Qiang Xuf1400a362017-09-14 02:28:30383 EventClientImpl* event_client() { return event_client_.get(); }
384 EventTransformationHandler* event_transformation_handler() {
385 return event_transformation_handler_.get();
386 }
James Cookf5398842018-04-16 20:15:24387 FirstRunHelper* first_run_helper() { return first_run_helper_.get(); }
sky79fa34712017-03-20 23:46:47388 FocusCycler* focus_cycler() { return focus_cycler_.get(); }
Qiang Xuf1400a362017-09-14 02:28:30389 HighlighterController* highlighter_controller() {
390 return highlighter_controller_.get();
391 }
392 HighContrastController* high_contrast_controller() {
393 return high_contrast_controller_.get();
394 }
James Cookf0c78fc2017-06-15 14:42:55395 ImeController* ime_controller() { return ime_controller_.get(); }
sky79fa34712017-03-20 23:46:47396 KeyboardBrightnessControlDelegate* keyboard_brightness_control_delegate() {
397 return keyboard_brightness_control_delegate_.get();
398 }
399 KeyboardUI* keyboard_ui() { return keyboard_ui_.get(); }
Qiang Xuf1400a362017-09-14 02:28:30400 LaserPointerController* laser_pointer_controller() {
401 return laser_pointer_controller_.get();
402 }
sky79fa34712017-03-20 23:46:47403 LocaleNotificationController* locale_notification_controller() {
404 return locale_notification_controller_.get();
405 }
Jacob Dufaultffd9b0d2017-11-15 23:07:16406 LoginScreenController* login_screen_controller() {
407 return login_screen_controller_.get();
xiaoyinh2bbdd102017-05-18 23:29:42408 }
Qiang Xuf1400a362017-09-14 02:28:30409 LockStateController* lock_state_controller() {
410 return lock_state_controller_.get();
411 }
412 LogoutConfirmationController* logout_confirmation_controller() {
413 return logout_confirmation_controller_.get();
414 }
415 MagnificationController* magnification_controller() {
416 return magnification_controller_.get();
417 }
sky5ab16472017-03-21 19:35:08418 MediaController* media_controller() { return media_controller_.get(); }
Evan Stade04c18d02017-10-20 20:53:22419 MessageCenterController* message_center_controller() {
420 return message_center_controller_.get();
421 }
Qiang Xuf1400a362017-09-14 02:28:30422 MouseCursorEventFilter* mouse_cursor_filter() {
423 return mouse_cursor_filter_.get();
424 }
sky5ab16472017-03-21 19:35:08425 MruWindowTracker* mru_window_tracker() { return mru_window_tracker_.get(); }
426 NewWindowController* new_window_controller() {
427 return new_window_controller_.get();
428 }
afakhry9e0a18b32017-06-05 19:23:14429 NightLightController* night_light_controller();
Vladislav Kaznacheev92edf62e2017-10-13 22:08:01430 NoteTakingController* note_taking_controller() {
431 return note_taking_controller_.get();
432 }
Qiang Xuf1400a362017-09-14 02:28:30433 OverlayEventFilter* overlay_filter() { return overlay_filter_.get(); }
Qiang Xuf1400a362017-09-14 02:28:30434 PartialMagnificationController* partial_magnification_controller() {
435 return partial_magnification_controller_.get();
436 }
437 PowerButtonController* power_button_controller() {
438 return power_button_controller_.get();
439 }
440 PowerEventObserver* power_event_observer() {
441 return power_event_observer_.get();
442 }
443 ResizeShadowController* resize_shadow_controller() {
444 return resize_shadow_controller_.get();
445 }
446 ResolutionNotificationController* resolution_notification_controller() {
447 return resolution_notification_controller_.get();
448 }
449 ScreenshotController* screenshot_controller() {
450 return screenshot_controller_.get();
451 }
452 ScreenLayoutObserver* screen_layout_observer() {
453 return screen_layout_observer_.get();
454 }
455 ScreenOrientationController* screen_orientation_controller() {
456 return screen_orientation_controller_.get();
457 }
458 ScreenPinningController* screen_pinning_controller() {
459 return screen_pinning_controller_.get();
460 }
sky5ad143a2017-03-22 04:31:23461 SessionController* session_controller() { return session_controller_.get(); }
462 ShelfController* shelf_controller() { return shelf_controller_.get(); }
sky5ad143a2017-03-22 04:31:23463 ShelfModel* shelf_model();
Qiang Xuf1400a362017-09-14 02:28:30464 ShellDelegate* shell_delegate() { return shell_delegate_.get(); }
sky5b45ed82017-03-27 02:54:23465 ShutdownController* shutdown_controller() {
466 return shutdown_controller_.get();
467 }
Qiang Xuf1400a362017-09-14 02:28:30468 SplitViewController* split_view_controller() {
469 return split_view_controller_.get();
470 }
471 StickyKeysController* sticky_keys_controller() {
472 return sticky_keys_controller_.get();
473 }
sky79fa34712017-03-20 23:46:47474 SystemTrayController* system_tray_controller() {
475 return system_tray_controller_.get();
476 }
Tetsui Ohkubo21722932018-03-02 02:56:56477 SystemTrayModel* system_tray_model() { return system_tray_model_.get(); }
sky5b45ed82017-03-27 02:54:23478 SystemTrayNotifier* system_tray_notifier() {
479 return system_tray_notifier_.get();
480 }
Sammie Quona6f96402017-08-24 01:08:37481 TabletModeController* tablet_mode_controller() {
482 return tablet_mode_controller_.get();
483 }
Scott Violet3c554ae2017-12-13 02:25:41484 TimeToFirstPresentRecorder* time_to_first_present_recorder() {
485 return time_to_first_present_recorder_.get();
486 }
Qiang Xuf1400a362017-09-14 02:28:30487 ToastManager* toast_manager() { return toast_manager_.get(); }
[email protected]a1b7a822013-02-23 19:08:04488 views::corewm::TooltipController* tooltip_controller() {
[email protected]862deef2011-12-15 22:07:33489 return tooltip_controller_.get();
[email protected]4a229e902011-12-01 21:21:11490 }
Qiang Xuf1400a362017-09-14 02:28:30491 TouchDevicesController* touch_devices_controller() {
492 return touch_devices_controller_.get();
chirantan40e4cd82015-02-19 01:08:19493 }
kylechar55f0eaf22017-01-11 22:57:37494 AshTouchTransformController* touch_transformer_controller() {
[email protected]03122891a2014-05-13 23:56:49495 return touch_transformer_controller_.get();
496 }
Qiang Xuf1400a362017-09-14 02:28:30497 TrayAction* tray_action() { return tray_action_.get(); }
498 TrayBluetoothHelper* tray_bluetooth_helper() {
499 return tray_bluetooth_helper_.get();
sammiequon203ae022016-09-18 17:23:42500 }
Evan Stade04c18d02017-10-20 20:53:22501 UserMetricsRecorder* metrics() { return user_metrics_recorder_.get(); }
Qiang Xuf1400a362017-09-14 02:28:30502 VideoDetector* video_detector() { return video_detector_.get(); }
503 VirtualKeyboardController* virtual_keyboard_controller() {
504 return virtual_keyboard_controller_.get();
sammiequon203ae022016-09-18 17:23:42505 }
Yue Lia33960a2017-11-01 22:06:07506 VoiceInteractionController* voice_interaction_controller() {
507 return voice_interaction_controller_.get();
508 }
Qiang Xuf1400a362017-09-14 02:28:30509 VpnList* vpn_list() { return vpn_list_.get(); }
510 WallpaperController* wallpaper_controller() {
511 return wallpaper_controller_.get();
Vladislav Kaznacheev6d6aaff2017-07-22 04:06:32512 }
Qiang Xuf1400a362017-09-14 02:28:30513 WindowCycleController* window_cycle_controller() {
514 return window_cycle_controller_.get();
mukai19274bdd2015-02-24 22:37:48515 }
Qiang Xuf1400a362017-09-14 02:28:30516 WindowPositioner* window_positioner() { return window_positioner_.get(); }
517 WindowSelectorController* window_selector_controller() {
518 return window_selector_controller_.get();
[email protected]8b7ba87b2012-09-01 00:40:40519 }
Qiang Xuf1400a362017-09-14 02:28:30520 WindowTreeHostManager* window_tree_host_manager() {
521 return window_tree_host_manager_.get();
[email protected]682990f2013-01-10 06:49:11522 }
[email protected]77f7c132012-11-15 06:52:54523
Mitsuru Oshima89e5c1352018-01-17 07:29:39524 ToplevelWindowEventHandler* toplevel_window_event_handler() {
525 return toplevel_window_event_handler_.get();
526 }
527
[email protected]c758fbf2012-03-25 22:53:59528 // Force the shelf to query for it's current visibility state.
jamescook6afad6d2016-06-01 00:35:01529 // TODO(jamescook): Move to Shelf.
[email protected]c758fbf2012-03-25 22:53:59530 void UpdateShelfVisibility();
531
[email protected]88d71122012-10-18 07:11:01532 // Returns WebNotificationTray on the primary root window.
533 WebNotificationTray* GetWebNotificationTray();
[email protected]6d6546e2012-05-30 23:12:02534
[email protected]a0afeb12012-12-10 22:57:09535 // Does the primary display have status area?
536 bool HasPrimaryStatusArea();
537
538 // Returns the system tray on primary display.
539 SystemTray* GetPrimarySystemTray();
[email protected]bfb411312012-02-27 20:59:27540
[email protected]f9466702012-09-17 16:35:27541 // Starts the animation that occurs on first login.
542 void DoInitialWorkspaceAnimation();
543
sky27344382017-03-08 21:30:32544 // NOTE: Prefer ScopedRootWindowForNewWindows when setting temporarily.
mswad3d9552017-05-18 21:23:36545 void set_root_window_for_new_windows(aura::Window* root) {
sky27344382017-03-08 21:30:32546 root_window_for_new_windows_ = root;
547 }
548
yawanodc5533b32017-02-23 11:04:38549 void SetLargeCursorSizeInDip(int large_cursor_size_in_dip);
550
Weidong Guod07448f2017-10-18 03:35:18551 // Updates cursor compositing on/off. Native cursor is disabled when cursor
[email protected]87ec2202014-02-06 06:24:27552 // compositing is enabled, and vice versa.
Weidong Guod07448f2017-10-18 03:35:18553 void UpdateCursorCompositingEnabled();
[email protected]87ec2202014-02-06 06:24:27554
Weidong Guod07448f2017-10-18 03:35:18555 // Force setting compositing on/off without checking dependency.
556 void SetCursorCompositingEnabled(bool enabled);
xdaid4913762017-07-06 00:17:22557
558 // Returns true if split view mode is active.
559 bool IsSplitViewModeActive() const;
560
sky00c813f2017-03-08 22:48:55561 void AddShellObserver(ShellObserver* observer);
562 void RemoveShellObserver(ShellObserver* observer);
563
sky5ad143a2017-03-22 04:31:23564 // Called when the login status changes.
565 // TODO(oshima): Investigate if we can merge this and |OnLoginStateChanged|.
566 void UpdateAfterLoginStatusChange(LoginStatus status);
567
sky00c813f2017-03-08 22:48:55568 // Notifies observers that overview mode is about to be started (before the
569 // windows get re-arranged).
570 void NotifyOverviewModeStarting();
571
Xiaoqian Daifb4698ed2018-02-23 20:11:06572 // Notifies observers that overview mode is about to end (bofore the windows
573 // restore themselves).
574 void NotifyOverviewModeEnding();
575
sky00c813f2017-03-08 22:48:55576 // Notifies observers that overview mode has ended.
577 void NotifyOverviewModeEnded();
578
xdaid4913762017-07-06 00:17:22579 // Notifies observers that split view mode is about to be started (before the
580 // window gets snapped and activated).
581 void NotifySplitViewModeStarting();
582
Xiaoqian Daibf3771f2018-03-13 18:21:46583 // Notifies observers that split view mode has been started.
584 void NotifySplitViewModeStarted();
585
xdaid4913762017-07-06 00:17:22586 // Notifies observers that split view mode has ended.
587 void NotifySplitViewModeEnded();
588
sky00c813f2017-03-08 22:48:55589 // Notifies observers that fullscreen mode has changed for |root_window|.
varkhac71444e52017-05-25 22:51:34590 void NotifyFullscreenStateChanged(bool is_fullscreen,
591 aura::Window* root_window);
sky00c813f2017-03-08 22:48:55592
593 // Notifies observers that |pinned_window| changed its pinned window state.
varkha19d7e6c52017-05-25 21:15:30594 void NotifyPinnedStateChanged(aura::Window* pinned_window);
sky00c813f2017-03-08 22:48:55595
596 // Notifies observers that the virtual keyboard has been
xiyuan38160182017-03-14 22:50:13597 // activated/deactivated for |root_window|.
sky97f9a7432017-05-09 05:14:31598 void NotifyVirtualKeyboardActivated(bool activated,
599 aura::Window* root_window);
sky00c813f2017-03-08 22:48:55600
601 // Notifies observers that the shelf was created for |root_window|.
602 // TODO(jamescook): Move to Shelf.
varkha6b016b0f2017-05-26 16:14:18603 void NotifyShelfCreatedForRootWindow(aura::Window* root_window);
sky00c813f2017-03-08 22:48:55604
605 // Notifies observers that |root_window|'s shelf changed alignment.
606 // TODO(jamescook): Move to Shelf.
varkha6b016b0f2017-05-26 16:14:18607 void NotifyShelfAlignmentChanged(aura::Window* root_window);
sky00c813f2017-03-08 22:48:55608
609 // Notifies observers that |root_window|'s shelf changed auto-hide behavior.
610 // TODO(jamescook): Move to Shelf.
varkha6b016b0f2017-05-26 16:14:18611 void NotifyShelfAutoHideBehaviorChanged(aura::Window* root_window);
sky00c813f2017-03-08 22:48:55612
jamescook518dccbd2017-05-18 04:57:07613 // Used to provide better error messages for Shell::Get() under mash.
614 static void SetIsBrowserProcessWithMash();
615
muyuanlid766f2e2017-06-26 20:17:19616 void NotifyAppListVisibilityChanged(bool visible, aura::Window* root_window);
617
[email protected]2b4cd302012-02-24 20:21:13618 private:
[email protected]c39be8f2012-06-15 22:58:36619 FRIEND_TEST_ALL_PREFIXES(ExtendedDesktopTest, TestCursor);
[email protected]1aad3322012-06-06 06:37:09620 FRIEND_TEST_ALL_PREFIXES(WindowManagerTest, MouseEventCursors);
621 FRIEND_TEST_ALL_PREFIXES(WindowManagerTest, TransformActivate);
sky79fa34712017-03-20 23:46:47622 friend class AcceleratorControllerTest;
Sam McNallya853cd82017-08-30 01:55:10623 friend class AshTestHelper;
[email protected]093b8d642014-04-03 20:59:28624 friend class RootWindowController;
sky27344382017-03-08 21:30:32625 friend class ScopedRootWindowForNewWindows;
James Cook317781a02017-07-18 02:08:06626 friend class ShellTestApi;
sky27344382017-03-08 21:30:32627 friend class SmsObserverTest;
[email protected]ad0c8722012-03-02 20:17:45628
skyb073203a2017-03-13 16:59:16629 Shell(std::unique_ptr<ShellDelegate> shell_delegate,
sky11cf8db92017-04-10 23:38:08630 std::unique_ptr<ShellPort> shell_port);
dcheng1f4538e2014-10-27 23:57:05631 ~Shell() override;
[email protected]3266c2b92011-11-14 00:06:08632
Scott Violetc8a1c6c2017-11-29 23:17:36633 void Init(ui::ContextFactory* context_factory,
634 ui::ContextFactoryPrivate* context_factory_private);
[email protected]b0639282011-12-22 21:12:27635
Steven Bennetts7683e342018-01-02 21:29:52636 // Initializes the display manager and related components.
637 void InitializeDisplayManager();
638
[email protected]a273d33a2013-10-17 12:41:21639 // Initializes the root window so that it can host browser windows.
[email protected]41baaed2013-11-09 04:18:26640 void InitRootWindow(aura::Window* root_window);
[email protected]d90b8392012-06-13 09:34:56641
skyabcae812017-01-18 17:01:34642 // Destroys all child windows including widgets across all roots.
643 void CloseAllRootWindowChildWindows();
644
hariank0dd03dd2016-07-14 23:47:33645 // SystemModalContainerEventFilterDelegate:
dcheng1f4538e2014-10-27 23:57:05646 bool CanWindowReceiveEvents(aura::Window* window) override;
[email protected]c0ce80e2012-10-05 23:28:27647
[email protected]5097e69c2012-10-30 22:08:41648 // Overridden from ui::EventTarget:
dcheng1f4538e2014-10-27 23:57:05649 bool CanAcceptEvent(const ui::Event& event) override;
650 EventTarget* GetParentTarget() override;
dchenga94547472016-04-08 08:41:11651 std::unique_ptr<ui::EventTargetIterator> GetChildIterator() const override;
dcheng1f4538e2014-10-27 23:57:05652 ui::EventTargeter* GetEventTargeter() override;
[email protected]5097e69c2012-10-30 22:08:41653
Thiago Farina3b086a02017-05-30 22:32:50654 // wm::ActivationChangeObserver:
sky27344382017-03-08 21:30:32655 void OnWindowActivated(ActivationReason reason,
656 aura::Window* gained_active,
657 aura::Window* lost_active) override;
658
Xiyuan Xia22b1a6c2017-04-18 22:46:01659 // SessionObserver:
Xiyuan Xiab64fd0a2017-04-13 17:53:14660 void OnSessionStateChanged(session_manager::SessionState state) override;
661 void OnLoginStatusChanged(LoginStatus login_status) override;
662 void OnLockStateChanged(bool locked) override;
sky5ad143a2017-03-22 04:31:23663
Sam McNallyf4dab612017-08-16 03:06:33664 // Callback for prefs::ConnectToPrefService.
Sam McNallye36abbc2017-07-20 01:04:28665 void OnLocalStatePrefServiceInitialized(
666 std::unique_ptr<::PrefService> pref_service);
tibellb93c729b2017-03-30 00:45:09667
[email protected]cac10fc62011-10-07 23:22:56668 static Shell* instance_;
669
sky00f98a372017-01-11 06:03:49670 // Only valid in mash, for classic ash this is null.
671 static aura::WindowTreeClient* window_tree_client_;
skya8b222f2017-01-12 15:47:13672 static aura::WindowManagerClient* window_manager_client_;
sky00f98a372017-01-11 06:03:49673
sky11cf8db92017-04-10 23:38:08674 std::unique_ptr<ShellPort> shell_port_;
sky984c1892016-04-20 00:00:34675
[email protected]1aad3322012-06-06 06:37:09676 // The CompoundEventFilter owned by aura::Env object.
dchenga94547472016-04-08 08:41:11677 std::unique_ptr<::wm::CompoundEventFilter> env_filter_;
[email protected]627a62f2012-02-14 22:59:14678
dchenga94547472016-04-08 08:41:11679 std::unique_ptr<UserMetricsRecorder> user_metrics_recorder_;
dchenga94547472016-04-08 08:41:11680 std::unique_ptr<WindowPositioner> window_positioner_;
[email protected]2b99f8c2011-10-11 19:42:24681
sky81a2d792017-03-17 19:14:39682 std::unique_ptr<AcceleratorController> accelerator_controller_;
James Cookec144952017-09-01 00:05:16683 std::unique_ptr<AccessibilityController> accessibility_controller_;
sky07a24d42017-03-09 23:57:30684 std::unique_ptr<AccessibilityDelegate> accessibility_delegate_;
Qiang Xua9591002018-03-15 22:29:31685 std::unique_ptr<AccessibilityFocusRingController>
686 accessibility_focus_ring_controller_;
Jiaquan He4b48f912018-03-01 03:59:39687 std::unique_ptr<AppListControllerImpl> app_list_controller_;
David Blacke8f815042018-03-28 18:59:37688 std::unique_ptr<AshAssistantController> ash_assistant_controller_;
Scott Violetd64dac12017-06-02 21:50:08689 std::unique_ptr<AshDisplayController> ash_display_controller_;
Toni Barzic9d0c82f42017-12-06 00:53:52690 std::unique_ptr<BacklightsForcedOffSetter> backlights_forced_off_setter_;
sky79fa34712017-03-20 23:46:47691 std::unique_ptr<BrightnessControlDelegate> brightness_control_delegate_;
Tetsui Ohkubo5e2499532018-04-04 02:01:39692 std::unique_ptr<CapsLockNotificationController>
693 caps_lock_notification_controller_;
sky79fa34712017-03-20 23:46:47694 std::unique_ptr<CastConfigController> cast_config_;
Toni Barzicd6238312018-03-02 18:26:13695 std::unique_ptr<DetachableBaseHandler> detachable_base_handler_;
Toni Barzic550419f2018-03-08 03:56:21696 std::unique_ptr<DetachableBaseNotificationController>
697 detachable_base_notification_controller_;
dchenga94547472016-04-08 08:41:11698 std::unique_ptr<DragDropController> drag_drop_controller_;
James Cookf5398842018-04-16 20:15:24699 std::unique_ptr<FirstRunHelper> first_run_helper_;
sky79fa34712017-03-20 23:46:47700 std::unique_ptr<FocusCycler> focus_cycler_;
James Cookf0c78fc2017-06-15 14:42:55701 std::unique_ptr<ImeController> ime_controller_;
sky5ab16472017-03-21 19:35:08702 std::unique_ptr<ImmersiveContextAsh> immersive_context_;
sky79fa34712017-03-20 23:46:47703 std::unique_ptr<KeyboardBrightnessControlDelegate>
704 keyboard_brightness_control_delegate_;
705 std::unique_ptr<KeyboardUI> keyboard_ui_;
706 std::unique_ptr<LocaleNotificationController> locale_notification_controller_;
Jacob Dufaultffd9b0d2017-11-15 23:07:16707 std::unique_ptr<LoginScreenController> login_screen_controller_;
sky79fa34712017-03-20 23:46:47708 std::unique_ptr<LogoutConfirmationController> logout_confirmation_controller_;
Mitsuru Oshima0e9b7a62017-07-19 18:23:03709 std::unique_ptr<TabletModeController> tablet_mode_controller_;
sky5ab16472017-03-21 19:35:08710 std::unique_ptr<MediaController> media_controller_;
711 std::unique_ptr<MruWindowTracker> mru_window_tracker_;
712 std::unique_ptr<NewWindowController> new_window_controller_;
dchenga94547472016-04-08 08:41:11713 std::unique_ptr<ResizeShadowController> resize_shadow_controller_;
sky5ad143a2017-03-22 04:31:23714 std::unique_ptr<SessionController> session_controller_;
afakhrye4fae852017-05-09 18:49:06715 std::unique_ptr<NightLightController> night_light_controller_;
Vladislav Kaznacheev92edf62e2017-10-13 22:08:01716 std::unique_ptr<NoteTakingController> note_taking_controller_;
Tetsui Ohkubo3a92f0d92018-03-30 18:33:29717 std::unique_ptr<ScreenSecurityNotificationController>
718 screen_security_notification_controller_;
sky5ad143a2017-03-22 04:31:23719 std::unique_ptr<ShelfController> shelf_controller_;
sky5ad143a2017-03-22 04:31:23720 std::unique_ptr<ShelfWindowWatcher> shelf_window_watcher_;
skyb073203a2017-03-13 16:59:16721 std::unique_ptr<ShellDelegate> shell_delegate_;
sky5b45ed82017-03-27 02:54:23722 std::unique_ptr<ShutdownController> shutdown_controller_;
sky79fa34712017-03-20 23:46:47723 std::unique_ptr<SystemTrayController> system_tray_controller_;
Tetsui Ohkubo21722932018-03-02 02:56:56724 std::unique_ptr<SystemTrayModel> system_tray_model_;
sky5b45ed82017-03-27 02:54:23725 std::unique_ptr<SystemTrayNotifier> system_tray_notifier_;
sky07a24d42017-03-09 23:57:30726 std::unique_ptr<ToastManager> toast_manager_;
Qiang Xuf1400a362017-09-14 02:28:30727 std::unique_ptr<TouchDevicesController> touch_devices_controller_;
Scott Violet3c554ae2017-12-13 02:25:41728 std::unique_ptr<TimeToFirstPresentRecorder> time_to_first_present_recorder_;
tbarzicc78da1ff92017-05-08 20:46:15729 std::unique_ptr<TrayAction> tray_action_;
Yue Lia33960a2017-11-01 22:06:07730 std::unique_ptr<VoiceInteractionController> voice_interaction_controller_;
sky5b45ed82017-03-27 02:54:23731 std::unique_ptr<VpnList> vpn_list_;
sky07a24d42017-03-09 23:57:30732 std::unique_ptr<WallpaperController> wallpaper_controller_;
sky5b45ed82017-03-27 02:54:23733 std::unique_ptr<WindowCycleController> window_cycle_controller_;
734 std::unique_ptr<WindowSelectorController> window_selector_controller_;
dchenga94547472016-04-08 08:41:11735 std::unique_ptr<::wm::ShadowController> shadow_controller_;
736 std::unique_ptr<::wm::VisibilityController> visibility_controller_;
737 std::unique_ptr<::wm::WindowModalityController> window_modality_controller_;
Sam McNallya853cd82017-08-30 01:55:10738 std::unique_ptr<PrefService> local_state_;
dchenga94547472016-04-08 08:41:11739 std::unique_ptr<views::corewm::TooltipController> tooltip_controller_;
dchenga94547472016-04-08 08:41:11740 std::unique_ptr<PowerButtonController> power_button_controller_;
741 std::unique_ptr<LockStateController> lock_state_controller_;
dchenga94547472016-04-08 08:41:11742 std::unique_ptr<ui::UserActivityDetector> user_activity_detector_;
743 std::unique_ptr<VideoDetector> video_detector_;
Scott Violet737fb752018-04-11 15:35:22744 std::unique_ptr<WaylandServerController> wayland_server_controller_;
dchenga94547472016-04-08 08:41:11745 std::unique_ptr<WindowTreeHostManager> window_tree_host_manager_;
Qiang Xud77a90c2018-02-20 19:43:29746 std::unique_ptr<PersistentWindowController> persistent_window_controller_;
dchenga94547472016-04-08 08:41:11747 std::unique_ptr<HighContrastController> high_contrast_controller_;
748 std::unique_ptr<MagnificationController> magnification_controller_;
dchenga94547472016-04-08 08:41:11749 std::unique_ptr<AutoclickController> autoclick_controller_;
sky27344382017-03-08 21:30:32750 std::unique_ptr<::wm::FocusController> focus_controller_;
sky984c1892016-04-20 00:00:34751
oshima5a296e82016-04-29 01:32:27752 std::unique_ptr<ScreenshotController> screenshot_controller_;
[email protected]f5c9dbc2014-04-11 08:13:45753
dchenga94547472016-04-08 08:41:11754 std::unique_ptr<MouseCursorEventFilter> mouse_cursor_filter_;
755 std::unique_ptr<ScreenPositionController> screen_position_controller_;
756 std::unique_ptr<SystemModalContainerEventFilter> modality_filter_;
757 std::unique_ptr<EventClientImpl> event_client_;
758 std::unique_ptr<EventTransformationHandler> event_transformation_handler_;
[email protected]ae18b9112011-11-07 16:59:13759
[email protected]0b0b0742012-02-16 13:23:45760 // An event filter that pre-handles key events while the partial
[email protected]a1584a712012-07-30 21:02:26761 // screenshot UI or the keyboard overlay is active.
dchenga94547472016-04-08 08:41:11762 std::unique_ptr<OverlayEventFilter> overlay_filter_;
[email protected]0b0b0742012-02-16 13:23:45763
[email protected]3537d472014-01-15 05:45:31764 // An event filter which handles moving and resizing windows.
dchenga94547472016-04-08 08:41:11765 std::unique_ptr<ToplevelWindowEventHandler> toplevel_window_event_handler_;
[email protected]3537d472014-01-15 05:45:31766
[email protected]435b212e2012-04-05 19:43:37767 // An event filter which handles system level gestures
dchenga94547472016-04-08 08:41:11768 std::unique_ptr<SystemGestureEventFilter> system_gesture_filter_;
[email protected]435b212e2012-04-05 19:43:37769
[email protected]745816be2011-11-22 05:08:30770 // An event filter that pre-handles global accelerators.
dchenga94547472016-04-08 08:41:11771 std::unique_ptr<::wm::AcceleratorFilter> accelerator_filter_;
[email protected]745816be2011-11-22 05:08:30772
rjkroege72f8154f2016-10-29 00:49:02773 std::unique_ptr<display::DisplayManager> display_manager_;
Steven Bennetts3688c6032018-04-13 01:14:23774 std::unique_ptr<DisplayPrefs> display_prefs_;
dchenga94547472016-04-08 08:41:11775 std::unique_ptr<DisplayConfigurationController>
776 display_configuration_controller_;
Steven Bennetts9b21fa32018-04-13 23:45:55777 std::unique_ptr<DisplayConfigurationObserver> display_configuration_observer_;
[email protected]6bdf7952012-11-14 10:10:58778
hidehiko6821ca42016-06-18 11:12:23779 std::unique_ptr<ScreenPinningController> screen_pinning_controller_;
[email protected]a9a40462013-07-31 06:22:56780
derat94887a22017-01-20 18:17:25781 // Forwards user activity ui::mojom::UserActivityMonitor to
782 // |user_activity_detector_|. Only initialized for mash.
783 std::unique_ptr<aura::UserActivityForwarder> user_activity_forwarder_;
784
Sammie Quon95c6a1c2017-09-12 19:16:55785 std::unique_ptr<PeripheralBatteryNotifier> peripheral_battery_notifier_;
dchenga94547472016-04-08 08:41:11786 std::unique_ptr<PowerEventObserver> power_event_observer_;
Qiang Xu36234e532018-04-11 04:54:02787 std::unique_ptr<PowerPrefs> power_prefs_;
dchenga94547472016-04-08 08:41:11788 std::unique_ptr<ui::UserActivityPowerManagerNotifier> user_activity_notifier_;
789 std::unique_ptr<VideoActivityNotifier> video_activity_notifier_;
790 std::unique_ptr<StickyKeysController> sticky_keys_controller_;
791 std::unique_ptr<ResolutionNotificationController>
[email protected]7bc49bd2014-01-22 09:30:34792 resolution_notification_controller_;
dchenga94547472016-04-08 08:41:11793 std::unique_ptr<BluetoothNotificationController>
[email protected]b31427252014-03-04 06:59:50794 bluetooth_notification_controller_;
Sonny Sasaka55f69fc2017-08-28 21:29:37795 std::unique_ptr<BluetoothPowerController> bluetooth_power_controller_;
jamescookac6724332017-03-21 02:54:43796 std::unique_ptr<TrayBluetoothHelper> tray_bluetooth_helper_;
dchenga94547472016-04-08 08:41:11797 std::unique_ptr<VirtualKeyboardController> virtual_keyboard_controller_;
[email protected]70b3e7d52012-06-02 22:12:25798 // Controls video output device state.
kylechar7a067ec2017-01-07 01:16:28799 std::unique_ptr<display::DisplayConfigurator> display_configurator_;
dchenga94547472016-04-08 08:41:11800 std::unique_ptr<DisplayColorManager> display_color_manager_;
801 std::unique_ptr<DisplayErrorObserver> display_error_observer_;
802 std::unique_ptr<ProjectingObserver> projecting_observer_;
[email protected]6bdf7952012-11-14 10:10:58803
[email protected]c1234a42013-08-20 09:35:40804 // Listens for output changes and updates the display manager.
kylecharf2e4e412016-12-04 04:21:35805 std::unique_ptr<display::DisplayChangeObserver> display_change_observer_;
[email protected]3dff2efd2014-02-09 22:50:39806
kylechar98748a52016-12-03 01:33:22807 // Listens for shutdown and updates DisplayConfigurator.
Steven Bennetts7683e342018-01-02 21:29:52808 std::unique_ptr<DisplayShutdownObserver> display_shutdown_observer_;
kylechar98748a52016-12-03 01:33:22809
yiyix90cfee22017-02-16 05:38:18810 // Listens for new sms messages and shows notifications.
811 std::unique_ptr<SmsObserver> sms_observer_;
812
derat94887a22017-01-20 18:17:25813 // Implements content::ScreenOrientationController for Chrome OS.
dchenga94547472016-04-08 08:41:11814 std::unique_ptr<ScreenOrientationController> screen_orientation_controller_;
yiyixa68ade512016-09-01 17:38:13815 std::unique_ptr<ScreenLayoutObserver> screen_layout_observer_;
jonrossf21fea12014-11-13 01:22:51816
kylechar55f0eaf22017-01-11 22:57:37817 std::unique_ptr<AshTouchTransformController> touch_transformer_controller_;
dnicoara8c3bd1e62014-10-30 19:53:39818
dchenga94547472016-04-08 08:41:11819 std::unique_ptr<ui::EventHandler> magnifier_key_scroll_handler_;
820 std::unique_ptr<ui::EventHandler> speech_feedback_handler_;
sammiequon203ae022016-09-18 17:23:42821 std::unique_ptr<LaserPointerController> laser_pointer_controller_;
822 std::unique_ptr<PartialMagnificationController>
823 partial_magnification_controller_;
Vladislav Kaznacheev6d6aaff2017-07-22 04:06:32824 std::unique_ptr<HighlighterController> highlighter_controller_;
[email protected]70b3e7d52012-06-02 22:12:25825
Ahmed Fakhry4bf3f742018-02-06 17:33:36826 std::unique_ptr<DockedMagnifierController> docked_magnifier_controller_;
827
xdaid4913762017-07-06 00:17:22828 // The split view controller for Chrome OS in tablet mode.
829 std::unique_ptr<SplitViewController> split_view_controller_;
830
[email protected]c0ff0342013-02-27 00:41:29831 // |native_cursor_manager_| is owned by |cursor_manager_|, but we keep a
832 // pointer to vend to test code.
erg36cfb952017-06-21 19:41:45833 NativeCursorManagerAsh* native_cursor_manager_;
[email protected]e76096a5f2014-04-08 04:08:03834
derat94887a22017-01-20 18:17:25835 // Cursor may be hidden on certain key events in Chrome OS, whereas we never
sadrul7a8785e2016-02-12 21:54:35836 // hide the cursor on Windows.
dchenga94547472016-04-08 08:41:11837 std::unique_ptr<::wm::CursorManager> cursor_manager_;
[email protected]4b8003c2012-07-26 00:54:19838
[email protected]852a55d2012-10-17 13:30:30839 // For testing only: simulate that a modal window is open
James Cook7b7c6a52018-01-04 23:40:03840 bool simulate_modal_window_open_for_test_ = false;
[email protected]852a55d2012-10-17 13:30:30841
mswad3d9552017-05-18 21:23:36842 // See comment for GetRootWindowForNewWindows().
843 aura::Window* root_window_for_new_windows_ = nullptr;
844 aura::Window* scoped_root_window_for_new_windows_ = nullptr;
sky27344382017-03-08 21:30:32845
skyb7b54092016-08-19 16:00:09846 std::unique_ptr<ImmersiveHandlerFactoryAsh> immersive_handler_factory_;
847
Evan Stade2c43a87b32017-08-31 17:53:10848 std::unique_ptr<MessageCenterController> message_center_controller_;
849
sky00c813f2017-03-08 22:48:55850 base::ObserverList<ShellObserver> shell_observers_;
851
Sam McNallye36abbc2017-07-20 01:04:28852 base::WeakPtrFactory<Shell> weak_factory_;
853
[email protected]87b0d82e2011-10-07 21:02:59854 DISALLOW_COPY_AND_ASSIGN(Shell);
855};
856
[email protected]55f593352011-12-24 05:42:46857} // namespace ash
[email protected]87b0d82e2011-10-07 21:02:59858
[email protected]b65bdda2011-12-23 23:35:31859#endif // ASH_SHELL_H_