[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" |
jamescook | 1b474d6a | 2016-06-04 05:56:00 | [diff] [blame] | 13 | #include "ash/common/shelf/shelf_types.h" |
[email protected] | 5d2ea36 | 2013-12-13 08:10:18 | [diff] [blame] | 14 | #include "ash/metrics/user_metrics_recorder.h" |
[email protected] | e76096a5f | 2014-04-08 04:08:03 | [diff] [blame] | 15 | #include "ash/wm/cursor_manager_chromeos.h" |
[email protected] | c0ce80e | 2012-10-05 23:28:27 | [diff] [blame] | 16 | #include "ash/wm/system_modal_container_event_filter_delegate.h" |
[email protected] | b063928 | 2011-12-22 21:12:27 | [diff] [blame] | 17 | #include "base/gtest_prod_util.h" |
avi | db567a8a | 2015-12-20 17:07:24 | [diff] [blame] | 18 | #include "base/macros.h" |
[email protected] | 6f67df5 | 2013-10-29 01:07:15 | [diff] [blame] | 19 | #include "base/memory/weak_ptr.h" |
[email protected] | 1a2145b | 2012-03-13 21:09:17 | [diff] [blame] | 20 | #include "base/observer_list.h" |
[email protected] | c9390bd | 2013-11-08 20:33:13 | [diff] [blame] | 21 | #include "ui/aura/window.h" |
[email protected] | 940fb1c | 2013-06-18 16:54:28 | [diff] [blame] | 22 | #include "ui/base/ui_base_types.h" |
oshima | f84b0da72 | 2016-04-27 19:47:19 | [diff] [blame] | 23 | #include "ui/display/screen.h" |
[email protected] | 86ccbd4 | 2013-09-18 18:11:54 | [diff] [blame] | 24 | #include "ui/events/event_target.h" |
Avi Drissman | fefc2f8 | 2014-12-22 19:25:29 | [diff] [blame] | 25 | #include "ui/gfx/geometry/insets.h" |
| 26 | #include "ui/gfx/geometry/size.h" |
[email protected] | ee3ed1077 | 2014-03-11 22:02:01 | [diff] [blame] | 27 | #include "ui/wm/core/cursor_manager.h" |
[email protected] | 87b0d82e | 2011-10-07 21:02:59 | [diff] [blame] | 28 | |
| 29 | namespace aura { |
[email protected] | e29014c | 2011-11-16 18:25:51 | [diff] [blame] | 30 | class EventFilter; |
[email protected] | 35304ce | 2011-12-14 23:21:01 | [diff] [blame] | 31 | class RootWindow; |
[email protected] | 87b0d82e | 2011-10-07 21:02:59 | [diff] [blame] | 32 | class Window; |
[email protected] | c2885361 | 2012-05-31 22:43:44 | [diff] [blame] | 33 | namespace client { |
[email protected] | 39718b5 | 2012-12-03 17:24:56 | [diff] [blame] | 34 | class ActivationClient; |
[email protected] | 8cfb672 | 2012-11-28 03:28:46 | [diff] [blame] | 35 | class FocusClient; |
[email protected] | c2885361 | 2012-05-31 22:43:44 | [diff] [blame] | 36 | } |
[email protected] | 87b0d82e | 2011-10-07 21:02:59 | [diff] [blame] | 37 | } |
[email protected] | fa4a4583 | 2012-04-12 21:32:48 | [diff] [blame] | 38 | |
ben | 0d6be2d4 | 2015-09-26 04:37:19 | [diff] [blame] | 39 | namespace base { |
| 40 | class SequencedWorkerPool; |
| 41 | } |
| 42 | |
warx | 533c8f6 | 2016-04-12 01:19:43 | [diff] [blame] | 43 | namespace chromeos { |
| 44 | class AudioA11yController; |
| 45 | } |
| 46 | |
[email protected] | 2b99f8c | 2011-10-11 19:42:24 | [diff] [blame] | 47 | namespace gfx { |
[email protected] | 9ec0f45 | 2012-05-31 15:58:53 | [diff] [blame] | 48 | class ImageSkia; |
[email protected] | b5f3060 | 2012-01-30 15:16:57 | [diff] [blame] | 49 | class Point; |
[email protected] | cac10fc6 | 2011-10-07 23:22:56 | [diff] [blame] | 50 | class Rect; |
| 51 | } |
[email protected] | b6ba05d90 | 2013-10-04 21:38:45 | [diff] [blame] | 52 | |
[email protected] | a8bd1cb | 2012-02-17 23:05:54 | [diff] [blame] | 53 | namespace ui { |
[email protected] | 1e31cbd | 2014-04-07 20:06:11 | [diff] [blame] | 54 | class DisplayConfigurator; |
[email protected] | a8bd1cb | 2012-02-17 23:05:54 | [diff] [blame] | 55 | class Layer; |
derat | 2d4e62d | 2015-01-09 16:09:17 | [diff] [blame] | 56 | class UserActivityDetector; |
[email protected] | b0fa701 | 2014-04-16 12:50:57 | [diff] [blame] | 57 | class UserActivityPowerManagerNotifier; |
[email protected] | a8bd1cb | 2012-02-17 23:05:54 | [diff] [blame] | 58 | } |
[email protected] | 57b8bb35 | 2012-01-11 05:11:46 | [diff] [blame] | 59 | namespace views { |
| 60 | class NonClientFrameView; |
| 61 | class Widget; |
[email protected] | 4a59e4e | 2012-11-12 21:15:40 | [diff] [blame] | 62 | namespace corewm { |
[email protected] | e319c7e | 2014-03-14 19:56:14 | [diff] [blame] | 63 | class TooltipController; |
| 64 | } |
| 65 | } |
| 66 | |
| 67 | namespace wm { |
[email protected] | 60d677d | 2014-05-30 13:07:02 | [diff] [blame] | 68 | class AcceleratorFilter; |
[email protected] | 4a59e4e | 2012-11-12 21:15:40 | [diff] [blame] | 69 | class CompoundEventFilter; |
[email protected] | 86f2b5e | 2012-11-14 20:37:00 | [diff] [blame] | 70 | class ShadowController; |
[email protected] | b5756e2 | 2012-11-30 01:32:02 | [diff] [blame] | 71 | class VisibilityController; |
[email protected] | 0c2dc01 | 2012-12-02 00:00:23 | [diff] [blame] | 72 | class WindowModalityController; |
[email protected] | 4a59e4e | 2012-11-12 21:15:40 | [diff] [blame] | 73 | } |
[email protected] | 87b0d82e | 2011-10-07 21:02:59 | [diff] [blame] | 74 | |
[email protected] | 55f59335 | 2011-12-24 05:42:46 | [diff] [blame] | 75 | namespace ash { |
[email protected] | 87b0d82e | 2011-10-07 21:02:59 | [diff] [blame] | 76 | |
sky | 44a0989 | 2016-07-20 17:46:58 | [diff] [blame] | 77 | class AcceleratorControllerDelegateAura; |
[email protected] | c0ff034 | 2013-02-27 00:41:29 | [diff] [blame] | 78 | class AshNativeCursorManager; |
[email protected] | 55398d2 | 2013-10-10 19:49:20 | [diff] [blame] | 79 | class AutoclickController; |
[email protected] | b314272 | 2014-03-04 06:59:50 | [diff] [blame] | 80 | class BluetoothNotificationController; |
[email protected] | c1234a4 | 2013-08-20 09:35:40 | [diff] [blame] | 81 | class DisplayChangeObserver; |
robert.bradford | ab05249 | 2015-05-06 11:09:56 | [diff] [blame] | 82 | class DisplayColorManager; |
stevenjb | 537c5c3f | 2016-01-20 23:38:12 | [diff] [blame] | 83 | class DisplayConfigurationController; |
[email protected] | 18b21b2e | 2013-03-01 20:56:23 | [diff] [blame] | 84 | class DisplayErrorObserver; |
[email protected] | 6bdf795 | 2012-11-14 10:10:58 | [diff] [blame] | 85 | class DisplayManager; |
[email protected] | 084b6bb | 2011-11-17 05:18:16 | [diff] [blame] | 86 | class DragDropController; |
[email protected] | e67291f1 | 2012-10-10 05:52:38 | [diff] [blame] | 87 | class EventClientImpl; |
[email protected] | b9d224c | 2012-07-13 01:09:03 | [diff] [blame] | 88 | class EventRewriterEventFilter; |
[email protected] | 682990f | 2013-01-10 06:49:11 | [diff] [blame] | 89 | class EventTransformationHandler; |
[email protected] | 093b8d64 | 2014-04-03 20:59:28 | [diff] [blame] | 90 | class FirstRunHelper; |
[email protected] | 093b8d64 | 2014-04-03 20:59:28 | [diff] [blame] | 91 | class GPUSupport; |
| 92 | class HighContrastController; |
sky | b7b5409 | 2016-08-19 16:00:09 | [diff] [blame] | 93 | class ImmersiveHandlerFactoryAsh; |
yusukes | 1168eda | 2016-04-27 07:52:08 | [diff] [blame] | 94 | class LinkHandlerModelFactory; |
[email protected] | a9a4046 | 2013-07-31 06:22:56 | [diff] [blame] | 95 | class LocaleNotificationController; |
[email protected] | 093b8d64 | 2014-04-03 20:59:28 | [diff] [blame] | 96 | class LockStateController; |
msw | b241605 | 2016-06-24 21:23:45 | [diff] [blame] | 97 | enum class LoginStatus; |
[email protected] | 093b8d64 | 2014-04-03 20:59:28 | [diff] [blame] | 98 | class MagnificationController; |
[email protected] | 78d9630 | 2012-06-22 00:58:07 | [diff] [blame] | 99 | class MouseCursorEventFilter; |
[email protected] | 9ae32df | 2012-07-26 03:25:18 | [diff] [blame] | 100 | class OverlayEventFilter; |
[email protected] | 093b8d64 | 2014-04-03 20:59:28 | [diff] [blame] | 101 | class PartialMagnificationController; |
| 102 | class PowerButtonController; |
[email protected] | 5162505 | 2013-10-10 01:40:16 | [diff] [blame] | 103 | class PowerEventObserver; |
[email protected] | 72bce52 | 2014-02-10 21:11:26 | [diff] [blame] | 104 | class ProjectingObserver; |
[email protected] | e4a181cc | 2012-03-17 02:20:57 | [diff] [blame] | 105 | class ResizeShadowController; |
[email protected] | 6ef71d7 | 2013-08-10 18:13:44 | [diff] [blame] | 106 | class ResolutionNotificationController; |
[email protected] | d90b839 | 2012-06-13 09:34:56 | [diff] [blame] | 107 | class RootWindowController; |
sky | 6624a7af | 2016-05-27 18:47:49 | [diff] [blame] | 108 | class ScopedOverviewAnimationSettingsFactoryAura; |
[email protected] | 093b8d64 | 2014-04-03 20:59:28 | [diff] [blame] | 109 | class ScreenAsh; |
jonross | 0af4521 | 2015-01-13 18:55:46 | [diff] [blame] | 110 | class ScreenOrientationController; |
oshima | 5a296e8 | 2016-04-29 01:32:27 | [diff] [blame] | 111 | class ScreenshotController; |
hidehiko | 6821ca4 | 2016-06-18 11:12:23 | [diff] [blame] | 112 | class ScreenPinningController; |
[email protected] | 8d625fb | 2012-07-18 16:40:06 | [diff] [blame] | 113 | class ScreenPositionController; |
[email protected] | 093b8d64 | 2014-04-03 20:59:28 | [diff] [blame] | 114 | class SessionStateDelegate; |
| 115 | class Shelf; |
[email protected] | 093b8d64 | 2014-04-03 20:59:28 | [diff] [blame] | 116 | class ShellDelegate; |
[email protected] | 1b4c747 | 2014-05-15 18:32:23 | [diff] [blame] | 117 | struct ShellInitParams; |
[email protected] | 9861f175 | 2012-06-01 07:16:14 | [diff] [blame] | 118 | class SlowAnimationEventFilter; |
[email protected] | 6d6546e | 2012-05-30 23:12:02 | [diff] [blame] | 119 | class StatusAreaWidget; |
[email protected] | 093b8d64 | 2014-04-03 20:59:28 | [diff] [blame] | 120 | class StickyKeysController; |
xiaoyinh | 06e3125 | 2016-08-25 23:04:03 | [diff] [blame] | 121 | class StylusMetricsRecorder; |
[email protected] | 9ae32df | 2012-07-26 03:25:18 | [diff] [blame] | 122 | class SystemGestureEventFilter; |
[email protected] | c0ce80e | 2012-10-05 23:28:27 | [diff] [blame] | 123 | class SystemModalContainerEventFilter; |
[email protected] | 093b8d64 | 2014-04-03 20:59:28 | [diff] [blame] | 124 | class SystemTray; |
[email protected] | 093b8d64 | 2014-04-03 20:59:28 | [diff] [blame] | 125 | class ToplevelWindowEventHandler; |
[email protected] | 03122891a | 2014-05-13 23:56:49 | [diff] [blame] | 126 | class TouchTransformerController; |
[email protected] | 7307474 | 2012-05-17 01:44:41 | [diff] [blame] | 127 | class TouchObserverHUD; |
bshe | eaae09a | 2014-09-22 23:16:52 | [diff] [blame] | 128 | class VirtualKeyboardController; |
[email protected] | ded58fd | 2013-10-09 07:56:55 | [diff] [blame] | 129 | class VideoActivityNotifier; |
[email protected] | 093b8d64 | 2014-04-03 20:59:28 | [diff] [blame] | 130 | class VideoDetector; |
msw | 607227f8 | 2016-08-30 17:22:39 | [diff] [blame^] | 131 | class WallpaperController; |
[email protected] | 093b8d64 | 2014-04-03 20:59:28 | [diff] [blame] | 132 | class WebNotificationTray; |
[email protected] | 093b8d64 | 2014-04-03 20:59:28 | [diff] [blame] | 133 | class WindowPositioner; |
msw | 607227f8 | 2016-08-30 17:22:39 | [diff] [blame^] | 134 | class WindowTreeHostManager; |
sky | 0702b27 | 2016-06-03 22:10:41 | [diff] [blame] | 135 | class WmShellAura; |
sky | 80556bc4 | 2016-06-07 22:46:13 | [diff] [blame] | 136 | class WmWindow; |
[email protected] | 2b99f8c | 2011-10-11 19:42:24 | [diff] [blame] | 137 | |
[email protected] | 0af5804 | 2012-12-13 03:21:35 | [diff] [blame] | 138 | namespace shell { |
| 139 | class WindowWatcher; |
| 140 | } |
| 141 | |
[email protected] | 0c68e89 | 2012-12-08 16:54:53 | [diff] [blame] | 142 | namespace test { |
| 143 | class ShellTestApi; |
| 144 | } |
| 145 | |
[email protected] | 87b0d82e | 2011-10-07 21:02:59 | [diff] [blame] | 146 | // Shell is a singleton object that presents the Shell API and implements the |
[email protected] | 99f07e0 | 2011-12-07 00:02:59 | [diff] [blame] | 147 | // RootWindow's delegate interface. |
[email protected] | b0079a9 | 2012-01-25 20:13:38 | [diff] [blame] | 148 | // |
| 149 | // Upon creation, the Shell sets itself as the RootWindow's delegate, which |
| 150 | // takes ownership of the Shell. |
[email protected] | 093b8d64 | 2014-04-03 20:59:28 | [diff] [blame] | 151 | class ASH_EXPORT Shell : public SystemModalContainerEventFilterDelegate, |
jamescook | 4545062c | 2016-08-02 18:48:01 | [diff] [blame] | 152 | public ui::EventTarget { |
[email protected] | 87b0d82e | 2011-10-07 21:02:59 | [diff] [blame] | 153 | public: |
[email protected] | 093b8d64 | 2014-04-03 20:59:28 | [diff] [blame] | 154 | typedef std::vector<RootWindowController*> RootWindowControllerList; |
[email protected] | be65be36 | 2012-06-15 07:38:23 | [diff] [blame] | 155 | |
[email protected] | 3266c2b9 | 2011-11-14 00:06:08 | [diff] [blame] | 156 | // A shell must be explicitly created so that it can call |Init()| with the |
| 157 | // delegate set. |delegate| can be NULL (if not required for initialization). |
[email protected] | 09464c7 | 2013-04-26 07:31:28 | [diff] [blame] | 158 | // Takes ownership of |delegate|. |
[email protected] | 1b4c747 | 2014-05-15 18:32:23 | [diff] [blame] | 159 | static Shell* CreateInstance(const ShellInitParams& init_params); |
[email protected] | 3266c2b9 | 2011-11-14 00:06:08 | [diff] [blame] | 160 | |
| 161 | // Should never be called before |CreateInstance()|. |
[email protected] | cac10fc6 | 2011-10-07 23:22:56 | [diff] [blame] | 162 | static Shell* GetInstance(); |
[email protected] | 3266c2b9 | 2011-11-14 00:06:08 | [diff] [blame] | 163 | |
[email protected] | b3b7bcd | 2012-03-06 19:35:45 | [diff] [blame] | 164 | // Returns true if the ash shell has been instantiated. |
| 165 | static bool HasInstance(); |
| 166 | |
[email protected] | ef589af | 2011-12-03 01:07:15 | [diff] [blame] | 167 | static void DeleteInstance(); |
[email protected] | cac10fc6 | 2011-10-07 23:22:56 | [diff] [blame] | 168 | |
[email protected] | d90b839 | 2012-06-13 09:34:56 | [diff] [blame] | 169 | // Returns the root window controller for the primary root window. |
[email protected] | a0afeb1 | 2012-12-10 22:57:09 | [diff] [blame] | 170 | // TODO(oshima): move this to |RootWindowController| |
[email protected] | 093b8d64 | 2014-04-03 20:59:28 | [diff] [blame] | 171 | static RootWindowController* GetPrimaryRootWindowController(); |
[email protected] | d90b839 | 2012-06-13 09:34:56 | [diff] [blame] | 172 | |
[email protected] | cf1c70e | 2012-08-30 01:13:02 | [diff] [blame] | 173 | // Returns all root window controllers. |
[email protected] | a0afeb1 | 2012-12-10 22:57:09 | [diff] [blame] | 174 | // TODO(oshima): move this to |RootWindowController| |
[email protected] | be65be36 | 2012-06-15 07:38:23 | [diff] [blame] | 175 | static RootWindowControllerList GetAllRootWindowControllers(); |
| 176 | |
[email protected] | bf9cdb36 | 2013-10-25 19:22:45 | [diff] [blame] | 177 | // Returns the primary root Window. The primary root Window is the one that |
| 178 | // has a launcher. |
| 179 | static aura::Window* GetPrimaryRootWindow(); |
[email protected] | e73bd780 | 2012-02-17 20:10:34 | [diff] [blame] | 180 | |
[email protected] | bf9cdb36 | 2013-10-25 19:22:45 | [diff] [blame] | 181 | // Returns a root Window when used as a target when creating a new window. |
[email protected] | b42910f | 2013-08-01 11:45:29 | [diff] [blame] | 182 | // The root window of the active window is used in most cases, but can |
jamescook | 4545062c | 2016-08-02 18:48:01 | [diff] [blame] | 183 | // be overridden by using ScopedRootWindowForNewWindows. |
[email protected] | bf9cdb36 | 2013-10-25 19:22:45 | [diff] [blame] | 184 | // If you want to get the root Window of the active window, just use |
[email protected] | b42910f | 2013-08-01 11:45:29 | [diff] [blame] | 185 | // |wm::GetActiveWindow()->GetRootWindow()|. |
[email protected] | bf9cdb36 | 2013-10-25 19:22:45 | [diff] [blame] | 186 | static aura::Window* GetTargetRootWindow(); |
[email protected] | a857dbe | 2012-05-30 22:10:14 | [diff] [blame] | 187 | |
oshima | 06b3960 | 2016-05-11 02:40:10 | [diff] [blame] | 188 | // Returns the id of the display::Display corresponding to the window returned |
mfomitchev | a1a8aa6 | 2016-05-03 16:23:26 | [diff] [blame] | 189 | // by |GetTargetRootWindow()| |
| 190 | static int64_t GetTargetDisplayId(); |
| 191 | |
[email protected] | cf1c70e | 2012-08-30 01:13:02 | [diff] [blame] | 192 | // Returns all root windows. |
[email protected] | c9390bd | 2013-11-08 20:33:13 | [diff] [blame] | 193 | static aura::Window::Windows GetAllRootWindows(); |
[email protected] | be65be36 | 2012-06-15 07:38:23 | [diff] [blame] | 194 | |
[email protected] | bf9cdb36 | 2013-10-25 19:22:45 | [diff] [blame] | 195 | static aura::Window* GetContainer(aura::Window* root_window, |
[email protected] | 7b0f750 | 2012-06-11 00:12:39 | [diff] [blame] | 196 | int container_id); |
[email protected] | bf9cdb36 | 2013-10-25 19:22:45 | [diff] [blame] | 197 | static const aura::Window* GetContainer(const aura::Window* root_window, |
[email protected] | e67291f1 | 2012-10-10 05:52:38 | [diff] [blame] | 198 | int container_id); |
[email protected] | 7b0f750 | 2012-06-11 00:12:39 | [diff] [blame] | 199 | |
| 200 | // Returns the list of containers that match |container_id| in |
[email protected] | 429433f | 2012-12-28 20:14:46 | [diff] [blame] | 201 | // all root windows. If |priority_root| is given, the container |
| 202 | // in the |priority_root| will be inserted at the top of the list. |
| 203 | static std::vector<aura::Window*> GetContainersFromAllRootWindows( |
| 204 | int container_id, |
[email protected] | bf9cdb36 | 2013-10-25 19:22:45 | [diff] [blame] | 205 | aura::Window* priority_root); |
[email protected] | 7b0f750 | 2012-06-11 00:12:39 | [diff] [blame] | 206 | |
msw | 607227f8 | 2016-08-30 17:22:39 | [diff] [blame^] | 207 | // Shows the context menu for the wallpaper and shelf at the screen location. |
[email protected] | 940fb1c | 2013-06-18 16:54:28 | [diff] [blame] | 208 | void ShowContextMenu(const gfx::Point& location_in_screen, |
| 209 | ui::MenuSourceType source_type); |
[email protected] | cac10fc6 | 2011-10-07 23:22:56 | [diff] [blame] | 210 | |
[email protected] | 57b8bb35 | 2012-01-11 05:11:46 | [diff] [blame] | 211 | // Creates a default views::NonClientFrameView for use by windows in the |
| 212 | // Ash environment. |
| 213 | views::NonClientFrameView* CreateDefaultNonClientFrameView( |
| 214 | views::Widget* widget); |
| 215 | |
msw | ad28b25 | 2016-08-09 02:42:07 | [diff] [blame] | 216 | // Sets work area insets of the display containing |window|, pings observers. |
[email protected] | 2e236a5 | 2012-06-27 22:21:47 | [diff] [blame] | 217 | void SetDisplayWorkAreaInsets(aura::Window* window, |
[email protected] | 8a45c97 | 2012-03-14 18:22:44 | [diff] [blame] | 218 | const gfx::Insets& insets); |
[email protected] | 1a2145b | 2012-03-13 21:09:17 | [diff] [blame] | 219 | |
[email protected] | 82d3954ae | 2012-04-20 09:02:22 | [diff] [blame] | 220 | // Called when the user logs in. |
sky | e79274a | 2016-06-08 05:39:02 | [diff] [blame] | 221 | void OnLoginStateChanged(LoginStatus status); |
[email protected] | 82d3954ae | 2012-04-20 09:02:22 | [diff] [blame] | 222 | |
[email protected] | 51f43811 | 2013-11-18 19:32:50 | [diff] [blame] | 223 | // Called after the logged-in user's profile is ready. |
| 224 | void OnLoginUserProfilePrepared(); |
| 225 | |
[email protected] | 88d7112 | 2012-10-18 07:11:01 | [diff] [blame] | 226 | // Called when the login status changes. |
| 227 | // TODO(oshima): Investigate if we can merge this and |OnLoginStateChanged|. |
sky | e79274a | 2016-06-08 05:39:02 | [diff] [blame] | 228 | void UpdateAfterLoginStatusChange(LoginStatus status); |
[email protected] | 88d7112 | 2012-10-18 07:11:01 | [diff] [blame] | 229 | |
[email protected] | 82d3954ae | 2012-04-20 09:02:22 | [diff] [blame] | 230 | // Called when the application is exiting. |
| 231 | void OnAppTerminating(); |
| 232 | |
| 233 | // Called when the screen is locked (after the lock window is visible) or |
| 234 | // unlocked. |
| 235 | void OnLockStateChanged(bool locked); |
| 236 | |
[email protected] | 58868abf | 2014-01-17 23:45:33 | [diff] [blame] | 237 | // Called when a casting session is started or stopped. |
| 238 | void OnCastingSessionStartedOrStopped(bool started); |
| 239 | |
[email protected] | 0e3e7cb | 2014-04-12 05:18:25 | [diff] [blame] | 240 | // Called when a root window is created. |
sky | 80556bc4 | 2016-06-07 22:46:13 | [diff] [blame] | 241 | void OnRootWindowAdded(WmWindow* root_window); |
[email protected] | 0e3e7cb | 2014-04-12 05:18:25 | [diff] [blame] | 242 | |
[email protected] | 864b5855 | 2013-12-19 04:19:38 | [diff] [blame] | 243 | // Initializes |shelf_|. Does nothing if it's already initialized. |
| 244 | void CreateShelf(); |
[email protected] | d9456cb | 2012-03-21 16:41:04 | [diff] [blame] | 245 | |
[email protected] | e1b299b | 2014-01-29 23:53:41 | [diff] [blame] | 246 | // Creates a virtual keyboard. Deletes the old virtual keyboard if it already |
| 247 | // exists. |
[email protected] | 51f43811 | 2013-11-18 19:32:50 | [diff] [blame] | 248 | void CreateKeyboard(); |
| 249 | |
[email protected] | e1b299b | 2014-01-29 23:53:41 | [diff] [blame] | 250 | // Deactivates the virtual keyboard. |
| 251 | void DeactivateKeyboard(); |
| 252 | |
[email protected] | 99c5ed8 | 2013-10-18 01:30:04 | [diff] [blame] | 253 | // Show shelf view if it was created hidden (before session has started). |
[email protected] | 864b5855 | 2013-12-19 04:19:38 | [diff] [blame] | 254 | void ShowShelf(); |
[email protected] | 7e1df2f6 | 2012-07-19 19:17:18 | [diff] [blame] | 255 | |
[email protected] | da28585 | 2014-05-27 19:53:43 | [diff] [blame] | 256 | #if defined(OS_CHROMEOS) |
| 257 | // Test if MaximizeModeWindowManager is not enabled, and if |
| 258 | // MaximizeModeController is not currently setting a display rotation. Or if |
| 259 | // the |resolution_notification_controller_| is not showing its confirmation |
| 260 | // dialog. If true then changes to display settings can be saved. |
| 261 | bool ShouldSaveDisplaySettings(); |
| 262 | #endif |
| 263 | |
sky | 44a0989 | 2016-07-20 17:46:58 | [diff] [blame] | 264 | AcceleratorControllerDelegateAura* accelerator_controller_delegate() { |
| 265 | return accelerator_controller_delegate_.get(); |
| 266 | } |
[email protected] | 6e9f6aa | 2012-02-09 04:16:20 | [diff] [blame] | 267 | |
[email protected] | 093b8d64 | 2014-04-03 20:59:28 | [diff] [blame] | 268 | DisplayManager* display_manager() { return display_manager_.get(); } |
stevenjb | 537c5c3f | 2016-01-20 23:38:12 | [diff] [blame] | 269 | DisplayConfigurationController* display_configuration_controller() { |
| 270 | return display_configuration_controller_.get(); |
| 271 | } |
jamescook | b8dcef52 | 2016-06-25 14:42:55 | [diff] [blame] | 272 | ::wm::CompoundEventFilter* env_filter() { return env_filter_.get(); } |
[email protected] | a1b7a82 | 2013-02-23 19:08:04 | [diff] [blame] | 273 | views::corewm::TooltipController* tooltip_controller() { |
[email protected] | 862deef | 2011-12-15 22:07:33 | [diff] [blame] | 274 | return tooltip_controller_.get(); |
[email protected] | 4a229e90 | 2011-12-01 21:21:11 | [diff] [blame] | 275 | } |
[email protected] | 093b8d64 | 2014-04-03 20:59:28 | [diff] [blame] | 276 | OverlayEventFilter* overlay_filter() { return overlay_filter_.get(); } |
msw | 607227f8 | 2016-08-30 17:22:39 | [diff] [blame^] | 277 | WallpaperController* wallpaper_controller() { |
| 278 | return wallpaper_controller_.get(); |
[email protected] | e70cf0ed | 2012-03-15 16:24:47 | [diff] [blame] | 279 | } |
yusukes | 1168eda | 2016-04-27 07:52:08 | [diff] [blame] | 280 | LinkHandlerModelFactory* link_handler_model_factory() { |
| 281 | return link_handler_model_factory_; |
| 282 | } |
| 283 | void set_link_handler_model_factory( |
| 284 | LinkHandlerModelFactory* link_handler_model_factory) { |
| 285 | link_handler_model_factory_ = link_handler_model_factory; |
| 286 | } |
[email protected] | e0d22e8 | 2012-01-04 00:46:57 | [diff] [blame] | 287 | PowerButtonController* power_button_controller() { |
| 288 | return power_button_controller_.get(); |
| 289 | } |
[email protected] | ab4f8c9 | 2013-05-30 19:07:47 | [diff] [blame] | 290 | LockStateController* lock_state_controller() { |
| 291 | return lock_state_controller_.get(); |
[email protected] | 222f40c | 2012-10-18 08:58:13 | [diff] [blame] | 292 | } |
jamescook | b8dcef52 | 2016-06-25 14:42:55 | [diff] [blame] | 293 | VideoDetector* video_detector() { return video_detector_.get(); } |
oshima | e281892 | 2015-07-28 01:18:52 | [diff] [blame] | 294 | WindowTreeHostManager* window_tree_host_manager() { |
| 295 | return window_tree_host_manager_.get(); |
[email protected] | 3e1cdd31 | 2012-06-07 03:48:41 | [diff] [blame] | 296 | } |
dnicoara | 8c3bd1e6 | 2014-10-30 19:53:39 | [diff] [blame] | 297 | #if defined(OS_CHROMEOS) |
chirantan | 40e4cd8 | 2015-02-19 01:08:19 | [diff] [blame] | 298 | PowerEventObserver* power_event_observer() { |
| 299 | return power_event_observer_.get(); |
| 300 | } |
[email protected] | 03122891a | 2014-05-13 23:56:49 | [diff] [blame] | 301 | TouchTransformerController* touch_transformer_controller() { |
| 302 | return touch_transformer_controller_.get(); |
| 303 | } |
dnicoara | 8c3bd1e6 | 2014-10-30 19:53:39 | [diff] [blame] | 304 | #endif // defined(OS_CHROMEOS) |
oshima | 5a296e8 | 2016-04-29 01:32:27 | [diff] [blame] | 305 | ScreenshotController* screenshot_controller() { |
| 306 | return screenshot_controller_.get(); |
mukai | 19274bdd | 2015-02-24 22:37:48 | [diff] [blame] | 307 | } |
[email protected] | 093b8d64 | 2014-04-03 20:59:28 | [diff] [blame] | 308 | MouseCursorEventFilter* mouse_cursor_filter() { |
[email protected] | 8b7ba87b | 2012-09-01 00:40:40 | [diff] [blame] | 309 | return mouse_cursor_filter_.get(); |
| 310 | } |
[email protected] | 093b8d64 | 2014-04-03 20:59:28 | [diff] [blame] | 311 | EventTransformationHandler* event_transformation_handler() { |
[email protected] | 682990f | 2013-01-10 06:49:11 | [diff] [blame] | 312 | return event_transformation_handler_.get(); |
| 313 | } |
sadrul | 7a8785e | 2016-02-12 21:54:35 | [diff] [blame] | 314 | ::wm::CursorManager* cursor_manager() { return cursor_manager_.get(); } |
[email protected] | 4a229e90 | 2011-12-01 21:21:11 | [diff] [blame] | 315 | |
[email protected] | fcb123d | 2013-04-17 15:58:49 | [diff] [blame] | 316 | SessionStateDelegate* session_state_delegate() { |
| 317 | return session_state_delegate_.get(); |
| 318 | } |
| 319 | |
[email protected] | f48075d | 2012-05-24 11:06:51 | [diff] [blame] | 320 | HighContrastController* high_contrast_controller() { |
| 321 | return high_contrast_controller_.get(); |
| 322 | } |
| 323 | |
[email protected] | 77f7c13 | 2012-11-15 06:52:54 | [diff] [blame] | 324 | MagnificationController* magnification_controller() { |
[email protected] | c1c67017 | 2012-04-26 04:20:26 | [diff] [blame] | 325 | return magnification_controller_.get(); |
| 326 | } |
[email protected] | f48075d | 2012-05-24 11:06:51 | [diff] [blame] | 327 | |
[email protected] | 77f7c13 | 2012-11-15 06:52:54 | [diff] [blame] | 328 | PartialMagnificationController* partial_magnification_controller() { |
| 329 | return partial_magnification_controller_.get(); |
| 330 | } |
[email protected] | 55398d2 | 2013-10-10 19:49:20 | [diff] [blame] | 331 | |
| 332 | AutoclickController* autoclick_controller() { |
| 333 | return autoclick_controller_.get(); |
| 334 | } |
| 335 | |
[email protected] | d219a19 | 2012-12-14 00:08:18 | [diff] [blame] | 336 | aura::client::ActivationClient* activation_client() { |
| 337 | return activation_client_; |
| 338 | } |
[email protected] | 77f7c13 | 2012-11-15 06:52:54 | [diff] [blame] | 339 | |
jamescook | b8dcef52 | 2016-06-25 14:42:55 | [diff] [blame] | 340 | base::SequencedWorkerPool* blocking_pool() { return blocking_pool_; } |
ben | 0d6be2d4 | 2015-09-26 04:37:19 | [diff] [blame] | 341 | |
[email protected] | c758fbf | 2012-03-25 22:53:59 | [diff] [blame] | 342 | // Force the shelf to query for it's current visibility state. |
jamescook | 6afad6d | 2016-06-01 00:35:01 | [diff] [blame] | 343 | // TODO(jamescook): Move to Shelf. |
[email protected] | c758fbf | 2012-03-25 22:53:59 | [diff] [blame] | 344 | void UpdateShelfVisibility(); |
| 345 | |
[email protected] | 090c4f1 | 2012-10-29 18:56:42 | [diff] [blame] | 346 | // Creates a modal background (a partially-opaque fullscreen window) |
| 347 | // on all displays for |window|. |
| 348 | void CreateModalBackground(aura::Window* window); |
[email protected] | c0ce80e | 2012-10-05 23:28:27 | [diff] [blame] | 349 | |
| 350 | // Called when a modal window is removed. It will activate |
| 351 | // another modal window if any, or remove modal screens |
| 352 | // on all displays. |
| 353 | void OnModalWindowRemoved(aura::Window* removed); |
| 354 | |
[email protected] | 88d7112 | 2012-10-18 07:11:01 | [diff] [blame] | 355 | // Returns WebNotificationTray on the primary root window. |
| 356 | WebNotificationTray* GetWebNotificationTray(); |
[email protected] | 6d6546e | 2012-05-30 23:12:02 | [diff] [blame] | 357 | |
[email protected] | a0afeb1 | 2012-12-10 22:57:09 | [diff] [blame] | 358 | // Does the primary display have status area? |
| 359 | bool HasPrimaryStatusArea(); |
| 360 | |
| 361 | // Returns the system tray on primary display. |
| 362 | SystemTray* GetPrimarySystemTray(); |
[email protected] | bfb41131 | 2012-02-27 20:59:27 | [diff] [blame] | 363 | |
[email protected] | 9488d4d | 2012-02-29 18:32:37 | [diff] [blame] | 364 | static void set_initially_hide_cursor(bool hide) { |
| 365 | initially_hide_cursor_ = hide; |
| 366 | } |
| 367 | |
[email protected] | 093b8d64 | 2014-04-03 20:59:28 | [diff] [blame] | 368 | ResizeShadowController* resize_shadow_controller() { |
[email protected] | e4a181cc | 2012-03-17 02:20:57 | [diff] [blame] | 369 | return resize_shadow_controller_.get(); |
| 370 | } |
| 371 | |
[email protected] | a54e65b | 2011-11-21 22:03:34 | [diff] [blame] | 372 | // Made available for tests. |
[email protected] | e319c7e | 2014-03-14 19:56:14 | [diff] [blame] | 373 | ::wm::ShadowController* shadow_controller() { |
[email protected] | a54e65b | 2011-11-21 22:03:34 | [diff] [blame] | 374 | return shadow_controller_.get(); |
| 375 | } |
| 376 | |
[email protected] | f946670 | 2012-09-17 16:35:27 | [diff] [blame] | 377 | // Starts the animation that occurs on first login. |
| 378 | void DoInitialWorkspaceAnimation(); |
| 379 | |
[email protected] | 7bc49bd | 2014-01-22 09:30:34 | [diff] [blame] | 380 | #if defined(OS_CHROMEOS) |
oshima | e281892 | 2015-07-28 01:18:52 | [diff] [blame] | 381 | // TODO(oshima): Move these objects to WindowTreeHostManager. |
[email protected] | 1e31cbd | 2014-04-07 20:06:11 | [diff] [blame] | 382 | ui::DisplayConfigurator* display_configurator() { |
| 383 | return display_configurator_.get(); |
[email protected] | 70b3e7d5 | 2012-06-02 22:12:25 | [diff] [blame] | 384 | } |
[email protected] | 093b8d64 | 2014-04-03 20:59:28 | [diff] [blame] | 385 | DisplayErrorObserver* display_error_observer() { |
[email protected] | 18b21b2e | 2013-03-01 20:56:23 | [diff] [blame] | 386 | return display_error_observer_.get(); |
| 387 | } |
[email protected] | 70b3e7d5 | 2012-06-02 22:12:25 | [diff] [blame] | 388 | |
[email protected] | 093b8d64 | 2014-04-03 20:59:28 | [diff] [blame] | 389 | ResolutionNotificationController* resolution_notification_controller() { |
[email protected] | 6ef71d7 | 2013-08-10 18:13:44 | [diff] [blame] | 390 | return resolution_notification_controller_.get(); |
| 391 | } |
[email protected] | 0dc8551 | 2014-03-13 13:26:41 | [diff] [blame] | 392 | |
jonross | 0af4521 | 2015-01-13 18:55:46 | [diff] [blame] | 393 | ScreenOrientationController* screen_orientation_controller() { |
| 394 | return screen_orientation_controller_.get(); |
jonross | f21fea1 | 2014-11-13 01:22:51 | [diff] [blame] | 395 | } |
| 396 | |
rsadam | c727b6a | 2014-10-31 18:59:33 | [diff] [blame] | 397 | VirtualKeyboardController* virtual_keyboard_controller() { |
| 398 | return virtual_keyboard_controller_.get(); |
| 399 | } |
warx | 533c8f6 | 2016-04-12 01:19:43 | [diff] [blame] | 400 | |
| 401 | chromeos::AudioA11yController* audio_a11y_controller() { |
| 402 | return audio_a11y_controller_.get(); |
| 403 | } |
[email protected] | 7bc49bd | 2014-01-22 09:30:34 | [diff] [blame] | 404 | #endif // defined(OS_CHROMEOS) |
[email protected] | 6ef71d7 | 2013-08-10 18:13:44 | [diff] [blame] | 405 | |
jamescook | b8dcef52 | 2016-06-25 14:42:55 | [diff] [blame] | 406 | WindowPositioner* window_positioner() { return window_positioner_.get(); } |
[email protected] | e9a7131 | 2013-10-04 03:20:01 | [diff] [blame] | 407 | |
jamescook | b8dcef52 | 2016-06-25 14:42:55 | [diff] [blame] | 408 | UserMetricsRecorder* metrics() { return user_metrics_recorder_.get(); } |
[email protected] | 5d2ea36 | 2013-12-13 08:10:18 | [diff] [blame] | 409 | |
[email protected] | 2b8a9bb | 2013-07-01 22:43:40 | [diff] [blame] | 410 | void SetTouchHudProjectionEnabled(bool enabled); |
| 411 | |
| 412 | bool is_touch_hud_projection_enabled() const { |
| 413 | return is_touch_hud_projection_enabled_; |
| 414 | } |
| 415 | |
sky | e782a26 | 2016-05-31 20:28:57 | [diff] [blame] | 416 | // TODO(sky): remove this. This was needed by sysui, but as sysui is going |
| 417 | // away it should no longer be needed. |
sky | fee520c | 2016-02-11 19:57:46 | [diff] [blame] | 418 | bool in_mus() const { return in_mus_; } |
| 419 | |
[email protected] | 59ccade | 2013-10-17 17:56:40 | [diff] [blame] | 420 | #if defined(OS_CHROMEOS) |
| 421 | // Creates instance of FirstRunHelper. Caller is responsible for deleting |
| 422 | // returned object. |
| 423 | ash::FirstRunHelper* CreateFirstRunHelper(); |
[email protected] | f94c6aa | 2013-11-08 01:18:54 | [diff] [blame] | 424 | |
[email protected] | 87ec220 | 2014-02-06 06:24:27 | [diff] [blame] | 425 | // Toggles cursor compositing on/off. Native cursor is disabled when cursor |
| 426 | // compositing is enabled, and vice versa. |
| 427 | void SetCursorCompositingEnabled(bool enabled); |
| 428 | |
[email protected] | 08bdabed | 2013-12-20 07:52:28 | [diff] [blame] | 429 | StickyKeysController* sticky_keys_controller() { |
| 430 | return sticky_keys_controller_.get(); |
[email protected] | f94c6aa | 2013-11-08 01:18:54 | [diff] [blame] | 431 | } |
hidehiko | 6821ca4 | 2016-06-18 11:12:23 | [diff] [blame] | 432 | |
[email protected] | 59ccade | 2013-10-17 17:56:40 | [diff] [blame] | 433 | #endif // defined(OS_CHROMEOS) |
| 434 | |
hidehiko | 6821ca4 | 2016-06-18 11:12:23 | [diff] [blame] | 435 | ScreenPinningController* screen_pinning_controller() { |
| 436 | return screen_pinning_controller_.get(); |
| 437 | } |
| 438 | |
[email protected] | 1d2a721 | 2014-01-16 06:09:48 | [diff] [blame] | 439 | GPUSupport* gpu_support() { return gpu_support_.get(); } |
[email protected] | 1d2a721 | 2014-01-16 06:09:48 | [diff] [blame] | 440 | |
[email protected] | 2b4cd30 | 2012-02-24 20:21:13 | [diff] [blame] | 441 | private: |
[email protected] | c39be8f | 2012-06-15 22:58:36 | [diff] [blame] | 442 | FRIEND_TEST_ALL_PREFIXES(ExtendedDesktopTest, TestCursor); |
[email protected] | 1aad332 | 2012-06-06 06:37:09 | [diff] [blame] | 443 | FRIEND_TEST_ALL_PREFIXES(WindowManagerTest, MouseEventCursors); |
| 444 | FRIEND_TEST_ALL_PREFIXES(WindowManagerTest, TransformActivate); |
[email protected] | 093b8d64 | 2014-04-03 20:59:28 | [diff] [blame] | 445 | friend class RootWindowController; |
[email protected] | 0c68e89 | 2012-12-08 16:54:53 | [diff] [blame] | 446 | friend class test::ShellTestApi; |
[email protected] | 0af5804 | 2012-12-13 03:21:35 | [diff] [blame] | 447 | friend class shell::WindowWatcher; |
[email protected] | ad0c872 | 2012-03-02 20:17:45 | [diff] [blame] | 448 | |
[email protected] | cac10fc6 | 2011-10-07 23:22:56 | [diff] [blame] | 449 | typedef std::pair<aura::Window*, gfx::Rect> WindowAndBoundsPair; |
| 450 | |
[email protected] | 09464c7 | 2013-04-26 07:31:28 | [diff] [blame] | 451 | // Takes ownership of |delegate|. |
ben | 0d6be2d4 | 2015-09-26 04:37:19 | [diff] [blame] | 452 | Shell(ShellDelegate* delegate, base::SequencedWorkerPool* blocking_pool); |
dcheng | 1f4538e | 2014-10-27 23:57:05 | [diff] [blame] | 453 | ~Shell() override; |
[email protected] | 3266c2b9 | 2011-11-14 00:06:08 | [diff] [blame] | 454 | |
[email protected] | 1b4c747 | 2014-05-15 18:32:23 | [diff] [blame] | 455 | void Init(const ShellInitParams& init_params); |
[email protected] | b063928 | 2011-12-22 21:12:27 | [diff] [blame] | 456 | |
[email protected] | 51f43811 | 2013-11-18 19:32:50 | [diff] [blame] | 457 | // Initializes virtual keyboard controller. |
| 458 | void InitKeyboard(); |
[email protected] | b6ba05d90 | 2013-10-04 21:38:45 | [diff] [blame] | 459 | |
[email protected] | a273d33a | 2013-10-17 12:41:21 | [diff] [blame] | 460 | // Initializes the root window so that it can host browser windows. |
[email protected] | 41baaed | 2013-11-09 04:18:26 | [diff] [blame] | 461 | void InitRootWindow(aura::Window* root_window); |
[email protected] | d90b839 | 2012-06-13 09:34:56 | [diff] [blame] | 462 | |
jamescook | f17ee24 | 2016-05-25 21:22:00 | [diff] [blame] | 463 | // Prepares the shelf to be deleted. |
| 464 | void ShutdownShelf(); |
jdufault | 551152e | 2016-01-27 19:48:43 | [diff] [blame] | 465 | |
hariank | 0dd03dd | 2016-07-14 23:47:33 | [diff] [blame] | 466 | // SystemModalContainerEventFilterDelegate: |
dcheng | 1f4538e | 2014-10-27 23:57:05 | [diff] [blame] | 467 | bool CanWindowReceiveEvents(aura::Window* window) override; |
[email protected] | c0ce80e | 2012-10-05 23:28:27 | [diff] [blame] | 468 | |
[email protected] | 5097e69 | 2012-10-30 22:08:41 | [diff] [blame] | 469 | // Overridden from ui::EventTarget: |
dcheng | 1f4538e | 2014-10-27 23:57:05 | [diff] [blame] | 470 | bool CanAcceptEvent(const ui::Event& event) override; |
| 471 | EventTarget* GetParentTarget() override; |
dcheng | a9454747 | 2016-04-08 08:41:11 | [diff] [blame] | 472 | std::unique_ptr<ui::EventTargetIterator> GetChildIterator() const override; |
dcheng | 1f4538e | 2014-10-27 23:57:05 | [diff] [blame] | 473 | ui::EventTargeter* GetEventTargeter() override; |
[email protected] | 5097e69 | 2012-10-30 22:08:41 | [diff] [blame] | 474 | |
[email protected] | cac10fc6 | 2011-10-07 23:22:56 | [diff] [blame] | 475 | static Shell* instance_; |
| 476 | |
[email protected] | 9488d4d | 2012-02-29 18:32:37 | [diff] [blame] | 477 | // If set before the Shell is initialized, the mouse cursor will be hidden |
| 478 | // when the screen is initially created. |
| 479 | static bool initially_hide_cursor_; |
| 480 | |
sky | 6624a7af | 2016-05-27 18:47:49 | [diff] [blame] | 481 | std::unique_ptr<ScopedOverviewAnimationSettingsFactoryAura> |
| 482 | scoped_overview_animation_settings_factory_; |
sky | 0702b27 | 2016-06-03 22:10:41 | [diff] [blame] | 483 | std::unique_ptr<WmShellAura> wm_shell_; |
sky | 984c189 | 2016-04-20 00:00:34 | [diff] [blame] | 484 | |
[email protected] | 1aad332 | 2012-06-06 06:37:09 | [diff] [blame] | 485 | // The CompoundEventFilter owned by aura::Env object. |
dcheng | a9454747 | 2016-04-08 08:41:11 | [diff] [blame] | 486 | std::unique_ptr<::wm::CompoundEventFilter> env_filter_; |
[email protected] | 627a62f | 2012-02-14 22:59:14 | [diff] [blame] | 487 | |
[email protected] | cac10fc6 | 2011-10-07 23:22:56 | [diff] [blame] | 488 | std::vector<WindowAndBoundsPair> to_restore_; |
| 489 | |
dcheng | a9454747 | 2016-04-08 08:41:11 | [diff] [blame] | 490 | std::unique_ptr<UserMetricsRecorder> user_metrics_recorder_; |
sky | 44a0989 | 2016-07-20 17:46:58 | [diff] [blame] | 491 | std::unique_ptr<AcceleratorControllerDelegateAura> |
| 492 | accelerator_controller_delegate_; |
dcheng | a9454747 | 2016-04-08 08:41:11 | [diff] [blame] | 493 | std::unique_ptr<SessionStateDelegate> session_state_delegate_; |
dcheng | a9454747 | 2016-04-08 08:41:11 | [diff] [blame] | 494 | std::unique_ptr<WindowPositioner> window_positioner_; |
[email protected] | 2b99f8c | 2011-10-11 19:42:24 | [diff] [blame] | 495 | |
dcheng | a9454747 | 2016-04-08 08:41:11 | [diff] [blame] | 496 | std::unique_ptr<DragDropController> drag_drop_controller_; |
| 497 | std::unique_ptr<ResizeShadowController> resize_shadow_controller_; |
| 498 | std::unique_ptr<::wm::ShadowController> shadow_controller_; |
| 499 | std::unique_ptr<::wm::VisibilityController> visibility_controller_; |
| 500 | std::unique_ptr<::wm::WindowModalityController> window_modality_controller_; |
| 501 | std::unique_ptr<views::corewm::TooltipController> tooltip_controller_; |
msw | 607227f8 | 2016-08-30 17:22:39 | [diff] [blame^] | 502 | std::unique_ptr<WallpaperController> wallpaper_controller_; |
yusukes | 1168eda | 2016-04-27 07:52:08 | [diff] [blame] | 503 | LinkHandlerModelFactory* link_handler_model_factory_; |
dcheng | a9454747 | 2016-04-08 08:41:11 | [diff] [blame] | 504 | std::unique_ptr<PowerButtonController> power_button_controller_; |
| 505 | std::unique_ptr<LockStateController> lock_state_controller_; |
dcheng | a9454747 | 2016-04-08 08:41:11 | [diff] [blame] | 506 | std::unique_ptr<ui::UserActivityDetector> user_activity_detector_; |
| 507 | std::unique_ptr<VideoDetector> video_detector_; |
dcheng | a9454747 | 2016-04-08 08:41:11 | [diff] [blame] | 508 | std::unique_ptr<WindowTreeHostManager> window_tree_host_manager_; |
| 509 | std::unique_ptr<HighContrastController> high_contrast_controller_; |
| 510 | std::unique_ptr<MagnificationController> magnification_controller_; |
| 511 | std::unique_ptr<PartialMagnificationController> |
| 512 | partial_magnification_controller_; |
| 513 | std::unique_ptr<AutoclickController> autoclick_controller_; |
| 514 | std::unique_ptr<aura::client::FocusClient> focus_client_; |
mfomitchev | 493ed60 | 2016-04-09 00:48:39 | [diff] [blame] | 515 | |
[email protected] | 39718b5 | 2012-12-03 17:24:56 | [diff] [blame] | 516 | aura::client::ActivationClient* activation_client_; |
sky | 984c189 | 2016-04-20 00:00:34 | [diff] [blame] | 517 | |
oshima | 5a296e8 | 2016-04-29 01:32:27 | [diff] [blame] | 518 | std::unique_ptr<ScreenshotController> screenshot_controller_; |
[email protected] | f5c9dbc | 2014-04-11 08:13:45 | [diff] [blame] | 519 | |
dcheng | a9454747 | 2016-04-08 08:41:11 | [diff] [blame] | 520 | std::unique_ptr<MouseCursorEventFilter> mouse_cursor_filter_; |
| 521 | std::unique_ptr<ScreenPositionController> screen_position_controller_; |
| 522 | std::unique_ptr<SystemModalContainerEventFilter> modality_filter_; |
| 523 | std::unique_ptr<EventClientImpl> event_client_; |
| 524 | std::unique_ptr<EventTransformationHandler> event_transformation_handler_; |
[email protected] | ae18b911 | 2011-11-07 16:59:13 | [diff] [blame] | 525 | |
[email protected] | 0b0b074 | 2012-02-16 13:23:45 | [diff] [blame] | 526 | // An event filter that pre-handles key events while the partial |
[email protected] | a1584a71 | 2012-07-30 21:02:26 | [diff] [blame] | 527 | // screenshot UI or the keyboard overlay is active. |
dcheng | a9454747 | 2016-04-08 08:41:11 | [diff] [blame] | 528 | std::unique_ptr<OverlayEventFilter> overlay_filter_; |
[email protected] | 0b0b074 | 2012-02-16 13:23:45 | [diff] [blame] | 529 | |
[email protected] | 3537d47 | 2014-01-15 05:45:31 | [diff] [blame] | 530 | // An event filter which handles moving and resizing windows. |
dcheng | a9454747 | 2016-04-08 08:41:11 | [diff] [blame] | 531 | std::unique_ptr<ToplevelWindowEventHandler> toplevel_window_event_handler_; |
[email protected] | 3537d47 | 2014-01-15 05:45:31 | [diff] [blame] | 532 | |
[email protected] | 435b212e | 2012-04-05 19:43:37 | [diff] [blame] | 533 | // An event filter which handles system level gestures |
dcheng | a9454747 | 2016-04-08 08:41:11 | [diff] [blame] | 534 | std::unique_ptr<SystemGestureEventFilter> system_gesture_filter_; |
[email protected] | 435b212e | 2012-04-05 19:43:37 | [diff] [blame] | 535 | |
[email protected] | 745816be | 2011-11-22 05:08:30 | [diff] [blame] | 536 | // An event filter that pre-handles global accelerators. |
dcheng | a9454747 | 2016-04-08 08:41:11 | [diff] [blame] | 537 | std::unique_ptr<::wm::AcceleratorFilter> accelerator_filter_; |
[email protected] | 745816be | 2011-11-22 05:08:30 | [diff] [blame] | 538 | |
dcheng | a9454747 | 2016-04-08 08:41:11 | [diff] [blame] | 539 | std::unique_ptr<DisplayManager> display_manager_; |
| 540 | std::unique_ptr<DisplayConfigurationController> |
| 541 | display_configuration_controller_; |
[email protected] | 6bdf795 | 2012-11-14 10:10:58 | [diff] [blame] | 542 | |
dcheng | a9454747 | 2016-04-08 08:41:11 | [diff] [blame] | 543 | std::unique_ptr<LocaleNotificationController> locale_notification_controller_; |
hidehiko | 6821ca4 | 2016-06-18 11:12:23 | [diff] [blame] | 544 | std::unique_ptr<ScreenPinningController> screen_pinning_controller_; |
[email protected] | a9a4046 | 2013-07-31 06:22:56 | [diff] [blame] | 545 | |
[email protected] | ded58fd | 2013-10-09 07:56:55 | [diff] [blame] | 546 | #if defined(OS_CHROMEOS) |
dcheng | a9454747 | 2016-04-08 08:41:11 | [diff] [blame] | 547 | std::unique_ptr<PowerEventObserver> power_event_observer_; |
| 548 | std::unique_ptr<ui::UserActivityPowerManagerNotifier> user_activity_notifier_; |
| 549 | std::unique_ptr<VideoActivityNotifier> video_activity_notifier_; |
| 550 | std::unique_ptr<StickyKeysController> sticky_keys_controller_; |
| 551 | std::unique_ptr<ResolutionNotificationController> |
[email protected] | 7bc49bd | 2014-01-22 09:30:34 | [diff] [blame] | 552 | resolution_notification_controller_; |
dcheng | a9454747 | 2016-04-08 08:41:11 | [diff] [blame] | 553 | std::unique_ptr<BluetoothNotificationController> |
[email protected] | b314272 | 2014-03-04 06:59:50 | [diff] [blame] | 554 | bluetooth_notification_controller_; |
dcheng | a9454747 | 2016-04-08 08:41:11 | [diff] [blame] | 555 | std::unique_ptr<VirtualKeyboardController> virtual_keyboard_controller_; |
warx | 533c8f6 | 2016-04-12 01:19:43 | [diff] [blame] | 556 | std::unique_ptr<chromeos::AudioA11yController> audio_a11y_controller_; |
[email protected] | 70b3e7d5 | 2012-06-02 22:12:25 | [diff] [blame] | 557 | // Controls video output device state. |
dcheng | a9454747 | 2016-04-08 08:41:11 | [diff] [blame] | 558 | std::unique_ptr<ui::DisplayConfigurator> display_configurator_; |
| 559 | std::unique_ptr<DisplayColorManager> display_color_manager_; |
| 560 | std::unique_ptr<DisplayErrorObserver> display_error_observer_; |
| 561 | std::unique_ptr<ProjectingObserver> projecting_observer_; |
[email protected] | 6bdf795 | 2012-11-14 10:10:58 | [diff] [blame] | 562 | |
[email protected] | c1234a4 | 2013-08-20 09:35:40 | [diff] [blame] | 563 | // Listens for output changes and updates the display manager. |
dcheng | a9454747 | 2016-04-08 08:41:11 | [diff] [blame] | 564 | std::unique_ptr<DisplayChangeObserver> display_change_observer_; |
[email protected] | 3dff2ef | 2014-02-09 22:50:39 | [diff] [blame] | 565 | |
jonross | 0af4521 | 2015-01-13 18:55:46 | [diff] [blame] | 566 | // Implements content::ScreenOrientationController for ChromeOS |
dcheng | a9454747 | 2016-04-08 08:41:11 | [diff] [blame] | 567 | std::unique_ptr<ScreenOrientationController> screen_orientation_controller_; |
jonross | f21fea1 | 2014-11-13 01:22:51 | [diff] [blame] | 568 | |
dcheng | a9454747 | 2016-04-08 08:41:11 | [diff] [blame] | 569 | std::unique_ptr<TouchTransformerController> touch_transformer_controller_; |
dnicoara | 8c3bd1e6 | 2014-10-30 19:53:39 | [diff] [blame] | 570 | |
dcheng | a9454747 | 2016-04-08 08:41:11 | [diff] [blame] | 571 | std::unique_ptr<ui::EventHandler> magnifier_key_scroll_handler_; |
| 572 | std::unique_ptr<ui::EventHandler> speech_feedback_handler_; |
xiaoyinh | 06e3125 | 2016-08-25 23:04:03 | [diff] [blame] | 573 | std::unique_ptr<StylusMetricsRecorder> stylus_metrics_recorder_; |
[email protected] | ded58fd | 2013-10-09 07:56:55 | [diff] [blame] | 574 | #endif // defined(OS_CHROMEOS) |
[email protected] | 70b3e7d5 | 2012-06-02 22:12:25 | [diff] [blame] | 575 | |
[email protected] | c0ff034 | 2013-02-27 00:41:29 | [diff] [blame] | 576 | // |native_cursor_manager_| is owned by |cursor_manager_|, but we keep a |
| 577 | // pointer to vend to test code. |
| 578 | AshNativeCursorManager* native_cursor_manager_; |
[email protected] | e76096a5f | 2014-04-08 04:08:03 | [diff] [blame] | 579 | |
sadrul | 7a8785e | 2016-02-12 21:54:35 | [diff] [blame] | 580 | // Cursor may be hidden on certain key events in ChromeOS, whereas we never |
| 581 | // hide the cursor on Windows. |
dcheng | a9454747 | 2016-04-08 08:41:11 | [diff] [blame] | 582 | std::unique_ptr<::wm::CursorManager> cursor_manager_; |
[email protected] | 4b8003c | 2012-07-26 00:54:19 | [diff] [blame] | 583 | |
[email protected] | 852a55d | 2012-10-17 13:30:30 | [diff] [blame] | 584 | // For testing only: simulate that a modal window is open |
| 585 | bool simulate_modal_window_open_for_testing_; |
| 586 | |
[email protected] | 2b8a9bb | 2013-07-01 22:43:40 | [diff] [blame] | 587 | bool is_touch_hud_projection_enabled_; |
| 588 | |
[email protected] | 1d2a721 | 2014-01-16 06:09:48 | [diff] [blame] | 589 | // Injected content::GPUDataManager support. |
dcheng | a9454747 | 2016-04-08 08:41:11 | [diff] [blame] | 590 | std::unique_ptr<GPUSupport> gpu_support_; |
[email protected] | 1d2a721 | 2014-01-16 06:09:48 | [diff] [blame] | 591 | |
sky | b7b5409 | 2016-08-19 16:00:09 | [diff] [blame] | 592 | std::unique_ptr<ImmersiveHandlerFactoryAsh> immersive_handler_factory_; |
| 593 | |
ben | 0d6be2d4 | 2015-09-26 04:37:19 | [diff] [blame] | 594 | base::SequencedWorkerPool* blocking_pool_; |
| 595 | |
sky | fee520c | 2016-02-11 19:57:46 | [diff] [blame] | 596 | bool in_mus_ = false; |
| 597 | |
[email protected] | 87b0d82e | 2011-10-07 21:02:59 | [diff] [blame] | 598 | DISALLOW_COPY_AND_ASSIGN(Shell); |
| 599 | }; |
| 600 | |
[email protected] | 55f59335 | 2011-12-24 05:42:46 | [diff] [blame] | 601 | } // namespace ash |
[email protected] | 87b0d82e | 2011-10-07 21:02:59 | [diff] [blame] | 602 | |
[email protected] | b65bdda | 2011-12-23 23:35:31 | [diff] [blame] | 603 | #endif // ASH_SHELL_H_ |