blob: cfee3fe41816412b43fb83a1b295b492ca02184e [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"
Mitsuru Oshimae3e29b32020-07-07 17:29:1714#include "ash/public/cpp/session/session_observer.h"
jamescookd4649fa2016-09-30 17:50:0915#include "ash/public/cpp/shelf_types.h"
[email protected]c0ce80e2012-10-05 23:28:2716#include "ash/wm/system_modal_container_event_filter_delegate.h"
[email protected]b0639282011-12-22 21:12:2717#include "base/gtest_prod_util.h"
avidb567a8a2015-12-20 17:07:2418#include "base/macros.h"
[email protected]6f67df52013-10-29 01:07:1519#include "base/memory/weak_ptr.h"
[email protected]1a2145b2012-03-13 21:09:1720#include "base/observer_list.h"
[email protected]c9390bd2013-11-08 20:33:1321#include "ui/aura/window.h"
James Cookfa4838e2018-08-08 16:30:1522#include "ui/base/ui_base_types.h"
oshimaf84b0da722016-04-27 19:47:1923#include "ui/display/screen.h"
[email protected]86ccbd42013-09-18 18:11:5424#include "ui/events/event_target.h"
[email protected]ee3ed10772014-03-11 22:02:0125#include "ui/wm/core/cursor_manager.h"
sky27344382017-03-08 21:30:3226#include "ui/wm/public/activation_change_observer.h"
[email protected]87b0d82e2011-10-07 21:02:5927
tibellb93c729b2017-03-30 00:45:0928class PrefService;
29
[email protected]87b0d82e2011-10-07 21:02:5930namespace aura {
[email protected]35304ce2011-12-14 23:21:0131class RootWindow;
[email protected]87b0d82e2011-10-07 21:02:5932class Window;
Alex Newcomer8fdcb9342017-08-08 18:48:4433} // namespace aura
[email protected]fa4a45832012-04-12 21:32:4834
Steven Bennettsadc71d02019-04-17 18:15:5435namespace dbus {
36class Bus;
37}
38
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
[email protected]2b99f8c2011-10-11 19:42:2445namespace gfx {
sky4ec2be82017-01-06 17:38:3246class Insets;
James Cookfa4838e2018-08-08 16:30:1547class Point;
Weidong Guo242bf92b2019-01-26 01:19:2348} // namespace gfx
[email protected]b6ba05d902013-10-04 21:38:4549
Jun Mukaif2357792018-12-20 19:58:0050namespace keyboard {
51class KeyboardUIFactory;
52}
53
[email protected]a8bd1cb2012-02-17 23:05:5454namespace ui {
Scott Violetc8a1c6c2017-11-29 23:17:3655class ContextFactory;
derat2d4e62d2015-01-09 16:09:1756class UserActivityDetector;
[email protected]b0fa7012014-04-16 12:50:5757class UserActivityPowerManagerNotifier;
Alex Newcomer8fdcb9342017-08-08 18:48:4458} // namespace ui
thanhph3f3968512017-06-21 00:37:2359
[email protected]57b8bb352012-01-11 05:11:4660namespace views {
61class NonClientFrameView;
62class Widget;
[email protected]4a59e4e2012-11-12 21:15:4063namespace corewm {
[email protected]e319c7e2014-03-14 19:56:1464class TooltipController;
65}
Alex Newcomer8fdcb9342017-08-08 18:48:4466} // namespace views
[email protected]e319c7e2014-03-14 19:56:1467
68namespace wm {
[email protected]60d677d2014-05-30 13:07:0269class AcceleratorFilter;
Thiago Farina3b086a02017-05-30 22:32:5070class ActivationClient;
[email protected]4a59e4e2012-11-12 21:15:4071class CompoundEventFilter;
sky27344382017-03-08 21:30:3272class FocusController;
[email protected]86f2b5e2012-11-14 20:37:0073class ShadowController;
[email protected]b5756e22012-11-30 01:32:0274class VisibilityController;
[email protected]0c2dc012012-12-02 00:00:2375class WindowModalityController;
Alex Newcomer8fdcb9342017-08-08 18:48:4476} // namespace wm
[email protected]87b0d82e2011-10-07 21:02:5977
[email protected]55f593352011-12-24 05:42:4678namespace ash {
[email protected]87b0d82e2011-10-07 21:02:5979
Evan Staded7748c52019-05-08 18:17:2780class AcceleratorControllerImpl;
Mike Wassermand13e95a2019-06-28 23:29:4881class AccessibilityControllerImpl;
sky07a24d42017-03-09 23:57:3082class AccessibilityDelegate;
Mike Wassermanb00478d52019-06-18 22:20:3283class AccessibilityFocusRingControllerImpl;
wutao9caadca2019-07-16 05:06:4684class AmbientController;
Jeroen Dhollanderb35f54622020-09-30 15:44:2485class AppListControllerImpl;
86class AshColorProvider;
Jeffrey Kardatzkef108f022018-04-17 17:52:3587class AshDBusServices;
James Cooka8963fb2019-03-09 01:00:4088class AshFocusRules;
sky07a24d42017-03-09 23:57:3089class AshTouchTransformController;
David Blackec4cbcd2020-04-15 20:35:2590class AssistantControllerImpl;
[email protected]55398d22013-10-10 19:49:2091class AutoclickController;
mincha25f0d32020-01-17 02:55:5592class BackGestureEventHandler;
Toni Barzic9d0c82f42017-12-06 00:53:5293class BacklightsForcedOffSetter;
Jeroen Dhollanderb35f54622020-09-30 15:44:2494class BloomUiControllerImpl;
[email protected]b3142722014-03-04 06:59:5095class BluetoothNotificationController;
Sonny Sasaka55f69fc2017-08-28 21:29:3796class BluetoothPowerController;
sky79fa34712017-03-20 23:46:4797class BrightnessControlDelegate;
Ahmed Fakhry0c6efef2020-07-30 21:51:1998class CaptureModeController;
Steven Bennetts2a9b4382018-04-26 23:41:1999class CrosDisplayConfig;
Ahmed Fakhryc77ce402019-02-13 02:32:00100class DesksController;
Toni Barzicd6238312018-03-02 18:26:13101class DetachableBaseHandler;
Toni Barzic550419f2018-03-08 03:56:21102class DetachableBaseNotificationController;
Bailey Berro01bc58c82020-06-22 17:52:02103class DisplayAlignmentController;
robert.bradfordab052492015-05-06 11:09:56104class DisplayColorManager;
Jeroen Dhollanderb35f54622020-09-30 15:44:24105class NativeCursorManagerAsh;
stevenjb537c5c3f2016-01-20 23:38:12106class DisplayConfigurationController;
Steven Bennetts9b21fa32018-04-13 23:45:55107class DisplayConfigurationObserver;
[email protected]18b21b2e2013-03-01 20:56:23108class DisplayErrorObserver;
Su Hong Kood22ceb12020-04-06 16:44:07109class DisplayHighlightController;
Steven Bennetts3688c6032018-04-13 01:14:23110class DisplayPrefs;
Steven Bennetts7683e342018-01-02 21:29:52111class DisplayShutdownObserver;
Tetsui Ohkubo01421b32018-05-30 16:54:59112class DisplaySpeakerController;
Jun Mukaif701ffa82019-05-15 20:45:25113class DockedMagnifierControllerImpl;
[email protected]084b6bb2011-11-17 05:18:16114class DragDropController;
[email protected]e67291f12012-10-10 05:52:38115class EventClientImpl;
Mike Wassermanaac88db12019-06-03 21:40:45116class EventRewriterControllerImpl;
[email protected]682990f2013-01-10 06:49:11117class EventTransformationHandler;
sky79fa34712017-03-20 23:46:47118class FocusCycler;
yjliu10679cf2020-07-17 18:16:46119class FrameThrottlingController;
[email protected]093b8d642014-04-03 20:59:28120class HighContrastController;
Vladislav Kaznacheev6d6aaff2017-07-22 04:06:32121class HighlighterController;
Toni Barzice64ee292020-07-22 21:34:29122class HoldingSpaceController;
Michael Giuffrida2d922de2019-03-08 00:53:14123class HomeScreenController;
Darren Shen7b132782019-12-10 04:36:06124class ImeControllerImpl;
Evan Stade14672042018-10-11 02:03:50125class ImmersiveContext;
Yicheng Li93ebc692020-07-29 18:01:01126class InSessionAuthDialogControllerImpl;
David Tseng6792dc82018-05-04 19:18:41127class KeyAccessibilityEnabler;
sky79fa34712017-03-20 23:46:47128class KeyboardBrightnessControlDelegate;
Darren Shen7daf3e12019-07-02 07:25:49129class KeyboardControllerImpl;
sammiequon203ae022016-09-18 17:23:42130class LaserPointerController;
Xiyuan Xiabe4303e72019-06-06 18:14:50131class LocaleUpdateControllerImpl;
[email protected]093b8d642014-04-03 20:59:28132class LockStateController;
sky79fa34712017-03-20 23:46:47133class LogoutConfirmationController;
Jacob Dufaultffd9b0d2017-11-15 23:07:16134class LoginScreenController;
[email protected]093b8d642014-04-03 20:59:28135class MagnificationController;
Mitsuru Oshima0e9b7a62017-07-19 18:23:03136class TabletModeController;
Xiyuan Xiad03bd2f2019-06-05 22:00:49137class MediaControllerImpl;
Tommy Steimel875de1d42019-05-17 17:11:42138class MediaNotificationControllerImpl;
Evan Stade2c43a87b32017-08-31 17:53:10139class MessageCenterController;
[email protected]78d96302012-06-22 00:58:07140class MouseCursorEventFilter;
sky5ab16472017-03-21 19:35:08141class MruWindowTracker;
Kyle Horimoto9fc84fc22018-04-27 19:45:15142class MultiDeviceNotificationPresenter;
Curt Clemens8c3a59a52020-09-25 23:58:19143class NearbyShareControllerImpl;
Curt Clemensc6659632020-09-16 18:32:15144class NearbyShareDelegate;
Steven Bennetts32f5d552019-07-09 16:16:13145class NightLightControllerImpl;
[email protected]9ae32df2012-07-26 03:25:18146class OverlayEventFilter;
Scott Violet60ca8a92019-04-25 23:19:31147class OverviewController;
Fabian Sommerdcb675c2020-02-12 09:31:05148class ParentAccessController;
[email protected]093b8d642014-04-03 20:59:28149class PartialMagnificationController;
Sammie Quon95c6a1c2017-09-12 19:16:55150class PeripheralBatteryNotifier;
Alberto Herrera8a896dcc2019-07-24 22:41:44151class PeripheralBatteryTracker;
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;
Gil Dekel69777032020-02-07 18:41:53157class PrivacyScreenController;
[email protected]72bce522014-02-10 21:11:26158class ProjectingObserver;
Xiao Yanga16ba22e2020-03-01 04:50:25159class QuickAnswersController;
[email protected]e4a181cc2012-03-17 02:20:57160class ResizeShadowController;
[email protected]6ef71d72013-08-10 18:13:44161class ResolutionNotificationController;
[email protected]d90b8392012-06-13 09:34:56162class RootWindowController;
jamescookac6724332017-03-21 02:54:43163class ScreenLayoutObserver;
jonross0af45212015-01-13 18:55:46164class ScreenOrientationController;
oshima5a296e82016-04-29 01:32:27165class ScreenshotController;
hidehiko6821ca42016-06-18 11:12:23166class ScreenPinningController;
[email protected]8d625fb2012-07-18 16:40:06167class ScreenPositionController;
Tetsui Ohkubo54d50222018-05-10 01:58:11168class ScreenSwitchCheckController;
Xiyuan Xiae7b19542019-05-06 23:05:18169class SessionControllerImpl;
Matthew Mourgos75327562019-09-09 21:23:57170class ShelfConfig;
sky5ad143a2017-03-22 04:31:23171class ShelfController;
sky5ad143a2017-03-22 04:31:23172class ShelfWindowWatcher;
skyb073203a2017-03-13 16:59:16173class ShellDelegate;
[email protected]1b4c7472014-05-15 18:32:23174struct ShellInitParams;
sky00c813f2017-03-08 22:48:55175class ShellObserver;
Xiyuan Xia7107d492019-06-05 16:58:54176class ShutdownControllerImpl;
yiyix90cfee22017-02-16 05:38:18177class SmsObserver;
Evan Stadeeb42d772019-05-03 01:51:34178class SnapController;
[email protected]093b8d642014-04-03 20:59:28179class StickyKeysController;
[email protected]9ae32df2012-07-26 03:25:18180class SystemGestureEventFilter;
[email protected]c0ce80e2012-10-05 23:28:27181class SystemModalContainerEventFilter;
Tetsui Ohkubo269b5792018-04-26 01:06:32182class SystemNotificationController;
Tetsui Ohkubo21722932018-03-02 02:56:56183class SystemTrayModel;
sky5b45ed82017-03-27 02:54:23184class SystemTrayNotifier;
Anastasiia Nikolaienko8cdd7e62019-06-12 12:16:24185class ToastManagerImpl;
Scott Violet60ca8a92019-04-25 23:19:31186class ToplevelWindowEventHandler;
Andrew Xu2a5e5c42020-09-25 18:33:08187class ClipboardHistoryControllerImpl;
Qiang Xuf1400a362017-09-14 02:28:30188class TouchDevicesController;
tbarzicc78da1ff92017-05-08 20:46:15189class TrayAction;
jamescookac6724332017-03-21 02:54:43190class TrayBluetoothHelper;
[email protected]ded58fd2013-10-09 07:56:55191class VideoActivityNotifier;
[email protected]093b8d642014-04-03 20:59:28192class VideoDetector;
Mike Wassermana5352da2019-05-30 17:26:08193class WallpaperControllerImpl;
sky5b45ed82017-03-27 02:54:23194class WindowCycleController;
[email protected]093b8d642014-04-03 20:59:28195class WindowPositioner;
msw607227f82016-08-30 17:22:39196class WindowTreeHostManager;
Mitsuru Oshima51bf3d5472020-06-17 21:28:34197class ArcInputMethodBoundsTracker;
[email protected]2b99f8c2011-10-11 19:42:24198
sky494c6cbd2017-03-27 20:57:48199enum class LoginStatus;
200
[email protected]87b0d82e2011-10-07 21:02:59201// Shell is a singleton object that presents the Shell API and implements the
[email protected]99f07e02011-12-07 00:02:59202// RootWindow's delegate interface.
[email protected]b0079a92012-01-25 20:13:38203//
204// Upon creation, the Shell sets itself as the RootWindow's delegate, which
205// takes ownership of the Shell.
Xiyuan Xia22b1a6c2017-04-18 22:46:01206class ASH_EXPORT Shell : public SessionObserver,
sky5ad143a2017-03-22 04:31:23207 public SystemModalContainerEventFilterDelegate,
sky27344382017-03-08 21:30:32208 public ui::EventTarget,
Thiago Farina3b086a02017-05-30 22:32:50209 public ::wm::ActivationChangeObserver {
[email protected]87b0d82e2011-10-07 21:02:59210 public:
[email protected]093b8d642014-04-03 20:59:28211 typedef std::vector<RootWindowController*> RootWindowControllerList;
[email protected]be65be362012-06-15 07:38:23212
Scott Violetc8a1c6c2017-11-29 23:17:36213 // Creates the single Shell instance.
214 static Shell* CreateInstance(ShellInitParams init_params);
[email protected]3266c2b92011-11-14 00:06:08215
216 // Should never be called before |CreateInstance()|.
skyb073203a2017-03-13 16:59:16217 static Shell* Get();
[email protected]3266c2b92011-11-14 00:06:08218
[email protected]b3b7bcd2012-03-06 19:35:45219 // Returns true if the ash shell has been instantiated.
220 static bool HasInstance();
221
[email protected]ef589af2011-12-03 01:07:15222 static void DeleteInstance();
[email protected]cac10fc62011-10-07 23:22:56223
[email protected]d90b8392012-06-13 09:34:56224 // Returns the root window controller for the primary root window.
[email protected]a0afeb12012-12-10 22:57:09225 // TODO(oshima): move this to |RootWindowController|
[email protected]093b8d642014-04-03 20:59:28226 static RootWindowController* GetPrimaryRootWindowController();
[email protected]d90b8392012-06-13 09:34:56227
thanhphc90f49ca2017-03-03 17:48:53228 // Returns the RootWindowController for the given display id. If there
229 // is no display for |display_id|, null is returned.
230 static RootWindowController* GetRootWindowControllerWithDisplayId(
231 int64_t display_id);
232
Scott Violet596bb46342017-06-21 14:43:13233 // Returns the root Window for the given display id. If there is no display
234 // for |display_id| null is returned.
235 static aura::Window* GetRootWindowForDisplayId(int64_t display_id);
236
[email protected]cf1c70e2012-08-30 01:13:02237 // Returns all root window controllers.
[email protected]a0afeb12012-12-10 22:57:09238 // TODO(oshima): move this to |RootWindowController|
[email protected]be65be362012-06-15 07:38:23239 static RootWindowControllerList GetAllRootWindowControllers();
240
[email protected]bf9cdb362013-10-25 19:22:45241 // Returns the primary root Window. The primary root Window is the one that
242 // has a launcher.
243 static aura::Window* GetPrimaryRootWindow();
[email protected]e73bd7802012-02-17 20:10:34244
Joel Hockey784a8322020-05-20 21:19:25245 // Sets the root window that newly created windows should be added to.
246 static void SetRootWindowForNewWindows(aura::Window* root);
247
sky27344382017-03-08 21:30:32248 // Returns the root window that newly created windows should be added to.
Joel Hockey784a8322020-05-20 21:19:25249 // Value can be temporarily overridden using
250 // display::ScopedDisplayForNewWindows. NOTE: this returns the root, newly
251 // created window should be added to the appropriate container in the returned
252 // window.
sky27344382017-03-08 21:30:32253 static aura::Window* GetRootWindowForNewWindows();
mfomitcheva1a8aa62016-05-03 16:23:26254
[email protected]cf1c70e2012-08-30 01:13:02255 // Returns all root windows.
[email protected]c9390bd2013-11-08 20:33:13256 static aura::Window::Windows GetAllRootWindows();
[email protected]be65be362012-06-15 07:38:23257
[email protected]bf9cdb362013-10-25 19:22:45258 static aura::Window* GetContainer(aura::Window* root_window,
[email protected]7b0f7502012-06-11 00:12:39259 int container_id);
[email protected]bf9cdb362013-10-25 19:22:45260 static const aura::Window* GetContainer(const aura::Window* root_window,
[email protected]e67291f12012-10-10 05:52:38261 int container_id);
[email protected]7b0f7502012-06-11 00:12:39262
James Cook7b7c6a52018-01-04 23:40:03263 // If a system-modal dialog window is currently open, returns the ID of the
264 // system modal window container that contains the window.
265 // If no system-modal dialogs are open it returns -1.
266 static int GetOpenSystemModalWindowContainerId();
267
268 // Returns true if a system-modal dialog window is currently open.
269 static bool IsSystemModalWindowOpen();
270
Mitsuru Oshima51bf3d5472020-06-17 21:28:34271 // Track/Untrack InputMethod bounds.
272 void TrackInputMethodBounds(ArcInputMethodBoundsTracker* tracker);
273 void UntrackTrackInputMethodBounds(ArcInputMethodBoundsTracker* tracker);
Scott Violet737fb752018-04-11 15:35:22274
[email protected]57b8bb352012-01-11 05:11:46275 // Creates a default views::NonClientFrameView for use by windows in the
276 // Ash environment.
Thomas Lukaszewicz814abb352020-06-29 21:35:16277 std::unique_ptr<views::NonClientFrameView> CreateDefaultNonClientFrameView(
[email protected]57b8bb352012-01-11 05:11:46278 views::Widget* widget);
279
mswad28b252016-08-09 02:42:07280 // Sets work area insets of the display containing |window|, pings observers.
[email protected]2e236a52012-06-27 22:21:47281 void SetDisplayWorkAreaInsets(aura::Window* window,
[email protected]8a45c972012-03-14 18:22:44282 const gfx::Insets& insets);
[email protected]1a2145b2012-03-13 21:09:17283
[email protected]58868abf2014-01-17 23:45:33284 // Called when a casting session is started or stopped.
285 void OnCastingSessionStartedOrStopped(bool started);
286
[email protected]0e3e7cb2014-04-12 05:18:25287 // Called when a root window is created.
varkhac71444e52017-05-25 22:51:34288 void OnRootWindowAdded(aura::Window* root_window);
[email protected]0e3e7cb2014-04-12 05:18:25289
Zach Helfinsteinbbb6bad2018-05-02 18:21:51290 // Called when dictation is activated.
291 void OnDictationStarted();
292
293 // Called when dictation is ended.
294 void OnDictationEnded();
295
Manu Cornet369d82302020-02-13 17:04:52296 // Returns whether the device is currently in tablet mode. If the tablet
297 // mode controller isn't available, we assume the device is not in
298 // tablet mode.
299 bool IsInTabletMode() const;
300
301 // Tests if TabletModeWindowManager is not enabled, and if
Mitsuru Oshima0e9b7a62017-07-19 18:23:03302 // TabletModeController is not currently setting a display rotation. Or if
[email protected]da285852014-05-27 19:53:43303 // the |resolution_notification_controller_| is not showing its confirmation
304 // dialog. If true then changes to display settings can be saved.
305 bool ShouldSaveDisplaySettings();
[email protected]da285852014-05-27 19:53:43306
Evan Staded7748c52019-05-08 18:17:27307 AcceleratorControllerImpl* accelerator_controller() {
sky81a2d792017-03-17 19:14:39308 return accelerator_controller_.get();
sky44a09892016-07-20 17:46:58309 }
Mike Wassermand13e95a2019-06-28 23:29:48310 AccessibilityControllerImpl* accessibility_controller() {
James Cookec144952017-09-01 00:05:16311 return accessibility_controller_.get();
312 }
sky07a24d42017-03-09 23:57:30313 AccessibilityDelegate* accessibility_delegate() {
314 return accessibility_delegate_.get();
315 }
Mike Wassermanb00478d52019-06-18 22:20:32316 AccessibilityFocusRingControllerImpl* accessibility_focus_ring_controller() {
Qiang Xua9591002018-03-15 22:29:31317 return accessibility_focus_ring_controller_.get();
318 }
Qiang Xuf1400a362017-09-14 02:28:30319 ::wm::ActivationClient* activation_client();
Jiaquan He4b48f912018-03-01 03:59:39320 AppListControllerImpl* app_list_controller() {
321 return app_list_controller_.get();
322 }
wutao9caadca2019-07-16 05:06:46323 AmbientController* ambient_controller() { return ambient_controller_.get(); }
David Blackec4cbcd2020-04-15 20:35:25324 AssistantControllerImpl* assistant_controller() {
325 return assistant_controller_.get();
326 }
Qiang Xuf1400a362017-09-14 02:28:30327 AutoclickController* autoclick_controller() {
328 return autoclick_controller_.get();
329 }
Daniel Erat477c56d2017-12-13 21:42:54330 BacklightsForcedOffSetter* backlights_forced_off_setter() {
331 return backlights_forced_off_setter_.get();
332 }
Qiang Xuf1400a362017-09-14 02:28:30333 BluetoothPowerController* bluetooth_power_controller() {
334 return bluetooth_power_controller_.get();
335 }
sky79fa34712017-03-20 23:46:47336 BrightnessControlDelegate* brightness_control_delegate() {
337 return brightness_control_delegate_.get();
338 }
Steven Bennetts2a9b4382018-04-26 23:41:19339 CrosDisplayConfig* cros_display_config() {
340 return cros_display_config_.get();
341 }
Qiang Xuf1400a362017-09-14 02:28:30342 ::wm::CursorManager* cursor_manager() { return cursor_manager_.get(); }
Ahmed Fakhryc77ce402019-02-13 02:32:00343 DesksController* desks_controller() { return desks_controller_.get(); }
Toni Barzicd6238312018-03-02 18:26:13344 DetachableBaseHandler* detachable_base_handler() {
345 return detachable_base_handler_.get();
346 }
347
rjkroege72f8154f2016-10-29 00:49:02348 display::DisplayManager* display_manager() { return display_manager_.get(); }
Steven Bennetts3688c6032018-04-13 01:14:23349 DisplayPrefs* display_prefs() { return display_prefs_.get(); }
stevenjb537c5c3f2016-01-20 23:38:12350 DisplayConfigurationController* display_configuration_controller() {
351 return display_configuration_controller_.get();
352 }
Qiang Xuf1400a362017-09-14 02:28:30353
Bailey Berro01bc58c82020-06-22 17:52:02354 DisplayAlignmentController* display_alignment_controller() {
355 return display_alignment_controller_.get();
356 }
357
Joone Hur60b9fd32019-02-23 00:10:26358 display::DisplayConfigurator* display_configurator();
359
Ahmed Fakhry46357342018-04-27 00:46:11360 DisplayColorManager* display_color_manager() {
361 return display_color_manager_.get();
362 }
Qiang Xuf1400a362017-09-14 02:28:30363 DisplayErrorObserver* display_error_observer() {
364 return display_error_observer_.get();
365 }
366
Su Hong Kood22ceb12020-04-06 16:44:07367 DisplayHighlightController* display_highlight_controller() {
368 return display_highlight_controller_.get();
369 }
370
Jun Mukaif701ffa82019-05-15 20:45:25371 DockedMagnifierControllerImpl* docked_magnifier_controller();
jamescookb8dcef522016-06-25 14:42:55372 ::wm::CompoundEventFilter* env_filter() { return env_filter_.get(); }
Mike Wassermanaac88db12019-06-03 21:40:45373 EventRewriterControllerImpl* event_rewriter_controller() {
Mike Wassermanefbf3402018-04-26 00:41:32374 return event_rewriter_controller_.get();
375 }
Qiang Xuf1400a362017-09-14 02:28:30376 EventClientImpl* event_client() { return event_client_.get(); }
377 EventTransformationHandler* event_transformation_handler() {
378 return event_transformation_handler_.get();
379 }
Michael Giuffrida2d922de2019-03-08 00:53:14380 HomeScreenController* home_screen_controller() {
381 return home_screen_controller_.get();
382 }
Scott Violet319cfb52018-05-23 18:35:28383 ::wm::FocusController* focus_controller() { return focus_controller_.get(); }
James Cooka8963fb2019-03-09 01:00:40384 AshFocusRules* focus_rules() { return focus_rules_; }
sky79fa34712017-03-20 23:46:47385 FocusCycler* focus_cycler() { return focus_cycler_.get(); }
Qiang Xuf1400a362017-09-14 02:28:30386 HighlighterController* highlighter_controller() {
387 return highlighter_controller_.get();
388 }
389 HighContrastController* high_contrast_controller() {
390 return high_contrast_controller_.get();
391 }
Darren Shen7b132782019-12-10 04:36:06392 ImeControllerImpl* ime_controller() { return ime_controller_.get(); }
Yicheng Li93ebc692020-07-29 18:01:01393 InSessionAuthDialogControllerImpl* in_session_auth_dialog_controller() {
394 return in_session_auth_dialog_controller_.get();
395 }
David Tseng6792dc82018-05-04 19:18:41396 KeyAccessibilityEnabler* key_accessibility_enabler() {
397 return key_accessibility_enabler_.get();
398 }
sky79fa34712017-03-20 23:46:47399 KeyboardBrightnessControlDelegate* keyboard_brightness_control_delegate() {
400 return keyboard_brightness_control_delegate_.get();
401 }
Darren Shen7daf3e12019-07-02 07:25:49402 KeyboardControllerImpl* keyboard_controller() {
403 return keyboard_controller_.get();
Steven Bennettsa00d64cc82018-10-04 00:17:22404 }
Qiang Xuf1400a362017-09-14 02:28:30405 LaserPointerController* laser_pointer_controller() {
406 return laser_pointer_controller_.get();
407 }
Xiyuan Xiabe4303e72019-06-06 18:14:50408 LocaleUpdateControllerImpl* locale_update_controller() {
Tatsuhisa Yamaguchi440e2d2e2018-12-05 09:16:31409 return locale_update_controller_.get();
sky79fa34712017-03-20 23:46:47410 }
Jacob Dufaultffd9b0d2017-11-15 23:07:16411 LoginScreenController* login_screen_controller() {
412 return login_screen_controller_.get();
xiaoyinh2bbdd102017-05-18 23:29:42413 }
Qiang Xuf1400a362017-09-14 02:28:30414 LockStateController* lock_state_controller() {
415 return lock_state_controller_.get();
416 }
417 LogoutConfirmationController* logout_confirmation_controller() {
418 return logout_confirmation_controller_.get();
419 }
420 MagnificationController* magnification_controller() {
421 return magnification_controller_.get();
422 }
Xiyuan Xiad03bd2f2019-06-05 22:00:49423 MediaControllerImpl* media_controller() { return media_controller_.get(); }
Tommy Steimel875de1d42019-05-17 17:11:42424 MediaNotificationControllerImpl* media_notification_controller() {
Becca Hughesc6a0a062018-10-25 16:54:13425 return media_notification_controller_.get();
426 }
Evan Stade04c18d02017-10-20 20:53:22427 MessageCenterController* message_center_controller() {
428 return message_center_controller_.get();
429 }
Qiang Xuf1400a362017-09-14 02:28:30430 MouseCursorEventFilter* mouse_cursor_filter() {
431 return mouse_cursor_filter_.get();
432 }
sky5ab16472017-03-21 19:35:08433 MruWindowTracker* mru_window_tracker() { return mru_window_tracker_.get(); }
Curt Clemens8c3a59a52020-09-25 23:58:19434 NearbyShareControllerImpl* nearby_share_controller() {
Curt Clemensc6659632020-09-16 18:32:15435 return nearby_share_controller_.get();
436 }
437 NearbyShareDelegate* nearby_share_delegate() {
438 return nearby_share_delegate_.get();
439 }
Steven Bennetts32f5d552019-07-09 16:16:13440 NightLightControllerImpl* night_light_controller() {
441 return night_light_controller_.get();
442 }
Gil Dekel69777032020-02-07 18:41:53443 PrivacyScreenController* privacy_screen_controller() {
444 return privacy_screen_controller_.get();
445 }
Qiang Xuf1400a362017-09-14 02:28:30446 OverlayEventFilter* overlay_filter() { return overlay_filter_.get(); }
Fabian Sommerdcb675c2020-02-12 09:31:05447 ParentAccessController* parent_access_controller() {
448 return parent_access_controller_.get();
449 }
Qiang Xuf1400a362017-09-14 02:28:30450 PartialMagnificationController* partial_magnification_controller() {
451 return partial_magnification_controller_.get();
452 }
Qiang Xud8e897e2018-05-24 20:07:57453 PolicyRecommendationRestorer* policy_recommendation_restorer() {
454 return policy_recommendation_restorer_.get();
455 }
Qiang Xuf1400a362017-09-14 02:28:30456 PowerButtonController* power_button_controller() {
457 return power_button_controller_.get();
458 }
459 PowerEventObserver* power_event_observer() {
460 return power_event_observer_.get();
461 }
462 ResizeShadowController* resize_shadow_controller() {
463 return resize_shadow_controller_.get();
464 }
465 ResolutionNotificationController* resolution_notification_controller() {
466 return resolution_notification_controller_.get();
467 }
468 ScreenshotController* screenshot_controller() {
469 return screenshot_controller_.get();
470 }
471 ScreenLayoutObserver* screen_layout_observer() {
472 return screen_layout_observer_.get();
473 }
474 ScreenOrientationController* screen_orientation_controller() {
475 return screen_orientation_controller_.get();
476 }
477 ScreenPinningController* screen_pinning_controller() {
478 return screen_pinning_controller_.get();
479 }
Tetsui Ohkubo54d50222018-05-10 01:58:11480 ScreenSwitchCheckController* screen_switch_check_controller() {
481 return screen_switch_check_controller_.get();
482 }
Xiyuan Xiae7b19542019-05-06 23:05:18483 SessionControllerImpl* session_controller() {
484 return session_controller_.get();
485 }
Sammie Quon557418662018-04-25 18:45:51486 ::wm::ShadowController* shadow_controller() {
487 return shadow_controller_.get();
488 }
Matthew Mourgos75327562019-09-09 21:23:57489 ShelfConfig* shelf_config() { return shelf_config_.get(); }
sky5ad143a2017-03-22 04:31:23490 ShelfController* shelf_controller() { return shelf_controller_.get(); }
Qiang Xuf1400a362017-09-14 02:28:30491 ShellDelegate* shell_delegate() { return shell_delegate_.get(); }
Xiyuan Xia7107d492019-06-05 16:58:54492 ShutdownControllerImpl* shutdown_controller() {
sky5b45ed82017-03-27 02:54:23493 return shutdown_controller_.get();
494 }
Qiang Xuf1400a362017-09-14 02:28:30495 StickyKeysController* sticky_keys_controller() {
496 return sticky_keys_controller_.get();
497 }
Steven Bennetts7fb8a992018-06-12 00:15:05498 SystemNotificationController* system_notification_controller() {
499 return system_notification_controller_.get();
500 }
Tetsui Ohkubo21722932018-03-02 02:56:56501 SystemTrayModel* system_tray_model() { return system_tray_model_.get(); }
sky5b45ed82017-03-27 02:54:23502 SystemTrayNotifier* system_tray_notifier() {
503 return system_tray_notifier_.get();
504 }
Manu Cornet369d82302020-02-13 17:04:52505 TabletModeController* tablet_mode_controller() const {
Sammie Quona6f96402017-08-24 01:08:37506 return tablet_mode_controller_.get();
507 }
Anastasiia Nikolaienko8cdd7e62019-06-12 12:16:24508 ToastManagerImpl* toast_manager() { return toast_manager_.get(); }
[email protected]a1b7a822013-02-23 19:08:04509 views::corewm::TooltipController* tooltip_controller() {
[email protected]862deef2011-12-15 22:07:33510 return tooltip_controller_.get();
[email protected]4a229e902011-12-01 21:21:11511 }
Andrew Xu2a5e5c42020-09-25 18:33:08512 ClipboardHistoryControllerImpl* clipboard_history_controller() {
Alex Newcomer55b050c2020-07-11 01:55:44513 return clipboard_history_controller_.get();
Alex Newcomer46bfe142020-07-10 20:28:56514 }
Qiang Xuf1400a362017-09-14 02:28:30515 TouchDevicesController* touch_devices_controller() {
516 return touch_devices_controller_.get();
chirantan40e4cd82015-02-19 01:08:19517 }
kylechar55f0eaf22017-01-11 22:57:37518 AshTouchTransformController* touch_transformer_controller() {
[email protected]03122891a2014-05-13 23:56:49519 return touch_transformer_controller_.get();
520 }
Qiang Xuf1400a362017-09-14 02:28:30521 TrayAction* tray_action() { return tray_action_.get(); }
522 TrayBluetoothHelper* tray_bluetooth_helper() {
523 return tray_bluetooth_helper_.get();
sammiequon203ae022016-09-18 17:23:42524 }
Evan Stade04c18d02017-10-20 20:53:22525 UserMetricsRecorder* metrics() { return user_metrics_recorder_.get(); }
Qiang Xuf1400a362017-09-14 02:28:30526 VideoDetector* video_detector() { return video_detector_.get(); }
Mike Wassermana5352da2019-05-30 17:26:08527 WallpaperControllerImpl* wallpaper_controller() {
Qiang Xuf1400a362017-09-14 02:28:30528 return wallpaper_controller_.get();
Vladislav Kaznacheev6d6aaff2017-07-22 04:06:32529 }
Qiang Xuf1400a362017-09-14 02:28:30530 WindowCycleController* window_cycle_controller() {
531 return window_cycle_controller_.get();
mukai19274bdd2015-02-24 22:37:48532 }
Qiang Xuf1400a362017-09-14 02:28:30533 WindowPositioner* window_positioner() { return window_positioner_.get(); }
Sammie Quon80e82a12019-01-23 19:55:22534 OverviewController* overview_controller() {
535 return overview_controller_.get();
[email protected]8b7ba87b2012-09-01 00:40:40536 }
Qiang Xuf1400a362017-09-14 02:28:30537 WindowTreeHostManager* window_tree_host_manager() {
538 return window_tree_host_manager_.get();
[email protected]682990f2013-01-10 06:49:11539 }
mincha25f0d32020-01-17 02:55:55540 BackGestureEventHandler* back_gesture_event_handler() {
541 return back_gesture_event_handler_.get();
542 }
Angus L. M. McLean IVaa6378e2020-09-30 18:52:20543 ui::EventHandler* shell_tab_handler() { return shell_tab_handler_.get(); }
Mitsuru Oshima89e5c1352018-01-17 07:29:39544 ToplevelWindowEventHandler* toplevel_window_event_handler() {
545 return toplevel_window_event_handler_.get();
546 }
Min Chenfda33cb2019-07-08 17:42:23547 AshColorProvider* ash_color_provider() { return ash_color_provider_.get(); }
Mitsuru Oshima89e5c1352018-01-17 07:29:39548
Xiyuan Xiabd4ea792019-05-15 01:54:06549 PrefService* local_state() { return local_state_; }
550
yjliu10679cf2020-07-17 18:16:46551 FrameThrottlingController* frame_throttling_controller() {
552 return frame_throttling_controller_.get();
553 }
554
[email protected]c758fbf2012-03-25 22:53:59555 // Force the shelf to query for it's current visibility state.
jamescook6afad6d2016-06-01 00:35:01556 // TODO(jamescook): Move to Shelf.
[email protected]c758fbf2012-03-25 22:53:59557 void UpdateShelfVisibility();
558
[email protected]a0afeb12012-12-10 22:57:09559 // Does the primary display have status area?
560 bool HasPrimaryStatusArea();
561
[email protected]f9466702012-09-17 16:35:27562 // Starts the animation that occurs on first login.
563 void DoInitialWorkspaceAnimation();
564
yawanodc5533b32017-02-23 11:04:38565 void SetLargeCursorSizeInDip(int large_cursor_size_in_dip);
566
Katie D42fef12c2020-05-28 17:17:10567 // Sets a custom color for the cursor.
568 void SetCursorColor(SkColor cursor_color);
569
Weidong Guod07448f2017-10-18 03:35:18570 // Updates cursor compositing on/off. Native cursor is disabled when cursor
[email protected]87ec2202014-02-06 06:24:27571 // compositing is enabled, and vice versa.
Weidong Guod07448f2017-10-18 03:35:18572 void UpdateCursorCompositingEnabled();
[email protected]87ec2202014-02-06 06:24:27573
Weidong Guod07448f2017-10-18 03:35:18574 // Force setting compositing on/off without checking dependency.
575 void SetCursorCompositingEnabled(bool enabled);
xdaid4913762017-07-06 00:17:22576
James Cookfa4838e2018-08-08 16:30:15577 // Shows the context menu for the wallpaper or shelf at |location_in_screen|.
578 void ShowContextMenu(const gfx::Point& location_in_screen,
579 ui::MenuSourceType source_type);
580
sky00c813f2017-03-08 22:48:55581 void AddShellObserver(ShellObserver* observer);
582 void RemoveShellObserver(ShellObserver* observer);
583
sky5ad143a2017-03-22 04:31:23584 // Called when the login status changes.
585 // TODO(oshima): Investigate if we can merge this and |OnLoginStateChanged|.
586 void UpdateAfterLoginStatusChange(LoginStatus status);
587
Ahmed Fakhryf1dd847ae2019-03-28 22:15:21588 // Notifies observers that fullscreen mode has changed for |container|.
589 // |container| is always the active desk container.
varkhac71444e52017-05-25 22:51:34590 void NotifyFullscreenStateChanged(bool is_fullscreen,
Ahmed Fakhryf1dd847ae2019-03-28 22:15:21591 aura::Window* container);
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
Aga Wronska43971142019-04-12 01:18:20596 // Notifies observers that |root_window|'s user work area insets have changed.
597 // This notification is not fired when shelf bounds changed.
598 void NotifyUserWorkAreaInsetsChanged(aura::Window* root_window);
Aga Wronska0514fd62019-03-25 20:11:37599
sky00c813f2017-03-08 22:48:55600 // Notifies observers that |root_window|'s shelf changed alignment.
601 // TODO(jamescook): Move to Shelf.
Sammie Quonf6b30f92020-01-07 00:35:13602 void NotifyShelfAlignmentChanged(aura::Window* root_window,
603 ShelfAlignment old_alignment);
sky00c813f2017-03-08 22:48:55604
605 // Notifies observers that |root_window|'s shelf changed auto-hide behavior.
606 // TODO(jamescook): Move to Shelf.
varkha6b016b0f2017-05-26 16:14:18607 void NotifyShelfAutoHideBehaviorChanged(aura::Window* root_window);
sky00c813f2017-03-08 22:48:55608
[email protected]2b4cd302012-02-24 20:21:13609 private:
[email protected]c39be8f2012-06-15 22:58:36610 FRIEND_TEST_ALL_PREFIXES(ExtendedDesktopTest, TestCursor);
[email protected]1aad3322012-06-06 06:37:09611 FRIEND_TEST_ALL_PREFIXES(WindowManagerTest, MouseEventCursors);
612 FRIEND_TEST_ALL_PREFIXES(WindowManagerTest, TransformActivate);
sky79fa34712017-03-20 23:46:47613 friend class AcceleratorControllerTest;
Sam McNallya853cd82017-08-30 01:55:10614 friend class AshTestHelper;
[email protected]093b8d642014-04-03 20:59:28615 friend class RootWindowController;
sky27344382017-03-08 21:30:32616 friend class ScopedRootWindowForNewWindows;
James Cook317781a2017-07-18 02:08:06617 friend class ShellTestApi;
sky27344382017-03-08 21:30:32618 friend class SmsObserverTest;
[email protected]ad0c8722012-03-02 20:17:45619
Ken Rockotb9bab542019-12-12 00:53:30620 explicit Shell(std::unique_ptr<ShellDelegate> shell_delegate);
dcheng1f4538e2014-10-27 23:57:05621 ~Shell() override;
[email protected]3266c2b92011-11-14 00:06:08622
Scott Violet7e33efc2018-08-29 22:30:15623 void Init(ui::ContextFactory* context_factory,
Xiyuan Xia14619a22019-05-14 20:20:44624 PrefService* local_state,
Steven Bennettsadc71d02019-04-17 18:15:54625 std::unique_ptr<keyboard::KeyboardUIFactory> keyboard_ui_factory,
626 scoped_refptr<dbus::Bus> dbus_bus);
[email protected]b0639282011-12-22 21:12:27627
Steven Bennetts7683e342018-01-02 21:29:52628 // Initializes the display manager and related components.
629 void InitializeDisplayManager();
630
[email protected]a273d33a2013-10-17 12:41:21631 // Initializes the root window so that it can host browser windows.
[email protected]41baaed2013-11-09 04:18:26632 void InitRootWindow(aura::Window* root_window);
[email protected]d90b8392012-06-13 09:34:56633
skyabcae812017-01-18 17:01:34634 // Destroys all child windows including widgets across all roots.
635 void CloseAllRootWindowChildWindows();
636
hariank0dd03dd2016-07-14 23:47:33637 // SystemModalContainerEventFilterDelegate:
dcheng1f4538e2014-10-27 23:57:05638 bool CanWindowReceiveEvents(aura::Window* window) override;
[email protected]c0ce80e2012-10-05 23:28:27639
[email protected]5097e692012-10-30 22:08:41640 // Overridden from ui::EventTarget:
dcheng1f4538e2014-10-27 23:57:05641 bool CanAcceptEvent(const ui::Event& event) override;
642 EventTarget* GetParentTarget() override;
dchenga94547472016-04-08 08:41:11643 std::unique_ptr<ui::EventTargetIterator> GetChildIterator() const override;
dcheng1f4538e2014-10-27 23:57:05644 ui::EventTargeter* GetEventTargeter() override;
[email protected]5097e692012-10-30 22:08:41645
Thiago Farina3b086a02017-05-30 22:32:50646 // wm::ActivationChangeObserver:
sky27344382017-03-08 21:30:32647 void OnWindowActivated(ActivationReason reason,
648 aura::Window* gained_active,
649 aura::Window* lost_active) override;
650
Xiyuan Xia22b1a6c2017-04-18 22:46:01651 // SessionObserver:
Steven Bennettsbadc3092018-05-24 21:26:01652 void OnFirstSessionStarted() override;
Xiyuan Xiab64fd0a2017-04-13 17:53:14653 void OnSessionStateChanged(session_manager::SessionState state) override;
654 void OnLoginStatusChanged(LoginStatus login_status) override;
655 void OnLockStateChanged(bool locked) override;
sky5ad143a2017-03-22 04:31:23656
[email protected]cac10fc62011-10-07 23:22:56657 static Shell* instance_;
658
[email protected]1aad3322012-06-06 06:37:09659 // The CompoundEventFilter owned by aura::Env object.
dchenga94547472016-04-08 08:41:11660 std::unique_ptr<::wm::CompoundEventFilter> env_filter_;
[email protected]627a62f2012-02-14 22:59:14661
Mike Wassermanaac88db12019-06-03 21:40:45662 std::unique_ptr<EventRewriterControllerImpl> event_rewriter_controller_;
Mike Wassermanefbf3402018-04-26 00:41:32663
dchenga94547472016-04-08 08:41:11664 std::unique_ptr<UserMetricsRecorder> user_metrics_recorder_;
dchenga94547472016-04-08 08:41:11665 std::unique_ptr<WindowPositioner> window_positioner_;
[email protected]2b99f8c2011-10-11 19:42:24666
Evan Staded7748c52019-05-08 18:17:27667 std::unique_ptr<AcceleratorControllerImpl> accelerator_controller_;
Mike Wassermand13e95a2019-06-28 23:29:48668 std::unique_ptr<AccessibilityControllerImpl> accessibility_controller_;
sky07a24d42017-03-09 23:57:30669 std::unique_ptr<AccessibilityDelegate> accessibility_delegate_;
Mike Wassermanb00478d52019-06-18 22:20:32670 std::unique_ptr<AccessibilityFocusRingControllerImpl>
Qiang Xua9591002018-03-15 22:29:31671 accessibility_focus_ring_controller_;
wutao9caadca2019-07-16 05:06:46672 std::unique_ptr<AmbientController> ambient_controller_;
Jiaquan He4b48f912018-03-01 03:59:39673 std::unique_ptr<AppListControllerImpl> app_list_controller_;
James Cook8064d4c2019-08-07 14:55:55674 // May be null in tests or when running on linux-chromeos.
675 scoped_refptr<dbus::Bus> dbus_bus_;
Jeffrey Kardatzkef108f022018-04-17 17:52:35676 std::unique_ptr<AshDBusServices> ash_dbus_services_;
David Blackec4cbcd2020-04-15 20:35:25677 std::unique_ptr<AssistantControllerImpl> assistant_controller_;
Toni Barzic9d0c82f42017-12-06 00:53:52678 std::unique_ptr<BacklightsForcedOffSetter> backlights_forced_off_setter_;
Jeroen Dhollanderb35f54622020-09-30 15:44:24679 std::unique_ptr<BloomUiControllerImpl> bloom_ui_controller_;
sky79fa34712017-03-20 23:46:47680 std::unique_ptr<BrightnessControlDelegate> brightness_control_delegate_;
Steven Bennetts2a9b4382018-04-26 23:41:19681 std::unique_ptr<CrosDisplayConfig> cros_display_config_;
Ahmed Fakhryc77ce402019-02-13 02:32:00682 std::unique_ptr<DesksController> desks_controller_;
Toni Barzicd6238312018-03-02 18:26:13683 std::unique_ptr<DetachableBaseHandler> detachable_base_handler_;
Toni Barzic550419f2018-03-08 03:56:21684 std::unique_ptr<DetachableBaseNotificationController>
685 detachable_base_notification_controller_;
Su Hong Kood22ceb12020-04-06 16:44:07686 std::unique_ptr<DisplayHighlightController> display_highlight_controller_;
Tetsui Ohkubo01421b32018-05-30 16:54:59687 std::unique_ptr<DisplaySpeakerController> display_speaker_controller_;
dchenga94547472016-04-08 08:41:11688 std::unique_ptr<DragDropController> drag_drop_controller_;
sky79fa34712017-03-20 23:46:47689 std::unique_ptr<FocusCycler> focus_cycler_;
Toni Barzice64ee292020-07-22 21:34:29690 std::unique_ptr<HoldingSpaceController> holding_space_controller_;
Michael Giuffrida2d922de2019-03-08 00:53:14691 std::unique_ptr<HomeScreenController> home_screen_controller_;
Darren Shen7b132782019-12-10 04:36:06692 std::unique_ptr<ImeControllerImpl> ime_controller_;
Evan Stade14672042018-10-11 02:03:50693 std::unique_ptr<ImmersiveContext> immersive_context_;
Yicheng Li93ebc692020-07-29 18:01:01694 std::unique_ptr<InSessionAuthDialogControllerImpl>
695 in_session_auth_dialog_controller_;
sky79fa34712017-03-20 23:46:47696 std::unique_ptr<KeyboardBrightnessControlDelegate>
697 keyboard_brightness_control_delegate_;
Xiyuan Xiabe4303e72019-06-06 18:14:50698 std::unique_ptr<LocaleUpdateControllerImpl> locale_update_controller_;
Jacob Dufaultffd9b0d2017-11-15 23:07:16699 std::unique_ptr<LoginScreenController> login_screen_controller_;
sky79fa34712017-03-20 23:46:47700 std::unique_ptr<LogoutConfirmationController> logout_confirmation_controller_;
Mitsuru Oshima0e9b7a62017-07-19 18:23:03701 std::unique_ptr<TabletModeController> tablet_mode_controller_;
Xiyuan Xiad03bd2f2019-06-05 22:00:49702 std::unique_ptr<MediaControllerImpl> media_controller_;
Tommy Steimel875de1d42019-05-17 17:11:42703 std::unique_ptr<MediaNotificationControllerImpl>
704 media_notification_controller_;
sky5ab16472017-03-21 19:35:08705 std::unique_ptr<MruWindowTracker> mru_window_tracker_;
Kyle Horimoto9fc84fc22018-04-27 19:45:15706 std::unique_ptr<MultiDeviceNotificationPresenter>
707 multidevice_notification_presenter_;
Curt Clemens8c3a59a52020-09-25 23:58:19708 std::unique_ptr<NearbyShareControllerImpl> nearby_share_controller_;
Curt Clemensc6659632020-09-16 18:32:15709 std::unique_ptr<NearbyShareDelegate> nearby_share_delegate_;
Fabian Sommerdcb675c2020-02-12 09:31:05710 std::unique_ptr<ParentAccessController> parent_access_controller_;
Xiao Yanga16ba22e2020-03-01 04:50:25711 std::unique_ptr<QuickAnswersController> quick_answers_controller_;
dchenga94547472016-04-08 08:41:11712 std::unique_ptr<ResizeShadowController> resize_shadow_controller_;
Xiyuan Xiae7b19542019-05-06 23:05:18713 std::unique_ptr<SessionControllerImpl> session_controller_;
minch308923f32020-08-28 18:58:30714 std::unique_ptr<AshColorProvider> ash_color_provider_;
Steven Bennetts32f5d552019-07-09 16:16:13715 std::unique_ptr<NightLightControllerImpl> night_light_controller_;
Gil Dekel69777032020-02-07 18:41:53716 std::unique_ptr<PrivacyScreenController> privacy_screen_controller_;
Qiang Xud8e897e2018-05-24 20:07:57717 std::unique_ptr<PolicyRecommendationRestorer> policy_recommendation_restorer_;
Tetsui Ohkubo54d50222018-05-10 01:58:11718 std::unique_ptr<ScreenSwitchCheckController> screen_switch_check_controller_;
Matthew Mourgos75327562019-09-09 21:23:57719 std::unique_ptr<ShelfConfig> shelf_config_;
sky5ad143a2017-03-22 04:31:23720 std::unique_ptr<ShelfController> shelf_controller_;
sky5ad143a2017-03-22 04:31:23721 std::unique_ptr<ShelfWindowWatcher> shelf_window_watcher_;
skyb073203a2017-03-13 16:59:16722 std::unique_ptr<ShellDelegate> shell_delegate_;
Ahmed Fakhry0c6efef2020-07-30 21:51:19723 std::unique_ptr<CaptureModeController> capture_mode_controller_;
Xiyuan Xia7107d492019-06-05 16:58:54724 std::unique_ptr<ShutdownControllerImpl> shutdown_controller_;
Tetsui Ohkubo269b5792018-04-26 01:06:32725 std::unique_ptr<SystemNotificationController> system_notification_controller_;
Tetsui Ohkubo21722932018-03-02 02:56:56726 std::unique_ptr<SystemTrayModel> system_tray_model_;
sky5b45ed82017-03-27 02:54:23727 std::unique_ptr<SystemTrayNotifier> system_tray_notifier_;
Anastasiia Nikolaienko8cdd7e62019-06-12 12:16:24728 std::unique_ptr<ToastManagerImpl> toast_manager_;
Andrew Xu2a5e5c42020-09-25 18:33:08729 std::unique_ptr<ClipboardHistoryControllerImpl> clipboard_history_controller_;
Qiang Xuf1400a362017-09-14 02:28:30730 std::unique_ptr<TouchDevicesController> touch_devices_controller_;
tbarzicc78da1ff92017-05-08 20:46:15731 std::unique_ptr<TrayAction> tray_action_;
Mike Wassermana5352da2019-05-30 17:26:08732 std::unique_ptr<WallpaperControllerImpl> wallpaper_controller_;
sky5b45ed82017-03-27 02:54:23733 std::unique_ptr<WindowCycleController> window_cycle_controller_;
Sammie Quon80e82a12019-01-23 19:55:22734 std::unique_ptr<OverviewController> overview_controller_;
Scott Violet7dbdaeb2018-12-11 22:39:02735 // Owned by |focus_controller_|.
James Cooka8963fb2019-03-09 01:00:40736 AshFocusRules* focus_rules_ = nullptr;
dchenga94547472016-04-08 08:41:11737 std::unique_ptr<::wm::ShadowController> shadow_controller_;
738 std::unique_ptr<::wm::VisibilityController> visibility_controller_;
739 std::unique_ptr<::wm::WindowModalityController> window_modality_controller_;
Xiyuan Xia14619a22019-05-14 20:20:44740 PrefService* local_state_ = nullptr;
dchenga94547472016-04-08 08:41:11741 std::unique_ptr<views::corewm::TooltipController> tooltip_controller_;
dchenga94547472016-04-08 08:41:11742 std::unique_ptr<PowerButtonController> power_button_controller_;
743 std::unique_ptr<LockStateController> lock_state_controller_;
dchenga94547472016-04-08 08:41:11744 std::unique_ptr<ui::UserActivityDetector> user_activity_detector_;
745 std::unique_ptr<VideoDetector> video_detector_;
dchenga94547472016-04-08 08:41:11746 std::unique_ptr<WindowTreeHostManager> window_tree_host_manager_;
Qiang Xud77a90c2018-02-20 19:43:29747 std::unique_ptr<PersistentWindowController> persistent_window_controller_;
dchenga94547472016-04-08 08:41:11748 std::unique_ptr<HighContrastController> high_contrast_controller_;
749 std::unique_ptr<MagnificationController> magnification_controller_;
dchenga94547472016-04-08 08:41:11750 std::unique_ptr<AutoclickController> autoclick_controller_;
sky27344382017-03-08 21:30:32751 std::unique_ptr<::wm::FocusController> focus_controller_;
sky984c1892016-04-20 00:00:34752
oshima5a296e82016-04-29 01:32:27753 std::unique_ptr<ScreenshotController> screenshot_controller_;
[email protected]f5c9dbc2014-04-11 08:13:45754
dchenga94547472016-04-08 08:41:11755 std::unique_ptr<MouseCursorEventFilter> mouse_cursor_filter_;
756 std::unique_ptr<ScreenPositionController> screen_position_controller_;
757 std::unique_ptr<SystemModalContainerEventFilter> modality_filter_;
758 std::unique_ptr<EventClientImpl> event_client_;
759 std::unique_ptr<EventTransformationHandler> event_transformation_handler_;
[email protected]ae18b9112011-11-07 16:59:13760
[email protected]0b0b0742012-02-16 13:23:45761 // An event filter that pre-handles key events while the partial
[email protected]a1584a712012-07-30 21:02:26762 // screenshot UI or the keyboard overlay is active.
dchenga94547472016-04-08 08:41:11763 std::unique_ptr<OverlayEventFilter> overlay_filter_;
[email protected]0b0b0742012-02-16 13:23:45764
mincha25f0d32020-01-17 02:55:55765 // An event filter which handles swiping back from left side of the window.
766 std::unique_ptr<BackGestureEventHandler> back_gesture_event_handler_;
767
Angus L. M. McLean IVaa6378e2020-09-30 18:52:20768 // An event filter which redirects focus when tab is pressed on a RootWindow
769 // with no active windows.
770 std::unique_ptr<ui::EventHandler> shell_tab_handler_;
771
[email protected]3537d472014-01-15 05:45:31772 // An event filter which handles moving and resizing windows.
dchenga94547472016-04-08 08:41:11773 std::unique_ptr<ToplevelWindowEventHandler> toplevel_window_event_handler_;
[email protected]3537d472014-01-15 05:45:31774
[email protected]435b212e2012-04-05 19:43:37775 // An event filter which handles system level gestures
dchenga94547472016-04-08 08:41:11776 std::unique_ptr<SystemGestureEventFilter> system_gesture_filter_;
[email protected]435b212e2012-04-05 19:43:37777
[email protected]745816be2011-11-22 05:08:30778 // An event filter that pre-handles global accelerators.
dchenga94547472016-04-08 08:41:11779 std::unique_ptr<::wm::AcceleratorFilter> accelerator_filter_;
[email protected]745816be2011-11-22 05:08:30780
rjkroege72f8154f2016-10-29 00:49:02781 std::unique_ptr<display::DisplayManager> display_manager_;
Steven Bennetts3688c6032018-04-13 01:14:23782 std::unique_ptr<DisplayPrefs> display_prefs_;
dchenga94547472016-04-08 08:41:11783 std::unique_ptr<DisplayConfigurationController>
784 display_configuration_controller_;
Steven Bennetts9b21fa32018-04-13 23:45:55785 std::unique_ptr<DisplayConfigurationObserver> display_configuration_observer_;
[email protected]6bdf7952012-11-14 10:10:58786
hidehiko6821ca42016-06-18 11:12:23787 std::unique_ptr<ScreenPinningController> screen_pinning_controller_;
[email protected]a9a40462013-07-31 06:22:56788
Sammie Quon95c6a1c2017-09-12 19:16:55789 std::unique_ptr<PeripheralBatteryNotifier> peripheral_battery_notifier_;
Alberto Herrera8a896dcc2019-07-24 22:41:44790 std::unique_ptr<PeripheralBatteryTracker> peripheral_battery_tracker_;
dchenga94547472016-04-08 08:41:11791 std::unique_ptr<PowerEventObserver> power_event_observer_;
Qiang Xu36234e532018-04-11 04:54:02792 std::unique_ptr<PowerPrefs> power_prefs_;
dchenga94547472016-04-08 08:41:11793 std::unique_ptr<ui::UserActivityPowerManagerNotifier> user_activity_notifier_;
794 std::unique_ptr<VideoActivityNotifier> video_activity_notifier_;
795 std::unique_ptr<StickyKeysController> sticky_keys_controller_;
796 std::unique_ptr<ResolutionNotificationController>
[email protected]7bc49bd2014-01-22 09:30:34797 resolution_notification_controller_;
dchenga94547472016-04-08 08:41:11798 std::unique_ptr<BluetoothNotificationController>
[email protected]b3142722014-03-04 06:59:50799 bluetooth_notification_controller_;
Sonny Sasaka55f69fc2017-08-28 21:29:37800 std::unique_ptr<BluetoothPowerController> bluetooth_power_controller_;
jamescookac6724332017-03-21 02:54:43801 std::unique_ptr<TrayBluetoothHelper> tray_bluetooth_helper_;
Darren Shen7daf3e12019-07-02 07:25:49802 std::unique_ptr<KeyboardControllerImpl> keyboard_controller_;
Bailey Berro01bc58c82020-06-22 17:52:02803 std::unique_ptr<DisplayAlignmentController> display_alignment_controller_;
dchenga94547472016-04-08 08:41:11804 std::unique_ptr<DisplayColorManager> display_color_manager_;
805 std::unique_ptr<DisplayErrorObserver> display_error_observer_;
806 std::unique_ptr<ProjectingObserver> projecting_observer_;
[email protected]6bdf7952012-11-14 10:10:58807
[email protected]c1234a42013-08-20 09:35:40808 // Listens for output changes and updates the display manager.
kylecharf2e4e412016-12-04 04:21:35809 std::unique_ptr<display::DisplayChangeObserver> display_change_observer_;
[email protected]3dff2ef2014-02-09 22:50:39810
kylechar98748a52016-12-03 01:33:22811 // Listens for shutdown and updates DisplayConfigurator.
Steven Bennetts7683e342018-01-02 21:29:52812 std::unique_ptr<DisplayShutdownObserver> display_shutdown_observer_;
kylechar98748a52016-12-03 01:33:22813
yiyix90cfee22017-02-16 05:38:18814 // Listens for new sms messages and shows notifications.
815 std::unique_ptr<SmsObserver> sms_observer_;
816
derat94887a22017-01-20 18:17:25817 // Implements content::ScreenOrientationController for Chrome OS.
dchenga94547472016-04-08 08:41:11818 std::unique_ptr<ScreenOrientationController> screen_orientation_controller_;
yiyixa68ade512016-09-01 17:38:13819 std::unique_ptr<ScreenLayoutObserver> screen_layout_observer_;
jonrossf21fea12014-11-13 01:22:51820
kylechar55f0eaf22017-01-11 22:57:37821 std::unique_ptr<AshTouchTransformController> touch_transformer_controller_;
dnicoara8c3bd1e62014-10-30 19:53:39822
dchenga94547472016-04-08 08:41:11823 std::unique_ptr<ui::EventHandler> magnifier_key_scroll_handler_;
824 std::unique_ptr<ui::EventHandler> speech_feedback_handler_;
sammiequon203ae022016-09-18 17:23:42825 std::unique_ptr<LaserPointerController> laser_pointer_controller_;
826 std::unique_ptr<PartialMagnificationController>
827 partial_magnification_controller_;
Vladislav Kaznacheev6d6aaff2017-07-22 04:06:32828 std::unique_ptr<HighlighterController> highlighter_controller_;
[email protected]70b3e7d52012-06-02 22:12:25829
Jun Mukaif701ffa82019-05-15 20:45:25830 std::unique_ptr<DockedMagnifierControllerImpl> docked_magnifier_controller_;
Ahmed Fakhry4bf3f742018-02-06 17:33:36831
Evan Stadeeb42d772019-05-03 01:51:34832 std::unique_ptr<SnapController> snap_controller_;
833
[email protected]c0ff0342013-02-27 00:41:29834 // |native_cursor_manager_| is owned by |cursor_manager_|, but we keep a
835 // pointer to vend to test code.
erg36cfb952017-06-21 19:41:45836 NativeCursorManagerAsh* native_cursor_manager_;
[email protected]e76096a5f2014-04-08 04:08:03837
derat94887a22017-01-20 18:17:25838 // Cursor may be hidden on certain key events in Chrome OS, whereas we never
sadrul7a8785e2016-02-12 21:54:35839 // hide the cursor on Windows.
dchenga94547472016-04-08 08:41:11840 std::unique_ptr<::wm::CursorManager> cursor_manager_;
[email protected]4b8003c2012-07-26 00:54:19841
David Tseng6792dc82018-05-04 19:18:41842 // Enables spoken feedback accessibility based on a press and hold of both
843 // volume keys.
844 std::unique_ptr<KeyAccessibilityEnabler> key_accessibility_enabler_;
845
yjliu10679cf2020-07-17 18:16:46846 std::unique_ptr<FrameThrottlingController> frame_throttling_controller_;
847
[email protected]852a55d2012-10-17 13:30:30848 // For testing only: simulate that a modal window is open
James Cook7b7c6a52018-01-04 23:40:03849 bool simulate_modal_window_open_for_test_ = false;
[email protected]852a55d2012-10-17 13:30:30850
Evan Stade2c43a87b32017-08-31 17:53:10851 std::unique_ptr<MessageCenterController> message_center_controller_;
852
Trent Apteda250ec3ab2018-08-19 08:52:19853 base::ObserverList<ShellObserver>::Unchecked shell_observers_;
sky00c813f2017-03-08 22:48:55854
Jeremy Roman47d432e2019-08-20 14:24:00855 base::WeakPtrFactory<Shell> weak_factory_{this};
Sam McNallye36abbc2017-07-20 01:04:28856
[email protected]87b0d82e2011-10-07 21:02:59857 DISALLOW_COPY_AND_ASSIGN(Shell);
858};
859
[email protected]55f593352011-12-24 05:42:46860} // namespace ash
[email protected]87b0d82e2011-10-07 21:02:59861
[email protected]b65bdda2011-12-23 23:35:31862#endif // ASH_SHELL_H_