blob: 0234a6cfa660328bdd5494defb31578867d90e30 [file] [log] [blame]
[email protected]e0d22e82012-01-04 00:46:571// Copyright (c) 2012 The Chromium Authors. All rights reserved.
[email protected]87b0d82e2011-10-07 21:02:592// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
[email protected]b65bdda2011-12-23 23:35:315#ifndef ASH_SHELL_H_
6#define ASH_SHELL_H_
[email protected]87b0d82e2011-10-07 21:02:597
dchenga94547472016-04-08 08:41:118#include <memory>
[email protected]cac10fc62011-10-07 23:22:569#include <utility>
10#include <vector>
11
[email protected]b65bdda2011-12-23 23:35:3112#include "ash/ash_export.h"
[email protected]5d2ea362013-12-13 08:10:1813#include "ash/metrics/user_metrics_recorder.h"
jamescookd4649fa2016-09-30 17:50:0914#include "ash/public/cpp/shelf_types.h"
[email protected]e76096a5f2014-04-08 04:08:0315#include "ash/wm/cursor_manager_chromeos.h"
[email protected]c0ce80e2012-10-05 23:28:2716#include "ash/wm/system_modal_container_event_filter_delegate.h"
[email protected]b0639282011-12-22 21:12:2717#include "base/gtest_prod_util.h"
avidb567a8a2015-12-20 17:07:2418#include "base/macros.h"
[email protected]6f67df52013-10-29 01:07:1519#include "base/memory/weak_ptr.h"
[email protected]1a2145b2012-03-13 21:09:1720#include "base/observer_list.h"
[email protected]c9390bd2013-11-08 20:33:1321#include "ui/aura/window.h"
oshimaf84b0da722016-04-27 19:47:1922#include "ui/display/screen.h"
[email protected]86ccbd42013-09-18 18:11:5423#include "ui/events/event_target.h"
Avi Drissmanfefc2f82014-12-22 19:25:2924#include "ui/gfx/geometry/insets.h"
25#include "ui/gfx/geometry/size.h"
[email protected]ee3ed10772014-03-11 22:02:0126#include "ui/wm/core/cursor_manager.h"
[email protected]87b0d82e2011-10-07 21:02:5927
28namespace aura {
[email protected]35304ce2011-12-14 23:21:0129class RootWindow;
[email protected]87b0d82e2011-10-07 21:02:5930class Window;
[email protected]c28853612012-05-31 22:43:4431namespace client {
[email protected]39718b52012-12-03 17:24:5632class ActivationClient;
[email protected]8cfb6722012-11-28 03:28:4633class FocusClient;
[email protected]c28853612012-05-31 22:43:4434}
[email protected]87b0d82e2011-10-07 21:02:5935}
[email protected]fa4a45832012-04-12 21:32:4836
warx533c8f62016-04-12 01:19:4337namespace chromeos {
38class AudioA11yController;
39}
40
rjkroege72f8154f2016-10-29 00:49:0241namespace display {
42class DisplayManager;
43}
44
[email protected]2b99f8c2011-10-11 19:42:2445namespace gfx {
[email protected]cac10fc62011-10-07 23:22:5646class Rect;
47}
[email protected]b6ba05d902013-10-04 21:38:4548
[email protected]a8bd1cb2012-02-17 23:05:5449namespace ui {
[email protected]1e31cbd2014-04-07 20:06:1150class DisplayConfigurator;
derat2d4e62d2015-01-09 16:09:1751class UserActivityDetector;
[email protected]b0fa7012014-04-16 12:50:5752class UserActivityPowerManagerNotifier;
[email protected]a8bd1cb2012-02-17 23:05:5453}
[email protected]57b8bb352012-01-11 05:11:4654namespace views {
55class NonClientFrameView;
56class Widget;
[email protected]4a59e4e2012-11-12 21:15:4057namespace corewm {
[email protected]e319c7e2014-03-14 19:56:1458class TooltipController;
59}
60}
61
62namespace wm {
[email protected]60d677d2014-05-30 13:07:0263class AcceleratorFilter;
[email protected]4a59e4e2012-11-12 21:15:4064class CompoundEventFilter;
[email protected]86f2b5e2012-11-14 20:37:0065class ShadowController;
[email protected]b5756e22012-11-30 01:32:0266class VisibilityController;
[email protected]0c2dc012012-12-02 00:00:2367class WindowModalityController;
[email protected]4a59e4e2012-11-12 21:15:4068}
[email protected]87b0d82e2011-10-07 21:02:5969
[email protected]55f593352011-12-24 05:42:4670namespace ash {
[email protected]87b0d82e2011-10-07 21:02:5971
sky44a09892016-07-20 17:46:5872class AcceleratorControllerDelegateAura;
[email protected]c0ff0342013-02-27 00:41:2973class AshNativeCursorManager;
[email protected]55398d22013-10-10 19:49:2074class AutoclickController;
[email protected]b3142722014-03-04 06:59:5075class BluetoothNotificationController;
[email protected]c1234a42013-08-20 09:35:4076class DisplayChangeObserver;
robert.bradfordab052492015-05-06 11:09:5677class DisplayColorManager;
stevenjb537c5c3f2016-01-20 23:38:1278class DisplayConfigurationController;
[email protected]18b21b2e2013-03-01 20:56:2379class DisplayErrorObserver;
[email protected]084b6bb2011-11-17 05:18:1680class DragDropController;
[email protected]e67291f12012-10-10 05:52:3881class EventClientImpl;
[email protected]682990f2013-01-10 06:49:1182class EventTransformationHandler;
[email protected]093b8d642014-04-03 20:59:2883class FirstRunHelper;
[email protected]093b8d642014-04-03 20:59:2884class GPUSupport;
85class HighContrastController;
skyb7b54092016-08-19 16:00:0986class ImmersiveHandlerFactoryAsh;
sammiequon203ae022016-09-18 17:23:4287class LaserPointerController;
yusukes1168eda2016-04-27 07:52:0888class LinkHandlerModelFactory;
[email protected]093b8d642014-04-03 20:59:2889class LockStateController;
mswb2416052016-06-24 21:23:4590enum class LoginStatus;
[email protected]093b8d642014-04-03 20:59:2891class MagnificationController;
[email protected]78d96302012-06-22 00:58:0792class MouseCursorEventFilter;
[email protected]9ae32df2012-07-26 03:25:1893class OverlayEventFilter;
[email protected]093b8d642014-04-03 20:59:2894class PartialMagnificationController;
95class PowerButtonController;
[email protected]51625052013-10-10 01:40:1696class PowerEventObserver;
[email protected]72bce522014-02-10 21:11:2697class ProjectingObserver;
[email protected]e4a181cc2012-03-17 02:20:5798class ResizeShadowController;
[email protected]6ef71d72013-08-10 18:13:4499class ResolutionNotificationController;
[email protected]d90b8392012-06-13 09:34:56100class RootWindowController;
sky6624a7af2016-05-27 18:47:49101class ScopedOverviewAnimationSettingsFactoryAura;
jonross0af45212015-01-13 18:55:46102class ScreenOrientationController;
oshima5a296e82016-04-29 01:32:27103class ScreenshotController;
hidehiko6821ca42016-06-18 11:12:23104class ScreenPinningController;
[email protected]8d625fb2012-07-18 16:40:06105class ScreenPositionController;
[email protected]093b8d642014-04-03 20:59:28106class SessionStateDelegate;
[email protected]093b8d642014-04-03 20:59:28107class ShellDelegate;
[email protected]1b4c7472014-05-15 18:32:23108struct ShellInitParams;
kylechar98748a52016-12-03 01:33:22109class ShutdownObserver;
[email protected]093b8d642014-04-03 20:59:28110class StickyKeysController;
[email protected]9ae32df2012-07-26 03:25:18111class SystemGestureEventFilter;
[email protected]c0ce80e2012-10-05 23:28:27112class SystemModalContainerEventFilter;
[email protected]093b8d642014-04-03 20:59:28113class SystemTray;
[email protected]093b8d642014-04-03 20:59:28114class ToplevelWindowEventHandler;
[email protected]03122891a2014-05-13 23:56:49115class TouchTransformerController;
yiyixa68ade512016-09-01 17:38:13116class ScreenLayoutObserver;
bsheeaae09a2014-09-22 23:16:52117class VirtualKeyboardController;
[email protected]ded58fd2013-10-09 07:56:55118class VideoActivityNotifier;
[email protected]093b8d642014-04-03 20:59:28119class VideoDetector;
120class WebNotificationTray;
[email protected]093b8d642014-04-03 20:59:28121class WindowPositioner;
msw607227f82016-08-30 17:22:39122class WindowTreeHostManager;
sky0702b272016-06-03 22:10:41123class WmShellAura;
sky80556bc42016-06-07 22:46:13124class WmWindow;
[email protected]2b99f8c2011-10-11 19:42:24125
[email protected]0af58042012-12-13 03:21:35126namespace shell {
127class WindowWatcher;
128}
129
[email protected]0c68e892012-12-08 16:54:53130namespace test {
131class ShellTestApi;
132}
133
[email protected]87b0d82e2011-10-07 21:02:59134// Shell is a singleton object that presents the Shell API and implements the
[email protected]99f07e02011-12-07 00:02:59135// RootWindow's delegate interface.
[email protected]b0079a92012-01-25 20:13:38136//
137// Upon creation, the Shell sets itself as the RootWindow's delegate, which
138// takes ownership of the Shell.
[email protected]093b8d642014-04-03 20:59:28139class ASH_EXPORT Shell : public SystemModalContainerEventFilterDelegate,
jamescook4545062c2016-08-02 18:48:01140 public ui::EventTarget {
[email protected]87b0d82e2011-10-07 21:02:59141 public:
[email protected]093b8d642014-04-03 20:59:28142 typedef std::vector<RootWindowController*> RootWindowControllerList;
[email protected]be65be362012-06-15 07:38:23143
[email protected]3266c2b92011-11-14 00:06:08144 // A shell must be explicitly created so that it can call |Init()| with the
145 // delegate set. |delegate| can be NULL (if not required for initialization).
[email protected]09464c72013-04-26 07:31:28146 // Takes ownership of |delegate|.
[email protected]1b4c7472014-05-15 18:32:23147 static Shell* CreateInstance(const ShellInitParams& init_params);
[email protected]3266c2b92011-11-14 00:06:08148
149 // Should never be called before |CreateInstance()|.
[email protected]cac10fc62011-10-07 23:22:56150 static Shell* GetInstance();
[email protected]3266c2b92011-11-14 00:06:08151
[email protected]b3b7bcd2012-03-06 19:35:45152 // Returns true if the ash shell has been instantiated.
153 static bool HasInstance();
154
[email protected]ef589af2011-12-03 01:07:15155 static void DeleteInstance();
[email protected]cac10fc62011-10-07 23:22:56156
[email protected]d90b8392012-06-13 09:34:56157 // Returns the root window controller for the primary root window.
[email protected]a0afeb12012-12-10 22:57:09158 // TODO(oshima): move this to |RootWindowController|
[email protected]093b8d642014-04-03 20:59:28159 static RootWindowController* GetPrimaryRootWindowController();
[email protected]d90b8392012-06-13 09:34:56160
[email protected]cf1c70e2012-08-30 01:13:02161 // Returns all root window controllers.
[email protected]a0afeb12012-12-10 22:57:09162 // TODO(oshima): move this to |RootWindowController|
[email protected]be65be362012-06-15 07:38:23163 static RootWindowControllerList GetAllRootWindowControllers();
164
[email protected]bf9cdb362013-10-25 19:22:45165 // Returns the primary root Window. The primary root Window is the one that
166 // has a launcher.
167 static aura::Window* GetPrimaryRootWindow();
[email protected]e73bd7802012-02-17 20:10:34168
[email protected]bf9cdb362013-10-25 19:22:45169 // Returns a root Window when used as a target when creating a new window.
[email protected]b42910f2013-08-01 11:45:29170 // The root window of the active window is used in most cases, but can
jamescook4545062c2016-08-02 18:48:01171 // be overridden by using ScopedRootWindowForNewWindows.
[email protected]bf9cdb362013-10-25 19:22:45172 // If you want to get the root Window of the active window, just use
[email protected]b42910f2013-08-01 11:45:29173 // |wm::GetActiveWindow()->GetRootWindow()|.
[email protected]bf9cdb362013-10-25 19:22:45174 static aura::Window* GetTargetRootWindow();
[email protected]a857dbe2012-05-30 22:10:14175
oshima06b39602016-05-11 02:40:10176 // Returns the id of the display::Display corresponding to the window returned
mfomitcheva1a8aa62016-05-03 16:23:26177 // by |GetTargetRootWindow()|
178 static int64_t GetTargetDisplayId();
179
[email protected]cf1c70e2012-08-30 01:13:02180 // Returns all root windows.
[email protected]c9390bd2013-11-08 20:33:13181 static aura::Window::Windows GetAllRootWindows();
[email protected]be65be362012-06-15 07:38:23182
[email protected]bf9cdb362013-10-25 19:22:45183 static aura::Window* GetContainer(aura::Window* root_window,
[email protected]7b0f7502012-06-11 00:12:39184 int container_id);
[email protected]bf9cdb362013-10-25 19:22:45185 static const aura::Window* GetContainer(const aura::Window* root_window,
[email protected]e67291f12012-10-10 05:52:38186 int container_id);
[email protected]7b0f7502012-06-11 00:12:39187
[email protected]57b8bb352012-01-11 05:11:46188 // Creates a default views::NonClientFrameView for use by windows in the
189 // Ash environment.
190 views::NonClientFrameView* CreateDefaultNonClientFrameView(
191 views::Widget* widget);
192
mswad28b252016-08-09 02:42:07193 // Sets work area insets of the display containing |window|, pings observers.
[email protected]2e236a52012-06-27 22:21:47194 void SetDisplayWorkAreaInsets(aura::Window* window,
[email protected]8a45c972012-03-14 18:22:44195 const gfx::Insets& insets);
[email protected]1a2145b2012-03-13 21:09:17196
[email protected]82d3954ae2012-04-20 09:02:22197 // Called when the user logs in.
skye79274a2016-06-08 05:39:02198 void OnLoginStateChanged(LoginStatus status);
[email protected]82d3954ae2012-04-20 09:02:22199
[email protected]51f438112013-11-18 19:32:50200 // Called after the logged-in user's profile is ready.
201 void OnLoginUserProfilePrepared();
202
[email protected]82d3954ae2012-04-20 09:02:22203 // Called when the application is exiting.
204 void OnAppTerminating();
205
206 // Called when the screen is locked (after the lock window is visible) or
207 // unlocked.
208 void OnLockStateChanged(bool locked);
209
[email protected]58868abf2014-01-17 23:45:33210 // Called when a casting session is started or stopped.
211 void OnCastingSessionStartedOrStopped(bool started);
212
[email protected]0e3e7cb2014-04-12 05:18:25213 // Called when a root window is created.
sky80556bc42016-06-07 22:46:13214 void OnRootWindowAdded(WmWindow* root_window);
[email protected]0e3e7cb2014-04-12 05:18:25215
[email protected]e1b299b2014-01-29 23:53:41216 // Creates a virtual keyboard. Deletes the old virtual keyboard if it already
217 // exists.
[email protected]51f438112013-11-18 19:32:50218 void CreateKeyboard();
219
[email protected]e1b299b2014-01-29 23:53:41220 // Deactivates the virtual keyboard.
221 void DeactivateKeyboard();
222
[email protected]da285852014-05-27 19:53:43223#if defined(OS_CHROMEOS)
224 // Test if MaximizeModeWindowManager is not enabled, and if
225 // MaximizeModeController is not currently setting a display rotation. Or if
226 // the |resolution_notification_controller_| is not showing its confirmation
227 // dialog. If true then changes to display settings can be saved.
228 bool ShouldSaveDisplaySettings();
229#endif
230
sky44a09892016-07-20 17:46:58231 AcceleratorControllerDelegateAura* accelerator_controller_delegate() {
232 return accelerator_controller_delegate_.get();
233 }
[email protected]6e9f6aa2012-02-09 04:16:20234
rjkroege72f8154f2016-10-29 00:49:02235 display::DisplayManager* display_manager() { return display_manager_.get(); }
stevenjb537c5c3f2016-01-20 23:38:12236 DisplayConfigurationController* display_configuration_controller() {
237 return display_configuration_controller_.get();
238 }
jamescookb8dcef522016-06-25 14:42:55239 ::wm::CompoundEventFilter* env_filter() { return env_filter_.get(); }
[email protected]a1b7a822013-02-23 19:08:04240 views::corewm::TooltipController* tooltip_controller() {
[email protected]862deef2011-12-15 22:07:33241 return tooltip_controller_.get();
[email protected]4a229e902011-12-01 21:21:11242 }
[email protected]093b8d642014-04-03 20:59:28243 OverlayEventFilter* overlay_filter() { return overlay_filter_.get(); }
yusukes1168eda2016-04-27 07:52:08244 LinkHandlerModelFactory* link_handler_model_factory() {
245 return link_handler_model_factory_;
246 }
247 void set_link_handler_model_factory(
248 LinkHandlerModelFactory* link_handler_model_factory) {
249 link_handler_model_factory_ = link_handler_model_factory;
250 }
[email protected]e0d22e82012-01-04 00:46:57251 PowerButtonController* power_button_controller() {
252 return power_button_controller_.get();
253 }
[email protected]ab4f8c92013-05-30 19:07:47254 LockStateController* lock_state_controller() {
255 return lock_state_controller_.get();
[email protected]222f40c2012-10-18 08:58:13256 }
jamescookb8dcef522016-06-25 14:42:55257 VideoDetector* video_detector() { return video_detector_.get(); }
oshimae2818922015-07-28 01:18:52258 WindowTreeHostManager* window_tree_host_manager() {
259 return window_tree_host_manager_.get();
[email protected]3e1cdd312012-06-07 03:48:41260 }
dnicoara8c3bd1e62014-10-30 19:53:39261#if defined(OS_CHROMEOS)
chirantan40e4cd82015-02-19 01:08:19262 PowerEventObserver* power_event_observer() {
263 return power_event_observer_.get();
264 }
[email protected]03122891a2014-05-13 23:56:49265 TouchTransformerController* touch_transformer_controller() {
266 return touch_transformer_controller_.get();
267 }
sammiequon203ae022016-09-18 17:23:42268 LaserPointerController* laser_pointer_controller() {
269 return laser_pointer_controller_.get();
270 }
271 PartialMagnificationController* partial_magnification_controller() {
272 return partial_magnification_controller_.get();
273 }
dnicoara8c3bd1e62014-10-30 19:53:39274#endif // defined(OS_CHROMEOS)
oshima5a296e82016-04-29 01:32:27275 ScreenshotController* screenshot_controller() {
276 return screenshot_controller_.get();
mukai19274bdd2015-02-24 22:37:48277 }
[email protected]093b8d642014-04-03 20:59:28278 MouseCursorEventFilter* mouse_cursor_filter() {
[email protected]8b7ba87b2012-09-01 00:40:40279 return mouse_cursor_filter_.get();
280 }
[email protected]093b8d642014-04-03 20:59:28281 EventTransformationHandler* event_transformation_handler() {
[email protected]682990f2013-01-10 06:49:11282 return event_transformation_handler_.get();
283 }
sadrul7a8785e2016-02-12 21:54:35284 ::wm::CursorManager* cursor_manager() { return cursor_manager_.get(); }
[email protected]4a229e902011-12-01 21:21:11285
[email protected]fcb123d2013-04-17 15:58:49286 SessionStateDelegate* session_state_delegate() {
287 return session_state_delegate_.get();
288 }
289
[email protected]f48075d2012-05-24 11:06:51290 HighContrastController* high_contrast_controller() {
291 return high_contrast_controller_.get();
292 }
293
[email protected]77f7c132012-11-15 06:52:54294 MagnificationController* magnification_controller() {
[email protected]c1c670172012-04-26 04:20:26295 return magnification_controller_.get();
296 }
[email protected]f48075d2012-05-24 11:06:51297
[email protected]55398d22013-10-10 19:49:20298 AutoclickController* autoclick_controller() {
299 return autoclick_controller_.get();
300 }
301
[email protected]d219a192012-12-14 00:08:18302 aura::client::ActivationClient* activation_client() {
303 return activation_client_;
304 }
[email protected]77f7c132012-11-15 06:52:54305
[email protected]c758fbf2012-03-25 22:53:59306 // Force the shelf to query for it's current visibility state.
jamescook6afad6d2016-06-01 00:35:01307 // TODO(jamescook): Move to Shelf.
[email protected]c758fbf2012-03-25 22:53:59308 void UpdateShelfVisibility();
309
[email protected]88d71122012-10-18 07:11:01310 // Returns WebNotificationTray on the primary root window.
311 WebNotificationTray* GetWebNotificationTray();
[email protected]6d6546e2012-05-30 23:12:02312
[email protected]a0afeb12012-12-10 22:57:09313 // Does the primary display have status area?
314 bool HasPrimaryStatusArea();
315
316 // Returns the system tray on primary display.
317 SystemTray* GetPrimarySystemTray();
[email protected]bfb411312012-02-27 20:59:27318
[email protected]9488d4d2012-02-29 18:32:37319 static void set_initially_hide_cursor(bool hide) {
320 initially_hide_cursor_ = hide;
321 }
322
[email protected]093b8d642014-04-03 20:59:28323 ResizeShadowController* resize_shadow_controller() {
[email protected]e4a181cc2012-03-17 02:20:57324 return resize_shadow_controller_.get();
325 }
326
[email protected]a54e65b2011-11-21 22:03:34327 // Made available for tests.
[email protected]e319c7e2014-03-14 19:56:14328 ::wm::ShadowController* shadow_controller() {
[email protected]a54e65b2011-11-21 22:03:34329 return shadow_controller_.get();
330 }
331
[email protected]f9466702012-09-17 16:35:27332 // Starts the animation that occurs on first login.
333 void DoInitialWorkspaceAnimation();
334
[email protected]7bc49bd2014-01-22 09:30:34335#if defined(OS_CHROMEOS)
oshimae2818922015-07-28 01:18:52336 // TODO(oshima): Move these objects to WindowTreeHostManager.
[email protected]1e31cbd2014-04-07 20:06:11337 ui::DisplayConfigurator* display_configurator() {
338 return display_configurator_.get();
[email protected]70b3e7d52012-06-02 22:12:25339 }
[email protected]093b8d642014-04-03 20:59:28340 DisplayErrorObserver* display_error_observer() {
[email protected]18b21b2e2013-03-01 20:56:23341 return display_error_observer_.get();
342 }
[email protected]70b3e7d52012-06-02 22:12:25343
yiyixa68ade512016-09-01 17:38:13344 ScreenLayoutObserver* screen_layout_observer() {
345 return screen_layout_observer_.get();
346 }
347
[email protected]093b8d642014-04-03 20:59:28348 ResolutionNotificationController* resolution_notification_controller() {
[email protected]6ef71d72013-08-10 18:13:44349 return resolution_notification_controller_.get();
350 }
[email protected]0dc85512014-03-13 13:26:41351
jonross0af45212015-01-13 18:55:46352 ScreenOrientationController* screen_orientation_controller() {
353 return screen_orientation_controller_.get();
jonrossf21fea12014-11-13 01:22:51354 }
355
rsadamc727b6a2014-10-31 18:59:33356 VirtualKeyboardController* virtual_keyboard_controller() {
357 return virtual_keyboard_controller_.get();
358 }
warx533c8f62016-04-12 01:19:43359
360 chromeos::AudioA11yController* audio_a11y_controller() {
361 return audio_a11y_controller_.get();
362 }
[email protected]7bc49bd2014-01-22 09:30:34363#endif // defined(OS_CHROMEOS)
[email protected]6ef71d72013-08-10 18:13:44364
jamescookb8dcef522016-06-25 14:42:55365 WindowPositioner* window_positioner() { return window_positioner_.get(); }
[email protected]e9a71312013-10-04 03:20:01366
jamescookb8dcef522016-06-25 14:42:55367 UserMetricsRecorder* metrics() { return user_metrics_recorder_.get(); }
[email protected]5d2ea362013-12-13 08:10:18368
[email protected]2b8a9bb2013-07-01 22:43:40369 void SetTouchHudProjectionEnabled(bool enabled);
370
371 bool is_touch_hud_projection_enabled() const {
372 return is_touch_hud_projection_enabled_;
373 }
374
[email protected]59ccade2013-10-17 17:56:40375#if defined(OS_CHROMEOS)
376 // Creates instance of FirstRunHelper. Caller is responsible for deleting
377 // returned object.
378 ash::FirstRunHelper* CreateFirstRunHelper();
[email protected]f94c6aa2013-11-08 01:18:54379
[email protected]87ec2202014-02-06 06:24:27380 // Toggles cursor compositing on/off. Native cursor is disabled when cursor
381 // compositing is enabled, and vice versa.
382 void SetCursorCompositingEnabled(bool enabled);
383
[email protected]08bdabed2013-12-20 07:52:28384 StickyKeysController* sticky_keys_controller() {
385 return sticky_keys_controller_.get();
[email protected]f94c6aa2013-11-08 01:18:54386 }
hidehiko6821ca42016-06-18 11:12:23387
[email protected]59ccade2013-10-17 17:56:40388#endif // defined(OS_CHROMEOS)
389
hidehiko6821ca42016-06-18 11:12:23390 ScreenPinningController* screen_pinning_controller() {
391 return screen_pinning_controller_.get();
392 }
393
[email protected]1d2a7212014-01-16 06:09:48394 GPUSupport* gpu_support() { return gpu_support_.get(); }
[email protected]1d2a7212014-01-16 06:09:48395
[email protected]2b4cd302012-02-24 20:21:13396 private:
[email protected]c39be8f2012-06-15 22:58:36397 FRIEND_TEST_ALL_PREFIXES(ExtendedDesktopTest, TestCursor);
[email protected]1aad3322012-06-06 06:37:09398 FRIEND_TEST_ALL_PREFIXES(WindowManagerTest, MouseEventCursors);
399 FRIEND_TEST_ALL_PREFIXES(WindowManagerTest, TransformActivate);
[email protected]093b8d642014-04-03 20:59:28400 friend class RootWindowController;
[email protected]0c68e892012-12-08 16:54:53401 friend class test::ShellTestApi;
[email protected]0af58042012-12-13 03:21:35402 friend class shell::WindowWatcher;
[email protected]ad0c8722012-03-02 20:17:45403
[email protected]cac10fc62011-10-07 23:22:56404 typedef std::pair<aura::Window*, gfx::Rect> WindowAndBoundsPair;
405
[email protected]09464c72013-04-26 07:31:28406 // Takes ownership of |delegate|.
msw3f439af2016-09-08 22:35:26407 explicit Shell(ShellDelegate* delegate);
dcheng1f4538e2014-10-27 23:57:05408 ~Shell() override;
[email protected]3266c2b92011-11-14 00:06:08409
[email protected]1b4c7472014-05-15 18:32:23410 void Init(const ShellInitParams& init_params);
[email protected]b0639282011-12-22 21:12:27411
[email protected]51f438112013-11-18 19:32:50412 // Initializes virtual keyboard controller.
413 void InitKeyboard();
[email protected]b6ba05d902013-10-04 21:38:45414
[email protected]a273d33a2013-10-17 12:41:21415 // Initializes the root window so that it can host browser windows.
[email protected]41baaed2013-11-09 04:18:26416 void InitRootWindow(aura::Window* root_window);
[email protected]d90b8392012-06-13 09:34:56417
hariank0dd03dd2016-07-14 23:47:33418 // SystemModalContainerEventFilterDelegate:
dcheng1f4538e2014-10-27 23:57:05419 bool CanWindowReceiveEvents(aura::Window* window) override;
[email protected]c0ce80e2012-10-05 23:28:27420
[email protected]5097e692012-10-30 22:08:41421 // Overridden from ui::EventTarget:
dcheng1f4538e2014-10-27 23:57:05422 bool CanAcceptEvent(const ui::Event& event) override;
423 EventTarget* GetParentTarget() override;
dchenga94547472016-04-08 08:41:11424 std::unique_ptr<ui::EventTargetIterator> GetChildIterator() const override;
dcheng1f4538e2014-10-27 23:57:05425 ui::EventTargeter* GetEventTargeter() override;
[email protected]5097e692012-10-30 22:08:41426
[email protected]cac10fc62011-10-07 23:22:56427 static Shell* instance_;
428
[email protected]9488d4d2012-02-29 18:32:37429 // If set before the Shell is initialized, the mouse cursor will be hidden
430 // when the screen is initially created.
431 static bool initially_hide_cursor_;
432
sky6624a7af2016-05-27 18:47:49433 std::unique_ptr<ScopedOverviewAnimationSettingsFactoryAura>
434 scoped_overview_animation_settings_factory_;
sky0702b272016-06-03 22:10:41435 std::unique_ptr<WmShellAura> wm_shell_;
sky984c1892016-04-20 00:00:34436
[email protected]1aad3322012-06-06 06:37:09437 // The CompoundEventFilter owned by aura::Env object.
dchenga94547472016-04-08 08:41:11438 std::unique_ptr<::wm::CompoundEventFilter> env_filter_;
[email protected]627a62f2012-02-14 22:59:14439
[email protected]cac10fc62011-10-07 23:22:56440 std::vector<WindowAndBoundsPair> to_restore_;
441
dchenga94547472016-04-08 08:41:11442 std::unique_ptr<UserMetricsRecorder> user_metrics_recorder_;
sky44a09892016-07-20 17:46:58443 std::unique_ptr<AcceleratorControllerDelegateAura>
444 accelerator_controller_delegate_;
dchenga94547472016-04-08 08:41:11445 std::unique_ptr<SessionStateDelegate> session_state_delegate_;
dchenga94547472016-04-08 08:41:11446 std::unique_ptr<WindowPositioner> window_positioner_;
[email protected]2b99f8c2011-10-11 19:42:24447
dchenga94547472016-04-08 08:41:11448 std::unique_ptr<DragDropController> drag_drop_controller_;
449 std::unique_ptr<ResizeShadowController> resize_shadow_controller_;
450 std::unique_ptr<::wm::ShadowController> shadow_controller_;
451 std::unique_ptr<::wm::VisibilityController> visibility_controller_;
452 std::unique_ptr<::wm::WindowModalityController> window_modality_controller_;
453 std::unique_ptr<views::corewm::TooltipController> tooltip_controller_;
yusukes1168eda2016-04-27 07:52:08454 LinkHandlerModelFactory* link_handler_model_factory_;
dchenga94547472016-04-08 08:41:11455 std::unique_ptr<PowerButtonController> power_button_controller_;
456 std::unique_ptr<LockStateController> lock_state_controller_;
dchenga94547472016-04-08 08:41:11457 std::unique_ptr<ui::UserActivityDetector> user_activity_detector_;
458 std::unique_ptr<VideoDetector> video_detector_;
dchenga94547472016-04-08 08:41:11459 std::unique_ptr<WindowTreeHostManager> window_tree_host_manager_;
460 std::unique_ptr<HighContrastController> high_contrast_controller_;
461 std::unique_ptr<MagnificationController> magnification_controller_;
dchenga94547472016-04-08 08:41:11462 std::unique_ptr<AutoclickController> autoclick_controller_;
463 std::unique_ptr<aura::client::FocusClient> focus_client_;
mfomitchev493ed602016-04-09 00:48:39464
[email protected]39718b52012-12-03 17:24:56465 aura::client::ActivationClient* activation_client_;
sky984c1892016-04-20 00:00:34466
oshima5a296e82016-04-29 01:32:27467 std::unique_ptr<ScreenshotController> screenshot_controller_;
[email protected]f5c9dbc2014-04-11 08:13:45468
dchenga94547472016-04-08 08:41:11469 std::unique_ptr<MouseCursorEventFilter> mouse_cursor_filter_;
470 std::unique_ptr<ScreenPositionController> screen_position_controller_;
471 std::unique_ptr<SystemModalContainerEventFilter> modality_filter_;
472 std::unique_ptr<EventClientImpl> event_client_;
473 std::unique_ptr<EventTransformationHandler> event_transformation_handler_;
[email protected]ae18b9112011-11-07 16:59:13474
[email protected]0b0b0742012-02-16 13:23:45475 // An event filter that pre-handles key events while the partial
[email protected]a1584a712012-07-30 21:02:26476 // screenshot UI or the keyboard overlay is active.
dchenga94547472016-04-08 08:41:11477 std::unique_ptr<OverlayEventFilter> overlay_filter_;
[email protected]0b0b0742012-02-16 13:23:45478
[email protected]3537d472014-01-15 05:45:31479 // An event filter which handles moving and resizing windows.
dchenga94547472016-04-08 08:41:11480 std::unique_ptr<ToplevelWindowEventHandler> toplevel_window_event_handler_;
[email protected]3537d472014-01-15 05:45:31481
[email protected]435b212e2012-04-05 19:43:37482 // An event filter which handles system level gestures
dchenga94547472016-04-08 08:41:11483 std::unique_ptr<SystemGestureEventFilter> system_gesture_filter_;
[email protected]435b212e2012-04-05 19:43:37484
[email protected]745816be2011-11-22 05:08:30485 // An event filter that pre-handles global accelerators.
dchenga94547472016-04-08 08:41:11486 std::unique_ptr<::wm::AcceleratorFilter> accelerator_filter_;
[email protected]745816be2011-11-22 05:08:30487
rjkroege72f8154f2016-10-29 00:49:02488 std::unique_ptr<display::DisplayManager> display_manager_;
dchenga94547472016-04-08 08:41:11489 std::unique_ptr<DisplayConfigurationController>
490 display_configuration_controller_;
[email protected]6bdf7952012-11-14 10:10:58491
hidehiko6821ca42016-06-18 11:12:23492 std::unique_ptr<ScreenPinningController> screen_pinning_controller_;
[email protected]a9a40462013-07-31 06:22:56493
[email protected]ded58fd2013-10-09 07:56:55494#if defined(OS_CHROMEOS)
dchenga94547472016-04-08 08:41:11495 std::unique_ptr<PowerEventObserver> power_event_observer_;
496 std::unique_ptr<ui::UserActivityPowerManagerNotifier> user_activity_notifier_;
497 std::unique_ptr<VideoActivityNotifier> video_activity_notifier_;
498 std::unique_ptr<StickyKeysController> sticky_keys_controller_;
499 std::unique_ptr<ResolutionNotificationController>
[email protected]7bc49bd2014-01-22 09:30:34500 resolution_notification_controller_;
dchenga94547472016-04-08 08:41:11501 std::unique_ptr<BluetoothNotificationController>
[email protected]b3142722014-03-04 06:59:50502 bluetooth_notification_controller_;
dchenga94547472016-04-08 08:41:11503 std::unique_ptr<VirtualKeyboardController> virtual_keyboard_controller_;
warx533c8f62016-04-12 01:19:43504 std::unique_ptr<chromeos::AudioA11yController> audio_a11y_controller_;
[email protected]70b3e7d52012-06-02 22:12:25505 // Controls video output device state.
dchenga94547472016-04-08 08:41:11506 std::unique_ptr<ui::DisplayConfigurator> display_configurator_;
507 std::unique_ptr<DisplayColorManager> display_color_manager_;
508 std::unique_ptr<DisplayErrorObserver> display_error_observer_;
509 std::unique_ptr<ProjectingObserver> projecting_observer_;
[email protected]6bdf7952012-11-14 10:10:58510
[email protected]c1234a42013-08-20 09:35:40511 // Listens for output changes and updates the display manager.
dchenga94547472016-04-08 08:41:11512 std::unique_ptr<DisplayChangeObserver> display_change_observer_;
[email protected]3dff2ef2014-02-09 22:50:39513
kylechar98748a52016-12-03 01:33:22514 // Listens for shutdown and updates DisplayConfigurator.
515 std::unique_ptr<ShutdownObserver> shutdown_observer_;
516
jonross0af45212015-01-13 18:55:46517 // Implements content::ScreenOrientationController for ChromeOS
dchenga94547472016-04-08 08:41:11518 std::unique_ptr<ScreenOrientationController> screen_orientation_controller_;
yiyixa68ade512016-09-01 17:38:13519 std::unique_ptr<ScreenLayoutObserver> screen_layout_observer_;
jonrossf21fea12014-11-13 01:22:51520
dchenga94547472016-04-08 08:41:11521 std::unique_ptr<TouchTransformerController> touch_transformer_controller_;
dnicoara8c3bd1e62014-10-30 19:53:39522
dchenga94547472016-04-08 08:41:11523 std::unique_ptr<ui::EventHandler> magnifier_key_scroll_handler_;
524 std::unique_ptr<ui::EventHandler> speech_feedback_handler_;
sammiequon203ae022016-09-18 17:23:42525 std::unique_ptr<LaserPointerController> laser_pointer_controller_;
526 std::unique_ptr<PartialMagnificationController>
527 partial_magnification_controller_;
[email protected]ded58fd2013-10-09 07:56:55528#endif // defined(OS_CHROMEOS)
[email protected]70b3e7d52012-06-02 22:12:25529
[email protected]c0ff0342013-02-27 00:41:29530 // |native_cursor_manager_| is owned by |cursor_manager_|, but we keep a
531 // pointer to vend to test code.
532 AshNativeCursorManager* native_cursor_manager_;
[email protected]e76096a5f2014-04-08 04:08:03533
sadrul7a8785e2016-02-12 21:54:35534 // Cursor may be hidden on certain key events in ChromeOS, whereas we never
535 // hide the cursor on Windows.
dchenga94547472016-04-08 08:41:11536 std::unique_ptr<::wm::CursorManager> cursor_manager_;
[email protected]4b8003c2012-07-26 00:54:19537
[email protected]852a55d2012-10-17 13:30:30538 // For testing only: simulate that a modal window is open
539 bool simulate_modal_window_open_for_testing_;
540
[email protected]2b8a9bb2013-07-01 22:43:40541 bool is_touch_hud_projection_enabled_;
542
[email protected]1d2a7212014-01-16 06:09:48543 // Injected content::GPUDataManager support.
dchenga94547472016-04-08 08:41:11544 std::unique_ptr<GPUSupport> gpu_support_;
[email protected]1d2a7212014-01-16 06:09:48545
skyb7b54092016-08-19 16:00:09546 std::unique_ptr<ImmersiveHandlerFactoryAsh> immersive_handler_factory_;
547
[email protected]87b0d82e2011-10-07 21:02:59548 DISALLOW_COPY_AND_ASSIGN(Shell);
549};
550
[email protected]55f593352011-12-24 05:42:46551} // namespace ash
[email protected]87b0d82e2011-10-07 21:02:59552
[email protected]b65bdda2011-12-23 23:35:31553#endif // ASH_SHELL_H_