[email protected] | e0d22e8 | 2012-01-04 00:46:57 | [diff] [blame] | 1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
[email protected] | 87b0d82e | 2011-10-07 21:02:59 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
[email protected] | b65bdda | 2011-12-23 23:35:31 | [diff] [blame] | 5 | #ifndef ASH_SHELL_H_ |
| 6 | #define ASH_SHELL_H_ |
[email protected] | 87b0d82e | 2011-10-07 21:02:59 | [diff] [blame] | 7 | |
dcheng | a9454747 | 2016-04-08 08:41:11 | [diff] [blame] | 8 | #include <memory> |
[email protected] | cac10fc6 | 2011-10-07 23:22:56 | [diff] [blame] | 9 | #include <utility> |
| 10 | #include <vector> |
| 11 | |
[email protected] | b65bdda | 2011-12-23 23:35:31 | [diff] [blame] | 12 | #include "ash/ash_export.h" |
[email protected] | 5d2ea36 | 2013-12-13 08:10:18 | [diff] [blame] | 13 | #include "ash/metrics/user_metrics_recorder.h" |
jamescook | d4649fa | 2016-09-30 17:50:09 | [diff] [blame] | 14 | #include "ash/public/cpp/shelf_types.h" |
Xiyuan Xia | 22b1a6c | 2017-04-18 22:46:01 | [diff] [blame] | 15 | #include "ash/session/session_observer.h" |
James Cook | 934abaf | 2017-09-19 22:21:58 | [diff] [blame] | 16 | #include "ash/wm/cursor_manager_chromeos.h" |
[email protected] | c0ce80e | 2012-10-05 23:28:27 | [diff] [blame] | 17 | #include "ash/wm/system_modal_container_event_filter_delegate.h" |
[email protected] | b063928 | 2011-12-22 21:12:27 | [diff] [blame] | 18 | #include "base/gtest_prod_util.h" |
avi | db567a8a | 2015-12-20 17:07:24 | [diff] [blame] | 19 | #include "base/macros.h" |
[email protected] | 6f67df5 | 2013-10-29 01:07:15 | [diff] [blame] | 20 | #include "base/memory/weak_ptr.h" |
[email protected] | 1a2145b | 2012-03-13 21:09:17 | [diff] [blame] | 21 | #include "base/observer_list.h" |
David Black | b9248784 | 2018-03-29 18:45:28 | [diff] [blame] | 22 | #include "chromeos/chromeos_switches.h" |
Alex Newcomer | 8fdcb934 | 2017-08-08 18:48:44 | [diff] [blame] | 23 | #include "ui/app_list/app_list_constants.h" |
[email protected] | c9390bd | 2013-11-08 20:33:13 | [diff] [blame] | 24 | #include "ui/aura/window.h" |
oshima | f84b0da72 | 2016-04-27 19:47:19 | [diff] [blame] | 25 | #include "ui/display/screen.h" |
[email protected] | 86ccbd4 | 2013-09-18 18:11:54 | [diff] [blame] | 26 | #include "ui/events/event_target.h" |
[email protected] | ee3ed1077 | 2014-03-11 22:02:01 | [diff] [blame] | 27 | #include "ui/wm/core/cursor_manager.h" |
sky | 2734438 | 2017-03-08 21:30:32 | [diff] [blame] | 28 | #include "ui/wm/public/activation_change_observer.h" |
[email protected] | 87b0d82e | 2011-10-07 21:02:59 | [diff] [blame] | 29 | |
afakhry | e4fae85 | 2017-05-09 18:49:06 | [diff] [blame] | 30 | class PrefRegistrySimple; |
tibell | b93c729b | 2017-03-30 00:45:09 | [diff] [blame] | 31 | class PrefService; |
| 32 | |
[email protected] | 87b0d82e | 2011-10-07 21:02:59 | [diff] [blame] | 33 | namespace aura { |
[email protected] | 35304ce | 2011-12-14 23:21:01 | [diff] [blame] | 34 | class RootWindow; |
derat | 94887a2 | 2017-01-20 18:17:25 | [diff] [blame] | 35 | class UserActivityForwarder; |
[email protected] | 87b0d82e | 2011-10-07 21:02:59 | [diff] [blame] | 36 | class Window; |
sky | a8b222f | 2017-01-12 15:47:13 | [diff] [blame] | 37 | class WindowManagerClient; |
sky | 00f98a37 | 2017-01-11 06:03:49 | [diff] [blame] | 38 | class WindowTreeClient; |
Alex Newcomer | 8fdcb934 | 2017-08-08 18:48:44 | [diff] [blame] | 39 | } // namespace aura |
[email protected] | fa4a4583 | 2012-04-12 21:32:48 | [diff] [blame] | 40 | |
rjkroege | 72f8154f | 2016-10-29 00:49:02 | [diff] [blame] | 41 | namespace display { |
kylechar | f2e4e41 | 2016-12-04 04:21:35 | [diff] [blame] | 42 | class DisplayChangeObserver; |
kylechar | 7a067ec | 2017-01-07 01:16:28 | [diff] [blame] | 43 | class DisplayConfigurator; |
rjkroege | 72f8154f | 2016-10-29 00:49:02 | [diff] [blame] | 44 | class DisplayManager; |
Alex Newcomer | 8fdcb934 | 2017-08-08 18:48:44 | [diff] [blame] | 45 | } // namespace display |
rjkroege | 72f8154f | 2016-10-29 00:49:02 | [diff] [blame] | 46 | |
[email protected] | 2b99f8c | 2011-10-11 19:42:24 | [diff] [blame] | 47 | namespace gfx { |
sky | 4ec2be8 | 2017-01-06 17:38:32 | [diff] [blame] | 48 | class Insets; |
[email protected] | cac10fc6 | 2011-10-07 23:22:56 | [diff] [blame] | 49 | } |
[email protected] | b6ba05d90 | 2013-10-04 21:38:45 | [diff] [blame] | 50 | |
[email protected] | a8bd1cb | 2012-02-17 23:05:54 | [diff] [blame] | 51 | namespace ui { |
Scott Violet | c8a1c6c | 2017-11-29 23:17:36 | [diff] [blame] | 52 | class ContextFactory; |
| 53 | class ContextFactoryPrivate; |
derat | 2d4e62d | 2015-01-09 16:09:17 | [diff] [blame] | 54 | class UserActivityDetector; |
[email protected] | b0fa701 | 2014-04-16 12:50:57 | [diff] [blame] | 55 | class UserActivityPowerManagerNotifier; |
Alex Newcomer | 8fdcb934 | 2017-08-08 18:48:44 | [diff] [blame] | 56 | } // namespace ui |
thanhph | 3f396851 | 2017-06-21 00:37:23 | [diff] [blame] | 57 | |
[email protected] | 57b8bb35 | 2012-01-11 05:11:46 | [diff] [blame] | 58 | namespace views { |
| 59 | class NonClientFrameView; |
| 60 | class Widget; |
[email protected] | 4a59e4e | 2012-11-12 21:15:40 | [diff] [blame] | 61 | namespace corewm { |
[email protected] | e319c7e | 2014-03-14 19:56:14 | [diff] [blame] | 62 | class TooltipController; |
| 63 | } |
Alex Newcomer | 8fdcb934 | 2017-08-08 18:48:44 | [diff] [blame] | 64 | } // namespace views |
[email protected] | e319c7e | 2014-03-14 19:56:14 | [diff] [blame] | 65 | |
| 66 | namespace wm { |
[email protected] | 60d677d | 2014-05-30 13:07:02 | [diff] [blame] | 67 | class AcceleratorFilter; |
Thiago Farina | 3b086a0 | 2017-05-30 22:32:50 | [diff] [blame] | 68 | class ActivationClient; |
[email protected] | 4a59e4e | 2012-11-12 21:15:40 | [diff] [blame] | 69 | class CompoundEventFilter; |
sky | 2734438 | 2017-03-08 21:30:32 | [diff] [blame] | 70 | class FocusController; |
[email protected] | 86f2b5e | 2012-11-14 20:37:00 | [diff] [blame] | 71 | class ShadowController; |
[email protected] | b5756e2 | 2012-11-30 01:32:02 | [diff] [blame] | 72 | class VisibilityController; |
[email protected] | 0c2dc01 | 2012-12-02 00:00:23 | [diff] [blame] | 73 | class WindowModalityController; |
Alex Newcomer | 8fdcb934 | 2017-08-08 18:48:44 | [diff] [blame] | 74 | } // namespace wm |
[email protected] | 87b0d82e | 2011-10-07 21:02:59 | [diff] [blame] | 75 | |
[email protected] | 55f59335 | 2011-12-24 05:42:46 | [diff] [blame] | 76 | namespace ash { |
[email protected] | 87b0d82e | 2011-10-07 21:02:59 | [diff] [blame] | 77 | |
sky | 81a2d79 | 2017-03-17 19:14:39 | [diff] [blame] | 78 | class AcceleratorController; |
James Cook | ec14495 | 2017-09-01 00:05:16 | [diff] [blame] | 79 | class AccessibilityController; |
sky | 07a24d4 | 2017-03-09 23:57:30 | [diff] [blame] | 80 | class AccessibilityDelegate; |
Qiang Xu | a959100 | 2018-03-15 22:29:31 | [diff] [blame] | 81 | class AccessibilityFocusRingController; |
David Black | e8f81504 | 2018-03-28 18:59:37 | [diff] [blame] | 82 | class AshAssistantController; |
Scott Violet | d64dac1 | 2017-06-02 21:50:08 | [diff] [blame] | 83 | class AshDisplayController; |
Jiaquan He | 4b48f91 | 2018-03-01 03:59:39 | [diff] [blame] | 84 | class AppListControllerImpl; |
erg | 36cfb95 | 2017-06-21 19:41:45 | [diff] [blame] | 85 | class NativeCursorManagerAsh; |
sky | 07a24d4 | 2017-03-09 23:57:30 | [diff] [blame] | 86 | class AshTouchTransformController; |
[email protected] | 55398d2 | 2013-10-10 19:49:20 | [diff] [blame] | 87 | class AutoclickController; |
Toni Barzic | 9d0c82f4 | 2017-12-06 00:53:52 | [diff] [blame] | 88 | class BacklightsForcedOffSetter; |
[email protected] | b314272 | 2014-03-04 06:59:50 | [diff] [blame] | 89 | class BluetoothNotificationController; |
Sonny Sasaka | 55f69fc | 2017-08-28 21:29:37 | [diff] [blame] | 90 | class BluetoothPowerController; |
sky | 79fa3471 | 2017-03-20 23:46:47 | [diff] [blame] | 91 | class BrightnessControlDelegate; |
Tetsui Ohkubo | 5e249953 | 2018-04-04 02:01:39 | [diff] [blame] | 92 | class CapsLockNotificationController; |
sky | 79fa3471 | 2017-03-20 23:46:47 | [diff] [blame] | 93 | class CastConfigController; |
Toni Barzic | d623831 | 2018-03-02 18:26:13 | [diff] [blame] | 94 | class DetachableBaseHandler; |
Toni Barzic | 550419f | 2018-03-08 03:56:21 | [diff] [blame] | 95 | class DetachableBaseNotificationController; |
robert.bradford | ab05249 | 2015-05-06 11:09:56 | [diff] [blame] | 96 | class DisplayColorManager; |
stevenjb | 537c5c3f | 2016-01-20 23:38:12 | [diff] [blame] | 97 | class DisplayConfigurationController; |
[email protected] | 18b21b2e | 2013-03-01 20:56:23 | [diff] [blame] | 98 | class DisplayErrorObserver; |
Steven Bennetts | 7683e34 | 2018-01-02 21:29:52 | [diff] [blame] | 99 | class DisplayShutdownObserver; |
Ahmed Fakhry | 4bf3f74 | 2018-02-06 17:33:36 | [diff] [blame] | 100 | class DockedMagnifierController; |
[email protected] | 084b6bb | 2011-11-17 05:18:16 | [diff] [blame] | 101 | class DragDropController; |
[email protected] | e67291f1 | 2012-10-10 05:52:38 | [diff] [blame] | 102 | class EventClientImpl; |
[email protected] | 682990f | 2013-01-10 06:49:11 | [diff] [blame] | 103 | class EventTransformationHandler; |
sky | 79fa3471 | 2017-03-20 23:46:47 | [diff] [blame] | 104 | class FocusCycler; |
[email protected] | 093b8d64 | 2014-04-03 20:59:28 | [diff] [blame] | 105 | class HighContrastController; |
Vladislav Kaznacheev | 6d6aaff | 2017-07-22 04:06:32 | [diff] [blame] | 106 | class HighlighterController; |
James Cook | bb02673 | 2017-06-09 23:01:55 | [diff] [blame] | 107 | class ImeController; |
sky | 5ab1647 | 2017-03-21 19:35:08 | [diff] [blame] | 108 | class ImmersiveContextAsh; |
sky | b7b5409 | 2016-08-19 16:00:09 | [diff] [blame] | 109 | class ImmersiveHandlerFactoryAsh; |
sky | 79fa3471 | 2017-03-20 23:46:47 | [diff] [blame] | 110 | class KeyboardBrightnessControlDelegate; |
| 111 | class KeyboardUI; |
sammiequon | 203ae02 | 2016-09-18 17:23:42 | [diff] [blame] | 112 | class LaserPointerController; |
sky | 79fa3471 | 2017-03-20 23:46:47 | [diff] [blame] | 113 | class LocaleNotificationController; |
[email protected] | 093b8d64 | 2014-04-03 20:59:28 | [diff] [blame] | 114 | class LockStateController; |
sky | 79fa3471 | 2017-03-20 23:46:47 | [diff] [blame] | 115 | class LogoutConfirmationController; |
Jacob Dufault | ffd9b0d | 2017-11-15 23:07:16 | [diff] [blame] | 116 | class LoginScreenController; |
[email protected] | 093b8d64 | 2014-04-03 20:59:28 | [diff] [blame] | 117 | class MagnificationController; |
Mitsuru Oshima | 0e9b7a6 | 2017-07-19 18:23:03 | [diff] [blame] | 118 | class TabletModeController; |
sky | 5ab1647 | 2017-03-21 19:35:08 | [diff] [blame] | 119 | class MediaController; |
Evan Stade | 2c43a87b3 | 2017-08-31 17:53:10 | [diff] [blame] | 120 | class MessageCenterController; |
[email protected] | 78d9630 | 2012-06-22 00:58:07 | [diff] [blame] | 121 | class MouseCursorEventFilter; |
sky | 5ab1647 | 2017-03-21 19:35:08 | [diff] [blame] | 122 | class MruWindowTracker; |
| 123 | class NewWindowController; |
afakhry | e4fae85 | 2017-05-09 18:49:06 | [diff] [blame] | 124 | class NightLightController; |
Vladislav Kaznacheev | 92edf62e | 2017-10-13 22:08:01 | [diff] [blame] | 125 | class NoteTakingController; |
[email protected] | 9ae32df | 2012-07-26 03:25:18 | [diff] [blame] | 126 | class OverlayEventFilter; |
[email protected] | 093b8d64 | 2014-04-03 20:59:28 | [diff] [blame] | 127 | class PartialMagnificationController; |
Sammie Quon | 95c6a1c | 2017-09-12 19:16:55 | [diff] [blame] | 128 | class PeripheralBatteryNotifier; |
Qiang Xu | d77a90c | 2018-02-20 19:43:29 | [diff] [blame] | 129 | class PersistentWindowController; |
[email protected] | 093b8d64 | 2014-04-03 20:59:28 | [diff] [blame] | 130 | class PowerButtonController; |
[email protected] | 5162505 | 2013-10-10 01:40:16 | [diff] [blame] | 131 | class PowerEventObserver; |
Qiang Xu | 36234e53 | 2018-04-11 04:54:02 | [diff] [blame^] | 132 | class PowerPrefs; |
[email protected] | 72bce52 | 2014-02-10 21:11:26 | [diff] [blame] | 133 | class ProjectingObserver; |
[email protected] | e4a181cc | 2012-03-17 02:20:57 | [diff] [blame] | 134 | class ResizeShadowController; |
[email protected] | 6ef71d7 | 2013-08-10 18:13:44 | [diff] [blame] | 135 | class ResolutionNotificationController; |
[email protected] | d90b839 | 2012-06-13 09:34:56 | [diff] [blame] | 136 | class RootWindowController; |
sky | 11cf8db9 | 2017-04-10 23:38:08 | [diff] [blame] | 137 | class ShellPort; |
jamescook | ac672433 | 2017-03-21 02:54:43 | [diff] [blame] | 138 | class ScreenLayoutObserver; |
jonross | 0af4521 | 2015-01-13 18:55:46 | [diff] [blame] | 139 | class ScreenOrientationController; |
oshima | 5a296e8 | 2016-04-29 01:32:27 | [diff] [blame] | 140 | class ScreenshotController; |
hidehiko | 6821ca4 | 2016-06-18 11:12:23 | [diff] [blame] | 141 | class ScreenPinningController; |
[email protected] | 8d625fb | 2012-07-18 16:40:06 | [diff] [blame] | 142 | class ScreenPositionController; |
Tetsui Ohkubo | 3a92f0d9 | 2018-03-30 18:33:29 | [diff] [blame] | 143 | class ScreenSecurityNotificationController; |
sky | 5ad143a | 2017-03-22 04:31:23 | [diff] [blame] | 144 | class SessionController; |
sky | 5ad143a | 2017-03-22 04:31:23 | [diff] [blame] | 145 | class ShelfController; |
sky | 5ad143a | 2017-03-22 04:31:23 | [diff] [blame] | 146 | class ShelfModel; |
| 147 | class ShelfWindowWatcher; |
sky | b073203a | 2017-03-13 16:59:16 | [diff] [blame] | 148 | class ShellDelegate; |
[email protected] | 1b4c747 | 2014-05-15 18:32:23 | [diff] [blame] | 149 | struct ShellInitParams; |
sky | 00c813f | 2017-03-08 22:48:55 | [diff] [blame] | 150 | class ShellObserver; |
sky | 5b45ed8 | 2017-03-27 02:54:23 | [diff] [blame] | 151 | class ShutdownController; |
yiyix | 90cfee2 | 2017-02-16 05:38:18 | [diff] [blame] | 152 | class SmsObserver; |
xdai | d491376 | 2017-07-06 00:17:22 | [diff] [blame] | 153 | class SplitViewController; |
[email protected] | 093b8d64 | 2014-04-03 20:59:28 | [diff] [blame] | 154 | class StickyKeysController; |
[email protected] | 9ae32df | 2012-07-26 03:25:18 | [diff] [blame] | 155 | class SystemGestureEventFilter; |
[email protected] | c0ce80e | 2012-10-05 23:28:27 | [diff] [blame] | 156 | class SystemModalContainerEventFilter; |
[email protected] | 093b8d64 | 2014-04-03 20:59:28 | [diff] [blame] | 157 | class SystemTray; |
sky | 79fa3471 | 2017-03-20 23:46:47 | [diff] [blame] | 158 | class SystemTrayController; |
Tetsui Ohkubo | 2172293 | 2018-03-02 02:56:56 | [diff] [blame] | 159 | class SystemTrayModel; |
sky | 5b45ed8 | 2017-03-27 02:54:23 | [diff] [blame] | 160 | class SystemTrayNotifier; |
Scott Violet | 3c554ae | 2017-12-13 02:25:41 | [diff] [blame] | 161 | class TimeToFirstPresentRecorder; |
[email protected] | 093b8d64 | 2014-04-03 20:59:28 | [diff] [blame] | 162 | class ToplevelWindowEventHandler; |
sky | 07a24d4 | 2017-03-09 23:57:30 | [diff] [blame] | 163 | class ToastManager; |
Qiang Xu | f1400a36 | 2017-09-14 02:28:30 | [diff] [blame] | 164 | class TouchDevicesController; |
tbarzic | c78da1ff9 | 2017-05-08 20:46:15 | [diff] [blame] | 165 | class TrayAction; |
jamescook | ac672433 | 2017-03-21 02:54:43 | [diff] [blame] | 166 | class TrayBluetoothHelper; |
bshe | eaae09a | 2014-09-22 23:16:52 | [diff] [blame] | 167 | class VirtualKeyboardController; |
[email protected] | ded58fd | 2013-10-09 07:56:55 | [diff] [blame] | 168 | class VideoActivityNotifier; |
[email protected] | 093b8d64 | 2014-04-03 20:59:28 | [diff] [blame] | 169 | class VideoDetector; |
Yue Li | a33960a | 2017-11-01 22:06:07 | [diff] [blame] | 170 | class VoiceInteractionController; |
sky | 5b45ed8 | 2017-03-27 02:54:23 | [diff] [blame] | 171 | class VpnList; |
sky | 07a24d4 | 2017-03-09 23:57:30 | [diff] [blame] | 172 | class WallpaperController; |
[email protected] | 093b8d64 | 2014-04-03 20:59:28 | [diff] [blame] | 173 | class WebNotificationTray; |
sky | 5b45ed8 | 2017-03-27 02:54:23 | [diff] [blame] | 174 | class WindowCycleController; |
[email protected] | 093b8d64 | 2014-04-03 20:59:28 | [diff] [blame] | 175 | class WindowPositioner; |
sky | 5b45ed8 | 2017-03-27 02:54:23 | [diff] [blame] | 176 | class WindowSelectorController; |
msw | 607227f8 | 2016-08-30 17:22:39 | [diff] [blame] | 177 | class WindowTreeHostManager; |
[email protected] | 2b99f8c | 2011-10-11 19:42:24 | [diff] [blame] | 178 | |
sky | 494c6cbd | 2017-03-27 20:57:48 | [diff] [blame] | 179 | enum class Config; |
| 180 | enum class LoginStatus; |
| 181 | |
[email protected] | 87b0d82e | 2011-10-07 21:02:59 | [diff] [blame] | 182 | // Shell is a singleton object that presents the Shell API and implements the |
[email protected] | 99f07e0 | 2011-12-07 00:02:59 | [diff] [blame] | 183 | // RootWindow's delegate interface. |
[email protected] | b0079a9 | 2012-01-25 20:13:38 | [diff] [blame] | 184 | // |
| 185 | // Upon creation, the Shell sets itself as the RootWindow's delegate, which |
| 186 | // takes ownership of the Shell. |
Xiyuan Xia | 22b1a6c | 2017-04-18 22:46:01 | [diff] [blame] | 187 | class ASH_EXPORT Shell : public SessionObserver, |
sky | 5ad143a | 2017-03-22 04:31:23 | [diff] [blame] | 188 | public SystemModalContainerEventFilterDelegate, |
sky | 2734438 | 2017-03-08 21:30:32 | [diff] [blame] | 189 | public ui::EventTarget, |
Thiago Farina | 3b086a0 | 2017-05-30 22:32:50 | [diff] [blame] | 190 | public ::wm::ActivationChangeObserver { |
[email protected] | 87b0d82e | 2011-10-07 21:02:59 | [diff] [blame] | 191 | public: |
[email protected] | 093b8d64 | 2014-04-03 20:59:28 | [diff] [blame] | 192 | typedef std::vector<RootWindowController*> RootWindowControllerList; |
[email protected] | be65be36 | 2012-06-15 07:38:23 | [diff] [blame] | 193 | |
Scott Violet | c8a1c6c | 2017-11-29 23:17:36 | [diff] [blame] | 194 | // Creates the single Shell instance. |
| 195 | static Shell* CreateInstance(ShellInitParams init_params); |
[email protected] | 3266c2b9 | 2011-11-14 00:06:08 | [diff] [blame] | 196 | |
| 197 | // Should never be called before |CreateInstance()|. |
sky | b073203a | 2017-03-13 16:59:16 | [diff] [blame] | 198 | static Shell* Get(); |
[email protected] | 3266c2b9 | 2011-11-14 00:06:08 | [diff] [blame] | 199 | |
[email protected] | b3b7bcd | 2012-03-06 19:35:45 | [diff] [blame] | 200 | // Returns true if the ash shell has been instantiated. |
| 201 | static bool HasInstance(); |
| 202 | |
[email protected] | ef589af | 2011-12-03 01:07:15 | [diff] [blame] | 203 | static void DeleteInstance(); |
[email protected] | cac10fc6 | 2011-10-07 23:22:56 | [diff] [blame] | 204 | |
[email protected] | d90b839 | 2012-06-13 09:34:56 | [diff] [blame] | 205 | // Returns the root window controller for the primary root window. |
[email protected] | a0afeb1 | 2012-12-10 22:57:09 | [diff] [blame] | 206 | // TODO(oshima): move this to |RootWindowController| |
[email protected] | 093b8d64 | 2014-04-03 20:59:28 | [diff] [blame] | 207 | static RootWindowController* GetPrimaryRootWindowController(); |
[email protected] | d90b839 | 2012-06-13 09:34:56 | [diff] [blame] | 208 | |
thanhph | c90f49ca | 2017-03-03 17:48:53 | [diff] [blame] | 209 | // Returns the RootWindowController for the given display id. If there |
| 210 | // is no display for |display_id|, null is returned. |
| 211 | static RootWindowController* GetRootWindowControllerWithDisplayId( |
| 212 | int64_t display_id); |
| 213 | |
Scott Violet | 596bb4634 | 2017-06-21 14:43:13 | [diff] [blame] | 214 | // Returns the root Window for the given display id. If there is no display |
| 215 | // for |display_id| null is returned. |
| 216 | static aura::Window* GetRootWindowForDisplayId(int64_t display_id); |
| 217 | |
[email protected] | cf1c70e | 2012-08-30 01:13:02 | [diff] [blame] | 218 | // Returns all root window controllers. |
[email protected] | a0afeb1 | 2012-12-10 22:57:09 | [diff] [blame] | 219 | // TODO(oshima): move this to |RootWindowController| |
[email protected] | be65be36 | 2012-06-15 07:38:23 | [diff] [blame] | 220 | static RootWindowControllerList GetAllRootWindowControllers(); |
| 221 | |
[email protected] | bf9cdb36 | 2013-10-25 19:22:45 | [diff] [blame] | 222 | // Returns the primary root Window. The primary root Window is the one that |
| 223 | // has a launcher. |
| 224 | static aura::Window* GetPrimaryRootWindow(); |
[email protected] | e73bd780 | 2012-02-17 20:10:34 | [diff] [blame] | 225 | |
sky | 2734438 | 2017-03-08 21:30:32 | [diff] [blame] | 226 | // Returns the root window that newly created windows should be added to. |
| 227 | // Value can be temporarily overridden using ScopedRootWindowForNewWindows. |
| 228 | // NOTE: this returns the root, newly created window should be added to the |
| 229 | // appropriate container in the returned window. |
| 230 | static aura::Window* GetRootWindowForNewWindows(); |
mfomitchev | a1a8aa6 | 2016-05-03 16:23:26 | [diff] [blame] | 231 | |
[email protected] | cf1c70e | 2012-08-30 01:13:02 | [diff] [blame] | 232 | // Returns all root windows. |
[email protected] | c9390bd | 2013-11-08 20:33:13 | [diff] [blame] | 233 | static aura::Window::Windows GetAllRootWindows(); |
[email protected] | be65be36 | 2012-06-15 07:38:23 | [diff] [blame] | 234 | |
[email protected] | bf9cdb36 | 2013-10-25 19:22:45 | [diff] [blame] | 235 | static aura::Window* GetContainer(aura::Window* root_window, |
[email protected] | 7b0f750 | 2012-06-11 00:12:39 | [diff] [blame] | 236 | int container_id); |
[email protected] | bf9cdb36 | 2013-10-25 19:22:45 | [diff] [blame] | 237 | static const aura::Window* GetContainer(const aura::Window* root_window, |
[email protected] | e67291f1 | 2012-10-10 05:52:38 | [diff] [blame] | 238 | int container_id); |
[email protected] | 7b0f750 | 2012-06-11 00:12:39 | [diff] [blame] | 239 | |
James Cook | 7b7c6a5 | 2018-01-04 23:40:03 | [diff] [blame] | 240 | // If a system-modal dialog window is currently open, returns the ID of the |
| 241 | // system modal window container that contains the window. |
| 242 | // If no system-modal dialogs are open it returns -1. |
| 243 | static int GetOpenSystemModalWindowContainerId(); |
| 244 | |
| 245 | // Returns true if a system-modal dialog window is currently open. |
| 246 | static bool IsSystemModalWindowOpen(); |
| 247 | |
sky | a8b222f | 2017-01-12 15:47:13 | [diff] [blame] | 248 | // TODO(sky): move this and WindowManagerClient into ShellMash that is owned |
| 249 | // by Shell. Doing the move is gated on having mash create Shell. |
sky | 00f98a37 | 2017-01-11 06:03:49 | [diff] [blame] | 250 | static void set_window_tree_client(aura::WindowTreeClient* client) { |
| 251 | window_tree_client_ = client; |
| 252 | } |
| 253 | |
| 254 | static aura::WindowTreeClient* window_tree_client() { |
| 255 | return window_tree_client_; |
| 256 | } |
| 257 | |
sky | a8b222f | 2017-01-12 15:47:13 | [diff] [blame] | 258 | static void set_window_manager_client(aura::WindowManagerClient* client) { |
| 259 | window_manager_client_ = client; |
| 260 | } |
| 261 | static aura::WindowManagerClient* window_manager_client() { |
| 262 | return window_manager_client_; |
| 263 | } |
| 264 | |
jamescook | 0dfe563 | 2017-04-05 18:49:02 | [diff] [blame] | 265 | static Config GetAshConfig(); |
moshayedi | c229a52 | 2017-05-05 18:14:26 | [diff] [blame] | 266 | static bool ShouldUseIMEService(); |
sky | 494c6cbd | 2017-03-27 20:57:48 | [diff] [blame] | 267 | |
Wenzhao Zang | 56c29293 | 2017-08-02 04:58:34 | [diff] [blame] | 268 | // Registers all ash related local state prefs to the given |registry|. |
| 269 | static void RegisterLocalStatePrefs(PrefRegistrySimple* registry); |
| 270 | |
Qiang Xu | 36234e53 | 2018-04-11 04:54:02 | [diff] [blame^] | 271 | // Registers all ash related signin/user profile prefs to the given |
| 272 | // |registry|. Can be called before Shell is initialized. When |for_test| is |
| 273 | // true this registers foreign user profile prefs (e.g. chrome prefs) as if |
| 274 | // they are owned by ash. This allows test code to read the pref values. |
| 275 | static void RegisterSigninProfilePrefs(PrefRegistrySimple* registry, |
| 276 | bool for_test = false); |
| 277 | static void RegisterUserProfilePrefs(PrefRegistrySimple* registry, |
| 278 | bool for_test = false); |
afakhry | e4fae85 | 2017-05-09 18:49:06 | [diff] [blame] | 279 | |
[email protected] | 57b8bb35 | 2012-01-11 05:11:46 | [diff] [blame] | 280 | // Creates a default views::NonClientFrameView for use by windows in the |
| 281 | // Ash environment. |
| 282 | views::NonClientFrameView* CreateDefaultNonClientFrameView( |
| 283 | views::Widget* widget); |
| 284 | |
msw | ad28b25 | 2016-08-09 02:42:07 | [diff] [blame] | 285 | // Sets work area insets of the display containing |window|, pings observers. |
[email protected] | 2e236a5 | 2012-06-27 22:21:47 | [diff] [blame] | 286 | void SetDisplayWorkAreaInsets(aura::Window* window, |
[email protected] | 8a45c97 | 2012-03-14 18:22:44 | [diff] [blame] | 287 | const gfx::Insets& insets); |
[email protected] | 1a2145b | 2012-03-13 21:09:17 | [diff] [blame] | 288 | |
[email protected] | 58868abf | 2014-01-17 23:45:33 | [diff] [blame] | 289 | // Called when a casting session is started or stopped. |
| 290 | void OnCastingSessionStartedOrStopped(bool started); |
| 291 | |
[email protected] | 0e3e7cb | 2014-04-12 05:18:25 | [diff] [blame] | 292 | // Called when a root window is created. |
varkha | c71444e5 | 2017-05-25 22:51:34 | [diff] [blame] | 293 | void OnRootWindowAdded(aura::Window* root_window); |
[email protected] | 0e3e7cb | 2014-04-12 05:18:25 | [diff] [blame] | 294 | |
Keigo Oka | e82281a | 2017-06-14 13:59:14 | [diff] [blame] | 295 | // Creates a keyboard controller and associate it with the primary root window |
| 296 | // controller. Destroys the old keyboard controller if it already exists. |
[email protected] | 51f43811 | 2013-11-18 19:32:50 | [diff] [blame] | 297 | void CreateKeyboard(); |
| 298 | |
Keigo Oka | c7617a4 | 2017-06-14 11:33:24 | [diff] [blame] | 299 | // Destroys the virtual keyboard. |
| 300 | void DestroyKeyboard(); |
[email protected] | e1b299b | 2014-01-29 23:53:41 | [diff] [blame] | 301 | |
Mitsuru Oshima | 0e9b7a6 | 2017-07-19 18:23:03 | [diff] [blame] | 302 | // Test if TabletModeWindowManager is not enabled, and if |
| 303 | // TabletModeController is not currently setting a display rotation. Or if |
[email protected] | da28585 | 2014-05-27 19:53:43 | [diff] [blame] | 304 | // the |resolution_notification_controller_| is not showing its confirmation |
| 305 | // dialog. If true then changes to display settings can be saved. |
| 306 | bool ShouldSaveDisplaySettings(); |
[email protected] | da28585 | 2014-05-27 19:53:43 | [diff] [blame] | 307 | |
sky | 81a2d79 | 2017-03-17 19:14:39 | [diff] [blame] | 308 | AcceleratorController* accelerator_controller() { |
| 309 | return accelerator_controller_.get(); |
sky | 44a0989 | 2016-07-20 17:46:58 | [diff] [blame] | 310 | } |
James Cook | ec14495 | 2017-09-01 00:05:16 | [diff] [blame] | 311 | AccessibilityController* accessibility_controller() { |
| 312 | return accessibility_controller_.get(); |
| 313 | } |
sky | 07a24d4 | 2017-03-09 23:57:30 | [diff] [blame] | 314 | AccessibilityDelegate* accessibility_delegate() { |
| 315 | return accessibility_delegate_.get(); |
| 316 | } |
Qiang Xu | a959100 | 2018-03-15 22:29:31 | [diff] [blame] | 317 | AccessibilityFocusRingController* accessibility_focus_ring_controller() { |
| 318 | return accessibility_focus_ring_controller_.get(); |
| 319 | } |
Qiang Xu | f1400a36 | 2017-09-14 02:28:30 | [diff] [blame] | 320 | ::wm::ActivationClient* activation_client(); |
Jiaquan He | 4b48f91 | 2018-03-01 03:59:39 | [diff] [blame] | 321 | AppListControllerImpl* app_list_controller() { |
| 322 | return app_list_controller_.get(); |
| 323 | } |
David Black | e8f81504 | 2018-03-28 18:59:37 | [diff] [blame] | 324 | AshAssistantController* ash_assistant_controller() { |
David Black | b9248784 | 2018-03-29 18:45:28 | [diff] [blame] | 325 | DCHECK(chromeos::switches::IsAssistantEnabled()); |
David Black | e8f81504 | 2018-03-28 18:59:37 | [diff] [blame] | 326 | return ash_assistant_controller_.get(); |
| 327 | } |
Scott Violet | d64dac1 | 2017-06-02 21:50:08 | [diff] [blame] | 328 | AshDisplayController* ash_display_controller() { |
| 329 | return ash_display_controller_.get(); |
| 330 | } |
Qiang Xu | f1400a36 | 2017-09-14 02:28:30 | [diff] [blame] | 331 | AutoclickController* autoclick_controller() { |
| 332 | return autoclick_controller_.get(); |
| 333 | } |
Daniel Erat | 477c56d | 2017-12-13 21:42:54 | [diff] [blame] | 334 | BacklightsForcedOffSetter* backlights_forced_off_setter() { |
| 335 | return backlights_forced_off_setter_.get(); |
| 336 | } |
Qiang Xu | f1400a36 | 2017-09-14 02:28:30 | [diff] [blame] | 337 | BluetoothPowerController* bluetooth_power_controller() { |
| 338 | return bluetooth_power_controller_.get(); |
| 339 | } |
sky | 79fa3471 | 2017-03-20 23:46:47 | [diff] [blame] | 340 | BrightnessControlDelegate* brightness_control_delegate() { |
| 341 | return brightness_control_delegate_.get(); |
| 342 | } |
| 343 | CastConfigController* cast_config() { return cast_config_.get(); } |
Steven Bennetts | a866fca | 2017-11-07 19:39:35 | [diff] [blame] | 344 | |
| 345 | // Returns nullptr in mash which has no global cursor manager. |
Qiang Xu | f1400a36 | 2017-09-14 02:28:30 | [diff] [blame] | 346 | ::wm::CursorManager* cursor_manager() { return cursor_manager_.get(); } |
Steven Bennetts | a866fca | 2017-11-07 19:39:35 | [diff] [blame] | 347 | |
Toni Barzic | d623831 | 2018-03-02 18:26:13 | [diff] [blame] | 348 | DetachableBaseHandler* detachable_base_handler() { |
| 349 | return detachable_base_handler_.get(); |
| 350 | } |
| 351 | |
rjkroege | 72f8154f | 2016-10-29 00:49:02 | [diff] [blame] | 352 | display::DisplayManager* display_manager() { return display_manager_.get(); } |
stevenjb | 537c5c3f | 2016-01-20 23:38:12 | [diff] [blame] | 353 | DisplayConfigurationController* display_configuration_controller() { |
| 354 | return display_configuration_controller_.get(); |
| 355 | } |
Qiang Xu | f1400a36 | 2017-09-14 02:28:30 | [diff] [blame] | 356 | |
| 357 | // TODO(oshima): Move these objects to WindowTreeHostManager. |
| 358 | display::DisplayConfigurator* display_configurator() { |
| 359 | return display_configurator_.get(); |
| 360 | } |
| 361 | DisplayErrorObserver* display_error_observer() { |
| 362 | return display_error_observer_.get(); |
| 363 | } |
| 364 | |
Ahmed Fakhry | 4bf3f74 | 2018-02-06 17:33:36 | [diff] [blame] | 365 | DockedMagnifierController* docked_magnifier_controller(); |
jamescook | b8dcef52 | 2016-06-25 14:42:55 | [diff] [blame] | 366 | ::wm::CompoundEventFilter* env_filter() { return env_filter_.get(); } |
Qiang Xu | f1400a36 | 2017-09-14 02:28:30 | [diff] [blame] | 367 | EventClientImpl* event_client() { return event_client_.get(); } |
| 368 | EventTransformationHandler* event_transformation_handler() { |
| 369 | return event_transformation_handler_.get(); |
| 370 | } |
sky | 79fa3471 | 2017-03-20 23:46:47 | [diff] [blame] | 371 | FocusCycler* focus_cycler() { return focus_cycler_.get(); } |
Qiang Xu | f1400a36 | 2017-09-14 02:28:30 | [diff] [blame] | 372 | HighlighterController* highlighter_controller() { |
| 373 | return highlighter_controller_.get(); |
| 374 | } |
| 375 | HighContrastController* high_contrast_controller() { |
| 376 | return high_contrast_controller_.get(); |
| 377 | } |
James Cook | f0c78fc | 2017-06-15 14:42:55 | [diff] [blame] | 378 | ImeController* ime_controller() { return ime_controller_.get(); } |
sky | 79fa3471 | 2017-03-20 23:46:47 | [diff] [blame] | 379 | KeyboardBrightnessControlDelegate* keyboard_brightness_control_delegate() { |
| 380 | return keyboard_brightness_control_delegate_.get(); |
| 381 | } |
| 382 | KeyboardUI* keyboard_ui() { return keyboard_ui_.get(); } |
Qiang Xu | f1400a36 | 2017-09-14 02:28:30 | [diff] [blame] | 383 | LaserPointerController* laser_pointer_controller() { |
| 384 | return laser_pointer_controller_.get(); |
| 385 | } |
sky | 79fa3471 | 2017-03-20 23:46:47 | [diff] [blame] | 386 | LocaleNotificationController* locale_notification_controller() { |
| 387 | return locale_notification_controller_.get(); |
| 388 | } |
Jacob Dufault | ffd9b0d | 2017-11-15 23:07:16 | [diff] [blame] | 389 | LoginScreenController* login_screen_controller() { |
| 390 | return login_screen_controller_.get(); |
xiaoyinh | 2bbdd10 | 2017-05-18 23:29:42 | [diff] [blame] | 391 | } |
Qiang Xu | f1400a36 | 2017-09-14 02:28:30 | [diff] [blame] | 392 | LockStateController* lock_state_controller() { |
| 393 | return lock_state_controller_.get(); |
| 394 | } |
| 395 | LogoutConfirmationController* logout_confirmation_controller() { |
| 396 | return logout_confirmation_controller_.get(); |
| 397 | } |
| 398 | MagnificationController* magnification_controller() { |
| 399 | return magnification_controller_.get(); |
| 400 | } |
sky | 5ab1647 | 2017-03-21 19:35:08 | [diff] [blame] | 401 | MediaController* media_controller() { return media_controller_.get(); } |
Evan Stade | 04c18d0 | 2017-10-20 20:53:22 | [diff] [blame] | 402 | MessageCenterController* message_center_controller() { |
| 403 | return message_center_controller_.get(); |
| 404 | } |
Qiang Xu | f1400a36 | 2017-09-14 02:28:30 | [diff] [blame] | 405 | MouseCursorEventFilter* mouse_cursor_filter() { |
| 406 | return mouse_cursor_filter_.get(); |
| 407 | } |
sky | 5ab1647 | 2017-03-21 19:35:08 | [diff] [blame] | 408 | MruWindowTracker* mru_window_tracker() { return mru_window_tracker_.get(); } |
| 409 | NewWindowController* new_window_controller() { |
| 410 | return new_window_controller_.get(); |
| 411 | } |
afakhry | 9e0a18b3 | 2017-06-05 19:23:14 | [diff] [blame] | 412 | NightLightController* night_light_controller(); |
Vladislav Kaznacheev | 92edf62e | 2017-10-13 22:08:01 | [diff] [blame] | 413 | NoteTakingController* note_taking_controller() { |
| 414 | return note_taking_controller_.get(); |
| 415 | } |
Qiang Xu | f1400a36 | 2017-09-14 02:28:30 | [diff] [blame] | 416 | OverlayEventFilter* overlay_filter() { return overlay_filter_.get(); } |
Qiang Xu | f1400a36 | 2017-09-14 02:28:30 | [diff] [blame] | 417 | PartialMagnificationController* partial_magnification_controller() { |
| 418 | return partial_magnification_controller_.get(); |
| 419 | } |
| 420 | PowerButtonController* power_button_controller() { |
| 421 | return power_button_controller_.get(); |
| 422 | } |
| 423 | PowerEventObserver* power_event_observer() { |
| 424 | return power_event_observer_.get(); |
| 425 | } |
| 426 | ResizeShadowController* resize_shadow_controller() { |
| 427 | return resize_shadow_controller_.get(); |
| 428 | } |
| 429 | ResolutionNotificationController* resolution_notification_controller() { |
| 430 | return resolution_notification_controller_.get(); |
| 431 | } |
| 432 | ScreenshotController* screenshot_controller() { |
| 433 | return screenshot_controller_.get(); |
| 434 | } |
| 435 | ScreenLayoutObserver* screen_layout_observer() { |
| 436 | return screen_layout_observer_.get(); |
| 437 | } |
| 438 | ScreenOrientationController* screen_orientation_controller() { |
| 439 | return screen_orientation_controller_.get(); |
| 440 | } |
| 441 | ScreenPinningController* screen_pinning_controller() { |
| 442 | return screen_pinning_controller_.get(); |
| 443 | } |
sky | 5ad143a | 2017-03-22 04:31:23 | [diff] [blame] | 444 | SessionController* session_controller() { return session_controller_.get(); } |
| 445 | ShelfController* shelf_controller() { return shelf_controller_.get(); } |
sky | 5ad143a | 2017-03-22 04:31:23 | [diff] [blame] | 446 | ShelfModel* shelf_model(); |
Qiang Xu | f1400a36 | 2017-09-14 02:28:30 | [diff] [blame] | 447 | ShellDelegate* shell_delegate() { return shell_delegate_.get(); } |
sky | 5b45ed8 | 2017-03-27 02:54:23 | [diff] [blame] | 448 | ShutdownController* shutdown_controller() { |
| 449 | return shutdown_controller_.get(); |
| 450 | } |
Qiang Xu | f1400a36 | 2017-09-14 02:28:30 | [diff] [blame] | 451 | SplitViewController* split_view_controller() { |
| 452 | return split_view_controller_.get(); |
| 453 | } |
| 454 | StickyKeysController* sticky_keys_controller() { |
| 455 | return sticky_keys_controller_.get(); |
| 456 | } |
sky | 79fa3471 | 2017-03-20 23:46:47 | [diff] [blame] | 457 | SystemTrayController* system_tray_controller() { |
| 458 | return system_tray_controller_.get(); |
| 459 | } |
Tetsui Ohkubo | 2172293 | 2018-03-02 02:56:56 | [diff] [blame] | 460 | SystemTrayModel* system_tray_model() { return system_tray_model_.get(); } |
sky | 5b45ed8 | 2017-03-27 02:54:23 | [diff] [blame] | 461 | SystemTrayNotifier* system_tray_notifier() { |
| 462 | return system_tray_notifier_.get(); |
| 463 | } |
Sammie Quon | a6f9640 | 2017-08-24 01:08:37 | [diff] [blame] | 464 | TabletModeController* tablet_mode_controller() { |
| 465 | return tablet_mode_controller_.get(); |
| 466 | } |
Scott Violet | 3c554ae | 2017-12-13 02:25:41 | [diff] [blame] | 467 | TimeToFirstPresentRecorder* time_to_first_present_recorder() { |
| 468 | return time_to_first_present_recorder_.get(); |
| 469 | } |
Qiang Xu | f1400a36 | 2017-09-14 02:28:30 | [diff] [blame] | 470 | ToastManager* toast_manager() { return toast_manager_.get(); } |
[email protected] | a1b7a82 | 2013-02-23 19:08:04 | [diff] [blame] | 471 | views::corewm::TooltipController* tooltip_controller() { |
[email protected] | 862deef | 2011-12-15 22:07:33 | [diff] [blame] | 472 | return tooltip_controller_.get(); |
[email protected] | 4a229e90 | 2011-12-01 21:21:11 | [diff] [blame] | 473 | } |
Qiang Xu | f1400a36 | 2017-09-14 02:28:30 | [diff] [blame] | 474 | TouchDevicesController* touch_devices_controller() { |
| 475 | return touch_devices_controller_.get(); |
chirantan | 40e4cd8 | 2015-02-19 01:08:19 | [diff] [blame] | 476 | } |
kylechar | 55f0eaf2 | 2017-01-11 22:57:37 | [diff] [blame] | 477 | AshTouchTransformController* touch_transformer_controller() { |
[email protected] | 03122891a | 2014-05-13 23:56:49 | [diff] [blame] | 478 | return touch_transformer_controller_.get(); |
| 479 | } |
Qiang Xu | f1400a36 | 2017-09-14 02:28:30 | [diff] [blame] | 480 | TrayAction* tray_action() { return tray_action_.get(); } |
| 481 | TrayBluetoothHelper* tray_bluetooth_helper() { |
| 482 | return tray_bluetooth_helper_.get(); |
sammiequon | 203ae02 | 2016-09-18 17:23:42 | [diff] [blame] | 483 | } |
Evan Stade | 04c18d0 | 2017-10-20 20:53:22 | [diff] [blame] | 484 | UserMetricsRecorder* metrics() { return user_metrics_recorder_.get(); } |
Qiang Xu | f1400a36 | 2017-09-14 02:28:30 | [diff] [blame] | 485 | VideoDetector* video_detector() { return video_detector_.get(); } |
| 486 | VirtualKeyboardController* virtual_keyboard_controller() { |
| 487 | return virtual_keyboard_controller_.get(); |
sammiequon | 203ae02 | 2016-09-18 17:23:42 | [diff] [blame] | 488 | } |
Yue Li | a33960a | 2017-11-01 22:06:07 | [diff] [blame] | 489 | VoiceInteractionController* voice_interaction_controller() { |
| 490 | return voice_interaction_controller_.get(); |
| 491 | } |
Qiang Xu | f1400a36 | 2017-09-14 02:28:30 | [diff] [blame] | 492 | VpnList* vpn_list() { return vpn_list_.get(); } |
| 493 | WallpaperController* wallpaper_controller() { |
| 494 | return wallpaper_controller_.get(); |
Vladislav Kaznacheev | 6d6aaff | 2017-07-22 04:06:32 | [diff] [blame] | 495 | } |
Qiang Xu | f1400a36 | 2017-09-14 02:28:30 | [diff] [blame] | 496 | WindowCycleController* window_cycle_controller() { |
| 497 | return window_cycle_controller_.get(); |
mukai | 19274bdd | 2015-02-24 22:37:48 | [diff] [blame] | 498 | } |
Qiang Xu | f1400a36 | 2017-09-14 02:28:30 | [diff] [blame] | 499 | WindowPositioner* window_positioner() { return window_positioner_.get(); } |
| 500 | WindowSelectorController* window_selector_controller() { |
| 501 | return window_selector_controller_.get(); |
[email protected] | 8b7ba87b | 2012-09-01 00:40:40 | [diff] [blame] | 502 | } |
Qiang Xu | f1400a36 | 2017-09-14 02:28:30 | [diff] [blame] | 503 | WindowTreeHostManager* window_tree_host_manager() { |
| 504 | return window_tree_host_manager_.get(); |
[email protected] | 682990f | 2013-01-10 06:49:11 | [diff] [blame] | 505 | } |
[email protected] | 77f7c13 | 2012-11-15 06:52:54 | [diff] [blame] | 506 | |
Mitsuru Oshima | 89e5c135 | 2018-01-17 07:29:39 | [diff] [blame] | 507 | ToplevelWindowEventHandler* toplevel_window_event_handler() { |
| 508 | return toplevel_window_event_handler_.get(); |
| 509 | } |
| 510 | |
[email protected] | c758fbf | 2012-03-25 22:53:59 | [diff] [blame] | 511 | // Force the shelf to query for it's current visibility state. |
jamescook | 6afad6d | 2016-06-01 00:35:01 | [diff] [blame] | 512 | // TODO(jamescook): Move to Shelf. |
[email protected] | c758fbf | 2012-03-25 22:53:59 | [diff] [blame] | 513 | void UpdateShelfVisibility(); |
| 514 | |
[email protected] | 88d7112 | 2012-10-18 07:11:01 | [diff] [blame] | 515 | // Returns WebNotificationTray on the primary root window. |
| 516 | WebNotificationTray* GetWebNotificationTray(); |
[email protected] | 6d6546e | 2012-05-30 23:12:02 | [diff] [blame] | 517 | |
[email protected] | a0afeb1 | 2012-12-10 22:57:09 | [diff] [blame] | 518 | // Does the primary display have status area? |
| 519 | bool HasPrimaryStatusArea(); |
| 520 | |
| 521 | // Returns the system tray on primary display. |
| 522 | SystemTray* GetPrimarySystemTray(); |
[email protected] | bfb41131 | 2012-02-27 20:59:27 | [diff] [blame] | 523 | |
[email protected] | f946670 | 2012-09-17 16:35:27 | [diff] [blame] | 524 | // Starts the animation that occurs on first login. |
| 525 | void DoInitialWorkspaceAnimation(); |
| 526 | |
sky | 2734438 | 2017-03-08 21:30:32 | [diff] [blame] | 527 | // NOTE: Prefer ScopedRootWindowForNewWindows when setting temporarily. |
msw | ad3d955 | 2017-05-18 21:23:36 | [diff] [blame] | 528 | void set_root_window_for_new_windows(aura::Window* root) { |
sky | 2734438 | 2017-03-08 21:30:32 | [diff] [blame] | 529 | root_window_for_new_windows_ = root; |
| 530 | } |
| 531 | |
yawano | dc5533b3 | 2017-02-23 11:04:38 | [diff] [blame] | 532 | void SetLargeCursorSizeInDip(int large_cursor_size_in_dip); |
| 533 | |
Weidong Guo | d07448f | 2017-10-18 03:35:18 | [diff] [blame] | 534 | // Updates cursor compositing on/off. Native cursor is disabled when cursor |
[email protected] | 87ec220 | 2014-02-06 06:24:27 | [diff] [blame] | 535 | // compositing is enabled, and vice versa. |
Weidong Guo | d07448f | 2017-10-18 03:35:18 | [diff] [blame] | 536 | void UpdateCursorCompositingEnabled(); |
[email protected] | 87ec220 | 2014-02-06 06:24:27 | [diff] [blame] | 537 | |
Weidong Guo | d07448f | 2017-10-18 03:35:18 | [diff] [blame] | 538 | // Force setting compositing on/off without checking dependency. |
| 539 | void SetCursorCompositingEnabled(bool enabled); |
xdai | d491376 | 2017-07-06 00:17:22 | [diff] [blame] | 540 | |
| 541 | // Returns true if split view mode is active. |
| 542 | bool IsSplitViewModeActive() const; |
| 543 | |
sky | 00c813f | 2017-03-08 22:48:55 | [diff] [blame] | 544 | void AddShellObserver(ShellObserver* observer); |
| 545 | void RemoveShellObserver(ShellObserver* observer); |
| 546 | |
sky | 5ad143a | 2017-03-22 04:31:23 | [diff] [blame] | 547 | // Called when the login status changes. |
| 548 | // TODO(oshima): Investigate if we can merge this and |OnLoginStateChanged|. |
| 549 | void UpdateAfterLoginStatusChange(LoginStatus status); |
| 550 | |
sky | 00c813f | 2017-03-08 22:48:55 | [diff] [blame] | 551 | // Notifies observers that overview mode is about to be started (before the |
| 552 | // windows get re-arranged). |
| 553 | void NotifyOverviewModeStarting(); |
| 554 | |
Xiaoqian Dai | fb4698ed | 2018-02-23 20:11:06 | [diff] [blame] | 555 | // Notifies observers that overview mode is about to end (bofore the windows |
| 556 | // restore themselves). |
| 557 | void NotifyOverviewModeEnding(); |
| 558 | |
sky | 00c813f | 2017-03-08 22:48:55 | [diff] [blame] | 559 | // Notifies observers that overview mode has ended. |
| 560 | void NotifyOverviewModeEnded(); |
| 561 | |
xdai | d491376 | 2017-07-06 00:17:22 | [diff] [blame] | 562 | // Notifies observers that split view mode is about to be started (before the |
| 563 | // window gets snapped and activated). |
| 564 | void NotifySplitViewModeStarting(); |
| 565 | |
Xiaoqian Dai | bf3771f | 2018-03-13 18:21:46 | [diff] [blame] | 566 | // Notifies observers that split view mode has been started. |
| 567 | void NotifySplitViewModeStarted(); |
| 568 | |
xdai | d491376 | 2017-07-06 00:17:22 | [diff] [blame] | 569 | // Notifies observers that split view mode has ended. |
| 570 | void NotifySplitViewModeEnded(); |
| 571 | |
sky | 00c813f | 2017-03-08 22:48:55 | [diff] [blame] | 572 | // Notifies observers that fullscreen mode has changed for |root_window|. |
varkha | c71444e5 | 2017-05-25 22:51:34 | [diff] [blame] | 573 | void NotifyFullscreenStateChanged(bool is_fullscreen, |
| 574 | aura::Window* root_window); |
sky | 00c813f | 2017-03-08 22:48:55 | [diff] [blame] | 575 | |
| 576 | // Notifies observers that |pinned_window| changed its pinned window state. |
varkha | 19d7e6c5 | 2017-05-25 21:15:30 | [diff] [blame] | 577 | void NotifyPinnedStateChanged(aura::Window* pinned_window); |
sky | 00c813f | 2017-03-08 22:48:55 | [diff] [blame] | 578 | |
| 579 | // Notifies observers that the virtual keyboard has been |
xiyuan | 3816018 | 2017-03-14 22:50:13 | [diff] [blame] | 580 | // activated/deactivated for |root_window|. |
sky | 97f9a743 | 2017-05-09 05:14:31 | [diff] [blame] | 581 | void NotifyVirtualKeyboardActivated(bool activated, |
| 582 | aura::Window* root_window); |
sky | 00c813f | 2017-03-08 22:48:55 | [diff] [blame] | 583 | |
| 584 | // Notifies observers that the shelf was created for |root_window|. |
| 585 | // TODO(jamescook): Move to Shelf. |
varkha | 6b016b0f | 2017-05-26 16:14:18 | [diff] [blame] | 586 | void NotifyShelfCreatedForRootWindow(aura::Window* root_window); |
sky | 00c813f | 2017-03-08 22:48:55 | [diff] [blame] | 587 | |
| 588 | // Notifies observers that |root_window|'s shelf changed alignment. |
| 589 | // TODO(jamescook): Move to Shelf. |
varkha | 6b016b0f | 2017-05-26 16:14:18 | [diff] [blame] | 590 | void NotifyShelfAlignmentChanged(aura::Window* root_window); |
sky | 00c813f | 2017-03-08 22:48:55 | [diff] [blame] | 591 | |
| 592 | // Notifies observers that |root_window|'s shelf changed auto-hide behavior. |
| 593 | // TODO(jamescook): Move to Shelf. |
varkha | 6b016b0f | 2017-05-26 16:14:18 | [diff] [blame] | 594 | void NotifyShelfAutoHideBehaviorChanged(aura::Window* root_window); |
sky | 00c813f | 2017-03-08 22:48:55 | [diff] [blame] | 595 | |
jamescook | 518dccbd | 2017-05-18 04:57:07 | [diff] [blame] | 596 | // Used to provide better error messages for Shell::Get() under mash. |
| 597 | static void SetIsBrowserProcessWithMash(); |
| 598 | |
muyuanli | d766f2e | 2017-06-26 20:17:19 | [diff] [blame] | 599 | void NotifyAppListVisibilityChanged(bool visible, aura::Window* root_window); |
| 600 | |
[email protected] | 2b4cd30 | 2012-02-24 20:21:13 | [diff] [blame] | 601 | private: |
[email protected] | c39be8f | 2012-06-15 22:58:36 | [diff] [blame] | 602 | FRIEND_TEST_ALL_PREFIXES(ExtendedDesktopTest, TestCursor); |
[email protected] | 1aad332 | 2012-06-06 06:37:09 | [diff] [blame] | 603 | FRIEND_TEST_ALL_PREFIXES(WindowManagerTest, MouseEventCursors); |
| 604 | FRIEND_TEST_ALL_PREFIXES(WindowManagerTest, TransformActivate); |
sky | 79fa3471 | 2017-03-20 23:46:47 | [diff] [blame] | 605 | friend class AcceleratorControllerTest; |
Sam McNally | a853cd8 | 2017-08-30 01:55:10 | [diff] [blame] | 606 | friend class AshTestHelper; |
[email protected] | 093b8d64 | 2014-04-03 20:59:28 | [diff] [blame] | 607 | friend class RootWindowController; |
sky | 2734438 | 2017-03-08 21:30:32 | [diff] [blame] | 608 | friend class ScopedRootWindowForNewWindows; |
James Cook | 317781a | 2017-07-18 02:08:06 | [diff] [blame] | 609 | friend class ShellTestApi; |
sky | 2734438 | 2017-03-08 21:30:32 | [diff] [blame] | 610 | friend class SmsObserverTest; |
[email protected] | ad0c872 | 2012-03-02 20:17:45 | [diff] [blame] | 611 | |
sky | b073203a | 2017-03-13 16:59:16 | [diff] [blame] | 612 | Shell(std::unique_ptr<ShellDelegate> shell_delegate, |
sky | 11cf8db9 | 2017-04-10 23:38:08 | [diff] [blame] | 613 | std::unique_ptr<ShellPort> shell_port); |
dcheng | 1f4538e | 2014-10-27 23:57:05 | [diff] [blame] | 614 | ~Shell() override; |
[email protected] | 3266c2b9 | 2011-11-14 00:06:08 | [diff] [blame] | 615 | |
Scott Violet | c8a1c6c | 2017-11-29 23:17:36 | [diff] [blame] | 616 | void Init(ui::ContextFactory* context_factory, |
| 617 | ui::ContextFactoryPrivate* context_factory_private); |
[email protected] | b063928 | 2011-12-22 21:12:27 | [diff] [blame] | 618 | |
Steven Bennetts | 7683e34 | 2018-01-02 21:29:52 | [diff] [blame] | 619 | // Initializes the display manager and related components. |
| 620 | void InitializeDisplayManager(); |
| 621 | |
[email protected] | a273d33a | 2013-10-17 12:41:21 | [diff] [blame] | 622 | // Initializes the root window so that it can host browser windows. |
[email protected] | 41baaed | 2013-11-09 04:18:26 | [diff] [blame] | 623 | void InitRootWindow(aura::Window* root_window); |
[email protected] | d90b839 | 2012-06-13 09:34:56 | [diff] [blame] | 624 | |
sky | abcae81 | 2017-01-18 17:01:34 | [diff] [blame] | 625 | // Destroys all child windows including widgets across all roots. |
| 626 | void CloseAllRootWindowChildWindows(); |
| 627 | |
hariank | 0dd03dd | 2016-07-14 23:47:33 | [diff] [blame] | 628 | // SystemModalContainerEventFilterDelegate: |
dcheng | 1f4538e | 2014-10-27 23:57:05 | [diff] [blame] | 629 | bool CanWindowReceiveEvents(aura::Window* window) override; |
[email protected] | c0ce80e | 2012-10-05 23:28:27 | [diff] [blame] | 630 | |
[email protected] | 5097e69 | 2012-10-30 22:08:41 | [diff] [blame] | 631 | // Overridden from ui::EventTarget: |
dcheng | 1f4538e | 2014-10-27 23:57:05 | [diff] [blame] | 632 | bool CanAcceptEvent(const ui::Event& event) override; |
| 633 | EventTarget* GetParentTarget() override; |
dcheng | a9454747 | 2016-04-08 08:41:11 | [diff] [blame] | 634 | std::unique_ptr<ui::EventTargetIterator> GetChildIterator() const override; |
dcheng | 1f4538e | 2014-10-27 23:57:05 | [diff] [blame] | 635 | ui::EventTargeter* GetEventTargeter() override; |
[email protected] | 5097e69 | 2012-10-30 22:08:41 | [diff] [blame] | 636 | |
Thiago Farina | 3b086a0 | 2017-05-30 22:32:50 | [diff] [blame] | 637 | // wm::ActivationChangeObserver: |
sky | 2734438 | 2017-03-08 21:30:32 | [diff] [blame] | 638 | void OnWindowActivated(ActivationReason reason, |
| 639 | aura::Window* gained_active, |
| 640 | aura::Window* lost_active) override; |
| 641 | |
Xiyuan Xia | 22b1a6c | 2017-04-18 22:46:01 | [diff] [blame] | 642 | // SessionObserver: |
Xiyuan Xia | b64fd0a | 2017-04-13 17:53:14 | [diff] [blame] | 643 | void OnSessionStateChanged(session_manager::SessionState state) override; |
| 644 | void OnLoginStatusChanged(LoginStatus login_status) override; |
| 645 | void OnLockStateChanged(bool locked) override; |
sky | 5ad143a | 2017-03-22 04:31:23 | [diff] [blame] | 646 | |
Sam McNally | f4dab61 | 2017-08-16 03:06:33 | [diff] [blame] | 647 | // Callback for prefs::ConnectToPrefService. |
Sam McNally | e36abbc | 2017-07-20 01:04:28 | [diff] [blame] | 648 | void OnLocalStatePrefServiceInitialized( |
| 649 | std::unique_ptr<::PrefService> pref_service); |
tibell | b93c729b | 2017-03-30 00:45:09 | [diff] [blame] | 650 | |
[email protected] | cac10fc6 | 2011-10-07 23:22:56 | [diff] [blame] | 651 | static Shell* instance_; |
| 652 | |
sky | 00f98a37 | 2017-01-11 06:03:49 | [diff] [blame] | 653 | // Only valid in mash, for classic ash this is null. |
| 654 | static aura::WindowTreeClient* window_tree_client_; |
sky | a8b222f | 2017-01-12 15:47:13 | [diff] [blame] | 655 | static aura::WindowManagerClient* window_manager_client_; |
sky | 00f98a37 | 2017-01-11 06:03:49 | [diff] [blame] | 656 | |
sky | 11cf8db9 | 2017-04-10 23:38:08 | [diff] [blame] | 657 | std::unique_ptr<ShellPort> shell_port_; |
sky | 984c189 | 2016-04-20 00:00:34 | [diff] [blame] | 658 | |
[email protected] | 1aad332 | 2012-06-06 06:37:09 | [diff] [blame] | 659 | // The CompoundEventFilter owned by aura::Env object. |
dcheng | a9454747 | 2016-04-08 08:41:11 | [diff] [blame] | 660 | std::unique_ptr<::wm::CompoundEventFilter> env_filter_; |
[email protected] | 627a62f | 2012-02-14 22:59:14 | [diff] [blame] | 661 | |
dcheng | a9454747 | 2016-04-08 08:41:11 | [diff] [blame] | 662 | std::unique_ptr<UserMetricsRecorder> user_metrics_recorder_; |
dcheng | a9454747 | 2016-04-08 08:41:11 | [diff] [blame] | 663 | std::unique_ptr<WindowPositioner> window_positioner_; |
[email protected] | 2b99f8c | 2011-10-11 19:42:24 | [diff] [blame] | 664 | |
sky | 81a2d79 | 2017-03-17 19:14:39 | [diff] [blame] | 665 | std::unique_ptr<AcceleratorController> accelerator_controller_; |
James Cook | ec14495 | 2017-09-01 00:05:16 | [diff] [blame] | 666 | std::unique_ptr<AccessibilityController> accessibility_controller_; |
sky | 07a24d4 | 2017-03-09 23:57:30 | [diff] [blame] | 667 | std::unique_ptr<AccessibilityDelegate> accessibility_delegate_; |
Qiang Xu | a959100 | 2018-03-15 22:29:31 | [diff] [blame] | 668 | std::unique_ptr<AccessibilityFocusRingController> |
| 669 | accessibility_focus_ring_controller_; |
Jiaquan He | 4b48f91 | 2018-03-01 03:59:39 | [diff] [blame] | 670 | std::unique_ptr<AppListControllerImpl> app_list_controller_; |
David Black | e8f81504 | 2018-03-28 18:59:37 | [diff] [blame] | 671 | std::unique_ptr<AshAssistantController> ash_assistant_controller_; |
Scott Violet | d64dac1 | 2017-06-02 21:50:08 | [diff] [blame] | 672 | std::unique_ptr<AshDisplayController> ash_display_controller_; |
Toni Barzic | 9d0c82f4 | 2017-12-06 00:53:52 | [diff] [blame] | 673 | std::unique_ptr<BacklightsForcedOffSetter> backlights_forced_off_setter_; |
sky | 79fa3471 | 2017-03-20 23:46:47 | [diff] [blame] | 674 | std::unique_ptr<BrightnessControlDelegate> brightness_control_delegate_; |
Tetsui Ohkubo | 5e249953 | 2018-04-04 02:01:39 | [diff] [blame] | 675 | std::unique_ptr<CapsLockNotificationController> |
| 676 | caps_lock_notification_controller_; |
sky | 79fa3471 | 2017-03-20 23:46:47 | [diff] [blame] | 677 | std::unique_ptr<CastConfigController> cast_config_; |
Toni Barzic | d623831 | 2018-03-02 18:26:13 | [diff] [blame] | 678 | std::unique_ptr<DetachableBaseHandler> detachable_base_handler_; |
Toni Barzic | 550419f | 2018-03-08 03:56:21 | [diff] [blame] | 679 | std::unique_ptr<DetachableBaseNotificationController> |
| 680 | detachable_base_notification_controller_; |
dcheng | a9454747 | 2016-04-08 08:41:11 | [diff] [blame] | 681 | std::unique_ptr<DragDropController> drag_drop_controller_; |
sky | 79fa3471 | 2017-03-20 23:46:47 | [diff] [blame] | 682 | std::unique_ptr<FocusCycler> focus_cycler_; |
James Cook | f0c78fc | 2017-06-15 14:42:55 | [diff] [blame] | 683 | std::unique_ptr<ImeController> ime_controller_; |
sky | 5ab1647 | 2017-03-21 19:35:08 | [diff] [blame] | 684 | std::unique_ptr<ImmersiveContextAsh> immersive_context_; |
sky | 79fa3471 | 2017-03-20 23:46:47 | [diff] [blame] | 685 | std::unique_ptr<KeyboardBrightnessControlDelegate> |
| 686 | keyboard_brightness_control_delegate_; |
| 687 | std::unique_ptr<KeyboardUI> keyboard_ui_; |
| 688 | std::unique_ptr<LocaleNotificationController> locale_notification_controller_; |
Jacob Dufault | ffd9b0d | 2017-11-15 23:07:16 | [diff] [blame] | 689 | std::unique_ptr<LoginScreenController> login_screen_controller_; |
sky | 79fa3471 | 2017-03-20 23:46:47 | [diff] [blame] | 690 | std::unique_ptr<LogoutConfirmationController> logout_confirmation_controller_; |
Mitsuru Oshima | 0e9b7a6 | 2017-07-19 18:23:03 | [diff] [blame] | 691 | std::unique_ptr<TabletModeController> tablet_mode_controller_; |
sky | 5ab1647 | 2017-03-21 19:35:08 | [diff] [blame] | 692 | std::unique_ptr<MediaController> media_controller_; |
| 693 | std::unique_ptr<MruWindowTracker> mru_window_tracker_; |
| 694 | std::unique_ptr<NewWindowController> new_window_controller_; |
dcheng | a9454747 | 2016-04-08 08:41:11 | [diff] [blame] | 695 | std::unique_ptr<ResizeShadowController> resize_shadow_controller_; |
sky | 5ad143a | 2017-03-22 04:31:23 | [diff] [blame] | 696 | std::unique_ptr<SessionController> session_controller_; |
afakhry | e4fae85 | 2017-05-09 18:49:06 | [diff] [blame] | 697 | std::unique_ptr<NightLightController> night_light_controller_; |
Vladislav Kaznacheev | 92edf62e | 2017-10-13 22:08:01 | [diff] [blame] | 698 | std::unique_ptr<NoteTakingController> note_taking_controller_; |
Tetsui Ohkubo | 3a92f0d9 | 2018-03-30 18:33:29 | [diff] [blame] | 699 | std::unique_ptr<ScreenSecurityNotificationController> |
| 700 | screen_security_notification_controller_; |
sky | 5ad143a | 2017-03-22 04:31:23 | [diff] [blame] | 701 | std::unique_ptr<ShelfController> shelf_controller_; |
sky | 5ad143a | 2017-03-22 04:31:23 | [diff] [blame] | 702 | std::unique_ptr<ShelfWindowWatcher> shelf_window_watcher_; |
sky | b073203a | 2017-03-13 16:59:16 | [diff] [blame] | 703 | std::unique_ptr<ShellDelegate> shell_delegate_; |
sky | 5b45ed8 | 2017-03-27 02:54:23 | [diff] [blame] | 704 | std::unique_ptr<ShutdownController> shutdown_controller_; |
sky | 79fa3471 | 2017-03-20 23:46:47 | [diff] [blame] | 705 | std::unique_ptr<SystemTrayController> system_tray_controller_; |
Tetsui Ohkubo | 2172293 | 2018-03-02 02:56:56 | [diff] [blame] | 706 | std::unique_ptr<SystemTrayModel> system_tray_model_; |
sky | 5b45ed8 | 2017-03-27 02:54:23 | [diff] [blame] | 707 | std::unique_ptr<SystemTrayNotifier> system_tray_notifier_; |
sky | 07a24d4 | 2017-03-09 23:57:30 | [diff] [blame] | 708 | std::unique_ptr<ToastManager> toast_manager_; |
Qiang Xu | f1400a36 | 2017-09-14 02:28:30 | [diff] [blame] | 709 | std::unique_ptr<TouchDevicesController> touch_devices_controller_; |
Scott Violet | 3c554ae | 2017-12-13 02:25:41 | [diff] [blame] | 710 | std::unique_ptr<TimeToFirstPresentRecorder> time_to_first_present_recorder_; |
tbarzic | c78da1ff9 | 2017-05-08 20:46:15 | [diff] [blame] | 711 | std::unique_ptr<TrayAction> tray_action_; |
Yue Li | a33960a | 2017-11-01 22:06:07 | [diff] [blame] | 712 | std::unique_ptr<VoiceInteractionController> voice_interaction_controller_; |
sky | 5b45ed8 | 2017-03-27 02:54:23 | [diff] [blame] | 713 | std::unique_ptr<VpnList> vpn_list_; |
sky | 07a24d4 | 2017-03-09 23:57:30 | [diff] [blame] | 714 | std::unique_ptr<WallpaperController> wallpaper_controller_; |
sky | 5b45ed8 | 2017-03-27 02:54:23 | [diff] [blame] | 715 | std::unique_ptr<WindowCycleController> window_cycle_controller_; |
| 716 | std::unique_ptr<WindowSelectorController> window_selector_controller_; |
dcheng | a9454747 | 2016-04-08 08:41:11 | [diff] [blame] | 717 | std::unique_ptr<::wm::ShadowController> shadow_controller_; |
| 718 | std::unique_ptr<::wm::VisibilityController> visibility_controller_; |
| 719 | std::unique_ptr<::wm::WindowModalityController> window_modality_controller_; |
Sam McNally | a853cd8 | 2017-08-30 01:55:10 | [diff] [blame] | 720 | std::unique_ptr<PrefService> local_state_; |
dcheng | a9454747 | 2016-04-08 08:41:11 | [diff] [blame] | 721 | std::unique_ptr<views::corewm::TooltipController> tooltip_controller_; |
dcheng | a9454747 | 2016-04-08 08:41:11 | [diff] [blame] | 722 | std::unique_ptr<PowerButtonController> power_button_controller_; |
| 723 | std::unique_ptr<LockStateController> lock_state_controller_; |
dcheng | a9454747 | 2016-04-08 08:41:11 | [diff] [blame] | 724 | std::unique_ptr<ui::UserActivityDetector> user_activity_detector_; |
| 725 | std::unique_ptr<VideoDetector> video_detector_; |
dcheng | a9454747 | 2016-04-08 08:41:11 | [diff] [blame] | 726 | std::unique_ptr<WindowTreeHostManager> window_tree_host_manager_; |
Qiang Xu | d77a90c | 2018-02-20 19:43:29 | [diff] [blame] | 727 | std::unique_ptr<PersistentWindowController> persistent_window_controller_; |
dcheng | a9454747 | 2016-04-08 08:41:11 | [diff] [blame] | 728 | std::unique_ptr<HighContrastController> high_contrast_controller_; |
| 729 | std::unique_ptr<MagnificationController> magnification_controller_; |
dcheng | a9454747 | 2016-04-08 08:41:11 | [diff] [blame] | 730 | std::unique_ptr<AutoclickController> autoclick_controller_; |
sky | 2734438 | 2017-03-08 21:30:32 | [diff] [blame] | 731 | std::unique_ptr<::wm::FocusController> focus_controller_; |
sky | 984c189 | 2016-04-20 00:00:34 | [diff] [blame] | 732 | |
oshima | 5a296e8 | 2016-04-29 01:32:27 | [diff] [blame] | 733 | std::unique_ptr<ScreenshotController> screenshot_controller_; |
[email protected] | f5c9dbc | 2014-04-11 08:13:45 | [diff] [blame] | 734 | |
dcheng | a9454747 | 2016-04-08 08:41:11 | [diff] [blame] | 735 | std::unique_ptr<MouseCursorEventFilter> mouse_cursor_filter_; |
| 736 | std::unique_ptr<ScreenPositionController> screen_position_controller_; |
| 737 | std::unique_ptr<SystemModalContainerEventFilter> modality_filter_; |
| 738 | std::unique_ptr<EventClientImpl> event_client_; |
| 739 | std::unique_ptr<EventTransformationHandler> event_transformation_handler_; |
[email protected] | ae18b911 | 2011-11-07 16:59:13 | [diff] [blame] | 740 | |
[email protected] | 0b0b074 | 2012-02-16 13:23:45 | [diff] [blame] | 741 | // An event filter that pre-handles key events while the partial |
[email protected] | a1584a71 | 2012-07-30 21:02:26 | [diff] [blame] | 742 | // screenshot UI or the keyboard overlay is active. |
dcheng | a9454747 | 2016-04-08 08:41:11 | [diff] [blame] | 743 | std::unique_ptr<OverlayEventFilter> overlay_filter_; |
[email protected] | 0b0b074 | 2012-02-16 13:23:45 | [diff] [blame] | 744 | |
[email protected] | 3537d47 | 2014-01-15 05:45:31 | [diff] [blame] | 745 | // An event filter which handles moving and resizing windows. |
dcheng | a9454747 | 2016-04-08 08:41:11 | [diff] [blame] | 746 | std::unique_ptr<ToplevelWindowEventHandler> toplevel_window_event_handler_; |
[email protected] | 3537d47 | 2014-01-15 05:45:31 | [diff] [blame] | 747 | |
[email protected] | 435b212e | 2012-04-05 19:43:37 | [diff] [blame] | 748 | // An event filter which handles system level gestures |
dcheng | a9454747 | 2016-04-08 08:41:11 | [diff] [blame] | 749 | std::unique_ptr<SystemGestureEventFilter> system_gesture_filter_; |
[email protected] | 435b212e | 2012-04-05 19:43:37 | [diff] [blame] | 750 | |
[email protected] | 745816be | 2011-11-22 05:08:30 | [diff] [blame] | 751 | // An event filter that pre-handles global accelerators. |
dcheng | a9454747 | 2016-04-08 08:41:11 | [diff] [blame] | 752 | std::unique_ptr<::wm::AcceleratorFilter> accelerator_filter_; |
[email protected] | 745816be | 2011-11-22 05:08:30 | [diff] [blame] | 753 | |
rjkroege | 72f8154f | 2016-10-29 00:49:02 | [diff] [blame] | 754 | std::unique_ptr<display::DisplayManager> display_manager_; |
dcheng | a9454747 | 2016-04-08 08:41:11 | [diff] [blame] | 755 | std::unique_ptr<DisplayConfigurationController> |
| 756 | display_configuration_controller_; |
[email protected] | 6bdf795 | 2012-11-14 10:10:58 | [diff] [blame] | 757 | |
hidehiko | 6821ca4 | 2016-06-18 11:12:23 | [diff] [blame] | 758 | std::unique_ptr<ScreenPinningController> screen_pinning_controller_; |
[email protected] | a9a4046 | 2013-07-31 06:22:56 | [diff] [blame] | 759 | |
derat | 94887a2 | 2017-01-20 18:17:25 | [diff] [blame] | 760 | // Forwards user activity ui::mojom::UserActivityMonitor to |
| 761 | // |user_activity_detector_|. Only initialized for mash. |
| 762 | std::unique_ptr<aura::UserActivityForwarder> user_activity_forwarder_; |
| 763 | |
Sammie Quon | 95c6a1c | 2017-09-12 19:16:55 | [diff] [blame] | 764 | std::unique_ptr<PeripheralBatteryNotifier> peripheral_battery_notifier_; |
dcheng | a9454747 | 2016-04-08 08:41:11 | [diff] [blame] | 765 | std::unique_ptr<PowerEventObserver> power_event_observer_; |
Qiang Xu | 36234e53 | 2018-04-11 04:54:02 | [diff] [blame^] | 766 | std::unique_ptr<PowerPrefs> power_prefs_; |
dcheng | a9454747 | 2016-04-08 08:41:11 | [diff] [blame] | 767 | std::unique_ptr<ui::UserActivityPowerManagerNotifier> user_activity_notifier_; |
| 768 | std::unique_ptr<VideoActivityNotifier> video_activity_notifier_; |
| 769 | std::unique_ptr<StickyKeysController> sticky_keys_controller_; |
| 770 | std::unique_ptr<ResolutionNotificationController> |
[email protected] | 7bc49bd | 2014-01-22 09:30:34 | [diff] [blame] | 771 | resolution_notification_controller_; |
dcheng | a9454747 | 2016-04-08 08:41:11 | [diff] [blame] | 772 | std::unique_ptr<BluetoothNotificationController> |
[email protected] | b314272 | 2014-03-04 06:59:50 | [diff] [blame] | 773 | bluetooth_notification_controller_; |
Sonny Sasaka | 55f69fc | 2017-08-28 21:29:37 | [diff] [blame] | 774 | std::unique_ptr<BluetoothPowerController> bluetooth_power_controller_; |
jamescook | ac672433 | 2017-03-21 02:54:43 | [diff] [blame] | 775 | std::unique_ptr<TrayBluetoothHelper> tray_bluetooth_helper_; |
dcheng | a9454747 | 2016-04-08 08:41:11 | [diff] [blame] | 776 | std::unique_ptr<VirtualKeyboardController> virtual_keyboard_controller_; |
[email protected] | 70b3e7d5 | 2012-06-02 22:12:25 | [diff] [blame] | 777 | // Controls video output device state. |
kylechar | 7a067ec | 2017-01-07 01:16:28 | [diff] [blame] | 778 | std::unique_ptr<display::DisplayConfigurator> display_configurator_; |
dcheng | a9454747 | 2016-04-08 08:41:11 | [diff] [blame] | 779 | std::unique_ptr<DisplayColorManager> display_color_manager_; |
| 780 | std::unique_ptr<DisplayErrorObserver> display_error_observer_; |
| 781 | std::unique_ptr<ProjectingObserver> projecting_observer_; |
[email protected] | 6bdf795 | 2012-11-14 10:10:58 | [diff] [blame] | 782 | |
[email protected] | c1234a4 | 2013-08-20 09:35:40 | [diff] [blame] | 783 | // Listens for output changes and updates the display manager. |
kylechar | f2e4e41 | 2016-12-04 04:21:35 | [diff] [blame] | 784 | std::unique_ptr<display::DisplayChangeObserver> display_change_observer_; |
[email protected] | 3dff2ef | 2014-02-09 22:50:39 | [diff] [blame] | 785 | |
kylechar | 98748a5 | 2016-12-03 01:33:22 | [diff] [blame] | 786 | // Listens for shutdown and updates DisplayConfigurator. |
Steven Bennetts | 7683e34 | 2018-01-02 21:29:52 | [diff] [blame] | 787 | std::unique_ptr<DisplayShutdownObserver> display_shutdown_observer_; |
kylechar | 98748a5 | 2016-12-03 01:33:22 | [diff] [blame] | 788 | |
yiyix | 90cfee2 | 2017-02-16 05:38:18 | [diff] [blame] | 789 | // Listens for new sms messages and shows notifications. |
| 790 | std::unique_ptr<SmsObserver> sms_observer_; |
| 791 | |
derat | 94887a2 | 2017-01-20 18:17:25 | [diff] [blame] | 792 | // Implements content::ScreenOrientationController for Chrome OS. |
dcheng | a9454747 | 2016-04-08 08:41:11 | [diff] [blame] | 793 | std::unique_ptr<ScreenOrientationController> screen_orientation_controller_; |
yiyix | a68ade51 | 2016-09-01 17:38:13 | [diff] [blame] | 794 | std::unique_ptr<ScreenLayoutObserver> screen_layout_observer_; |
jonross | f21fea1 | 2014-11-13 01:22:51 | [diff] [blame] | 795 | |
kylechar | 55f0eaf2 | 2017-01-11 22:57:37 | [diff] [blame] | 796 | std::unique_ptr<AshTouchTransformController> touch_transformer_controller_; |
dnicoara | 8c3bd1e6 | 2014-10-30 19:53:39 | [diff] [blame] | 797 | |
dcheng | a9454747 | 2016-04-08 08:41:11 | [diff] [blame] | 798 | std::unique_ptr<ui::EventHandler> magnifier_key_scroll_handler_; |
| 799 | std::unique_ptr<ui::EventHandler> speech_feedback_handler_; |
sammiequon | 203ae02 | 2016-09-18 17:23:42 | [diff] [blame] | 800 | std::unique_ptr<LaserPointerController> laser_pointer_controller_; |
| 801 | std::unique_ptr<PartialMagnificationController> |
| 802 | partial_magnification_controller_; |
Vladislav Kaznacheev | 6d6aaff | 2017-07-22 04:06:32 | [diff] [blame] | 803 | std::unique_ptr<HighlighterController> highlighter_controller_; |
[email protected] | 70b3e7d5 | 2012-06-02 22:12:25 | [diff] [blame] | 804 | |
Ahmed Fakhry | 4bf3f74 | 2018-02-06 17:33:36 | [diff] [blame] | 805 | std::unique_ptr<DockedMagnifierController> docked_magnifier_controller_; |
| 806 | |
xdai | d491376 | 2017-07-06 00:17:22 | [diff] [blame] | 807 | // The split view controller for Chrome OS in tablet mode. |
| 808 | std::unique_ptr<SplitViewController> split_view_controller_; |
| 809 | |
[email protected] | c0ff034 | 2013-02-27 00:41:29 | [diff] [blame] | 810 | // |native_cursor_manager_| is owned by |cursor_manager_|, but we keep a |
| 811 | // pointer to vend to test code. |
erg | 36cfb95 | 2017-06-21 19:41:45 | [diff] [blame] | 812 | NativeCursorManagerAsh* native_cursor_manager_; |
[email protected] | e76096a5f | 2014-04-08 04:08:03 | [diff] [blame] | 813 | |
derat | 94887a2 | 2017-01-20 18:17:25 | [diff] [blame] | 814 | // Cursor may be hidden on certain key events in Chrome OS, whereas we never |
sadrul | 7a8785e | 2016-02-12 21:54:35 | [diff] [blame] | 815 | // hide the cursor on Windows. |
dcheng | a9454747 | 2016-04-08 08:41:11 | [diff] [blame] | 816 | std::unique_ptr<::wm::CursorManager> cursor_manager_; |
[email protected] | 4b8003c | 2012-07-26 00:54:19 | [diff] [blame] | 817 | |
[email protected] | 852a55d | 2012-10-17 13:30:30 | [diff] [blame] | 818 | // For testing only: simulate that a modal window is open |
James Cook | 7b7c6a5 | 2018-01-04 23:40:03 | [diff] [blame] | 819 | bool simulate_modal_window_open_for_test_ = false; |
[email protected] | 852a55d | 2012-10-17 13:30:30 | [diff] [blame] | 820 | |
msw | ad3d955 | 2017-05-18 21:23:36 | [diff] [blame] | 821 | // See comment for GetRootWindowForNewWindows(). |
| 822 | aura::Window* root_window_for_new_windows_ = nullptr; |
| 823 | aura::Window* scoped_root_window_for_new_windows_ = nullptr; |
sky | 2734438 | 2017-03-08 21:30:32 | [diff] [blame] | 824 | |
sky | b7b5409 | 2016-08-19 16:00:09 | [diff] [blame] | 825 | std::unique_ptr<ImmersiveHandlerFactoryAsh> immersive_handler_factory_; |
| 826 | |
Evan Stade | 2c43a87b3 | 2017-08-31 17:53:10 | [diff] [blame] | 827 | std::unique_ptr<MessageCenterController> message_center_controller_; |
| 828 | |
sky | 00c813f | 2017-03-08 22:48:55 | [diff] [blame] | 829 | base::ObserverList<ShellObserver> shell_observers_; |
| 830 | |
Sam McNally | e36abbc | 2017-07-20 01:04:28 | [diff] [blame] | 831 | base::WeakPtrFactory<Shell> weak_factory_; |
| 832 | |
[email protected] | 87b0d82e | 2011-10-07 21:02:59 | [diff] [blame] | 833 | DISALLOW_COPY_AND_ASSIGN(Shell); |
| 834 | }; |
| 835 | |
[email protected] | 55f59335 | 2011-12-24 05:42:46 | [diff] [blame] | 836 | } // namespace ash |
[email protected] | 87b0d82e | 2011-10-07 21:02:59 | [diff] [blame] | 837 | |
[email protected] | b65bdda | 2011-12-23 23:35:31 | [diff] [blame] | 838 | #endif // ASH_SHELL_H_ |