[email protected] | d90b839 | 2012-06-13 09:34:56 | [diff] [blame] | 1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #ifndef ASH_ROOT_WINDOW_CONTROLLER_H_ |
| 6 | #define ASH_ROOT_WINDOW_CONTROLLER_H_ |
[email protected] | d90b839 | 2012-06-13 09:34:56 | [diff] [blame] | 7 | |
[email protected] | 2b8a9bb | 2013-07-01 22:43:40 | [diff] [blame] | 8 | #include <map> |
dcheng | a9454747 | 2016-04-08 08:41:11 | [diff] [blame] | 9 | #include <memory> |
sky | abcae81 | 2017-01-18 17:01:34 | [diff] [blame] | 10 | #include <vector> |
[email protected] | 2b8a9bb | 2013-07-01 22:43:40 | [diff] [blame] | 11 | |
[email protected] | c0ce80e | 2012-10-05 23:28:27 | [diff] [blame] | 12 | #include "ash/ash_export.h" |
jamescook | d4649fa | 2016-09-30 17:50:09 | [diff] [blame] | 13 | #include "ash/public/cpp/shelf_types.h" |
James Cook | b0bf8e8 | 2017-04-09 17:01:44 | [diff] [blame] | 14 | #include "ash/shell_observer.h" |
| 15 | #include "ash/wm/workspace/workspace_types.h" |
avi | db567a8a | 2015-12-20 17:07:24 | [diff] [blame] | 16 | #include "base/macros.h" |
[email protected] | f7c05b2 | 2013-11-12 21:07:24 | [diff] [blame] | 17 | #include "ui/aura/window.h" |
[email protected] | 2f262033 | 2014-02-28 10:07:38 | [diff] [blame] | 18 | #include "ui/aura/window_tree_host.h" |
[email protected] | d90b839 | 2012-06-13 09:34:56 | [diff] [blame] | 19 | |
[email protected] | d90b839 | 2012-06-13 09:34:56 | [diff] [blame] | 20 | namespace aura { |
[email protected] | d90b839 | 2012-06-13 09:34:56 | [diff] [blame] | 21 | class Window; |
[email protected] | 4a59e4e | 2012-11-12 21:15:40 | [diff] [blame] | 22 | } |
| 23 | |
| 24 | namespace gfx { |
| 25 | class Point; |
| 26 | } |
| 27 | |
[email protected] | 86459e2c | 2013-04-10 13:39:24 | [diff] [blame] | 28 | namespace keyboard { |
| 29 | class KeyboardController; |
| 30 | } |
| 31 | |
[email protected] | 3537d47 | 2014-01-15 05:45:31 | [diff] [blame] | 32 | namespace ui { |
| 33 | class EventHandler; |
sky | b664383 | 2017-01-11 22:08:45 | [diff] [blame] | 34 | class MenuModel; |
sky | 00f98a37 | 2017-01-11 06:03:49 | [diff] [blame] | 35 | class WindowTreeHost; |
[email protected] | 3537d47 | 2014-01-15 05:45:31 | [diff] [blame] | 36 | } |
| 37 | |
[email protected] | e319c7e | 2014-03-14 19:56:14 | [diff] [blame] | 38 | namespace views { |
sky | b664383 | 2017-01-11 22:08:45 | [diff] [blame] | 39 | class MenuModelAdapter; |
| 40 | class MenuRunner; |
Scott Violet | 66193f7 | 2017-06-26 22:24:18 | [diff] [blame^] | 41 | class Widget; |
[email protected] | e319c7e | 2014-03-14 19:56:14 | [diff] [blame] | 42 | } |
| 43 | |
| 44 | namespace wm { |
[email protected] | e319c7e | 2014-03-14 19:56:14 | [diff] [blame] | 45 | class ScopedCaptureClient; |
| 46 | } |
| 47 | |
[email protected] | d90b839 | 2012-06-13 09:34:56 | [diff] [blame] | 48 | namespace ash { |
sky | b664383 | 2017-01-11 22:08:45 | [diff] [blame] | 49 | class AlwaysOnTopController; |
| 50 | class AnimatingWallpaperWidgetController; |
jamescook | 01bf23e7 | 2017-01-09 19:58:15 | [diff] [blame] | 51 | class AshTouchExplorationManager; |
[email protected] | f5c9dbc | 2014-04-11 08:13:45 | [diff] [blame] | 52 | class AshWindowTreeHost; |
jamescook | 01bf23e7 | 2017-01-09 19:58:15 | [diff] [blame] | 53 | class BootSplashScreen; |
msw | b241605 | 2016-06-24 21:23:45 | [diff] [blame] | 54 | enum class LoginStatus; |
[email protected] | e74aaf0a | 2012-10-12 18:42:28 | [diff] [blame] | 55 | class PanelLayoutManager; |
James Cook | 840177e | 2017-05-25 02:20:01 | [diff] [blame] | 56 | class Shelf; |
[email protected] | e74aaf0a | 2012-10-12 18:42:28 | [diff] [blame] | 57 | class ShelfLayoutManager; |
[email protected] | 093b8d64 | 2014-04-03 20:59:28 | [diff] [blame] | 58 | class StackingController; |
[email protected] | e74aaf0a | 2012-10-12 18:42:28 | [diff] [blame] | 59 | class StatusAreaWidget; |
sky | b664383 | 2017-01-11 22:08:45 | [diff] [blame] | 60 | class SystemModalContainerLayoutManager; |
[email protected] | 093b8d64 | 2014-04-03 20:59:28 | [diff] [blame] | 61 | class SystemTray; |
msw | 607227f8 | 2016-08-30 17:22:39 | [diff] [blame] | 62 | class SystemWallpaperController; |
[email protected] | 2b8a9bb | 2013-07-01 22:43:40 | [diff] [blame] | 63 | class TouchHudDebug; |
| 64 | class TouchHudProjection; |
sky | b664383 | 2017-01-11 22:08:45 | [diff] [blame] | 65 | class WallpaperWidgetController; |
[email protected] | d90b839 | 2012-06-13 09:34:56 | [diff] [blame] | 66 | class WorkspaceController; |
| 67 | |
sky | 00f98a37 | 2017-01-11 06:03:49 | [diff] [blame] | 68 | namespace mus { |
sky | 8a8ffd2 | 2017-01-19 15:55:29 | [diff] [blame] | 69 | class WindowManager; |
sky | 00f98a37 | 2017-01-11 06:03:49 | [diff] [blame] | 70 | } |
| 71 | |
sky | b664383 | 2017-01-11 22:08:45 | [diff] [blame] | 72 | namespace wm { |
| 73 | class RootWindowLayoutManager; |
| 74 | } |
| 75 | |
[email protected] | d90b839 | 2012-06-13 09:34:56 | [diff] [blame] | 76 | // This class maintains the per root window state for ash. This class |
| 77 | // owns the root window and other dependent objects that should be |
[email protected] | a273d33a | 2013-10-17 12:41:21 | [diff] [blame] | 78 | // deleted upon the deletion of the root window. This object is |
oshima | e281892 | 2015-07-28 01:18:52 | [diff] [blame] | 79 | // indirectly owned and deleted by |WindowTreeHostManager|. |
[email protected] | a273d33a | 2013-10-17 12:41:21 | [diff] [blame] | 80 | // The RootWindowController for particular root window is stored in |
| 81 | // its property (RootWindowSettings) and can be obtained using |
msw | 257a6a23 | 2017-06-01 01:46:30 | [diff] [blame] | 82 | // |RootWindowController::ForWindow(aura::Window*)| function. |
[email protected] | d141b92 | 2013-07-09 08:13:17 | [diff] [blame] | 83 | class ASH_EXPORT RootWindowController : public ShellObserver { |
[email protected] | d90b839 | 2012-06-13 09:34:56 | [diff] [blame] | 84 | public: |
sky | 00f98a37 | 2017-01-11 06:03:49 | [diff] [blame] | 85 | // Enumerates the type of display. If there is only a single display then |
| 86 | // it is primary. In a multi-display environment one monitor is deemed the |
| 87 | // PRIMARY and all others SECONDARY. |
| 88 | enum class RootWindowType { PRIMARY, SECONDARY }; |
| 89 | |
| 90 | ~RootWindowController() override; |
| 91 | |
[email protected] | a273d33a | 2013-10-17 12:41:21 | [diff] [blame] | 92 | // Creates and Initialize the RootWindowController for primary display. |
[email protected] | f5c9dbc | 2014-04-11 08:13:45 | [diff] [blame] | 93 | static void CreateForPrimaryDisplay(AshWindowTreeHost* host); |
[email protected] | a273d33a | 2013-10-17 12:41:21 | [diff] [blame] | 94 | |
| 95 | // Creates and Initialize the RootWindowController for secondary displays. |
[email protected] | f5c9dbc | 2014-04-11 08:13:45 | [diff] [blame] | 96 | static void CreateForSecondaryDisplay(AshWindowTreeHost* host); |
[email protected] | d90b839 | 2012-06-13 09:34:56 | [diff] [blame] | 97 | |
[email protected] | a0afeb1 | 2012-12-10 22:57:09 | [diff] [blame] | 98 | // Returns a RootWindowController of the window's root window. |
[email protected] | ccff3d7 | 2013-02-06 04:26:28 | [diff] [blame] | 99 | static RootWindowController* ForWindow(const aura::Window* window); |
[email protected] | a0afeb1 | 2012-12-10 22:57:09 | [diff] [blame] | 100 | |
[email protected] | d17642d | 2013-09-12 23:44:38 | [diff] [blame] | 101 | // Returns the RootWindowController of the target root window. |
[email protected] | 093b8d64 | 2014-04-03 20:59:28 | [diff] [blame] | 102 | static RootWindowController* ForTargetRootWindow(); |
[email protected] | a0afeb1 | 2012-12-10 22:57:09 | [diff] [blame] | 103 | |
sky | abcae81 | 2017-01-18 17:01:34 | [diff] [blame] | 104 | static std::vector<RootWindowController*> root_window_controllers() { |
| 105 | return root_window_controllers_ ? *root_window_controllers_ |
| 106 | : std::vector<RootWindowController*>(); |
| 107 | } |
| 108 | |
sky | 00f98a37 | 2017-01-11 06:03:49 | [diff] [blame] | 109 | // TODO(sky): move these to a separate class or use AshWindowTreeHost in |
| 110 | // mash. http://crbug.com/671246. |
[email protected] | f5c9dbc | 2014-04-11 08:13:45 | [diff] [blame] | 111 | AshWindowTreeHost* ash_host() { return ash_host_.get(); } |
| 112 | const AshWindowTreeHost* ash_host() const { return ash_host_.get(); } |
| 113 | |
| 114 | aura::WindowTreeHost* GetHost(); |
| 115 | const aura::WindowTreeHost* GetHost() const; |
| 116 | aura::Window* GetRootWindow(); |
| 117 | const aura::Window* GetRootWindow() const; |
[email protected] | d90b839 | 2012-06-13 09:34:56 | [diff] [blame] | 118 | |
sky | b664383 | 2017-01-11 22:08:45 | [diff] [blame] | 119 | WorkspaceController* workspace_controller() { |
| 120 | return workspace_controller_.get(); |
| 121 | } |
| 122 | |
| 123 | wm::WorkspaceWindowState GetWorkspaceWindowState(); |
[email protected] | d90b839 | 2012-06-13 09:34:56 | [diff] [blame] | 124 | |
James Cook | 840177e | 2017-05-25 02:20:01 | [diff] [blame] | 125 | Shelf* shelf() const { return shelf_.get(); } |
jamescook | be6ed82 | 2016-06-06 20:08:55 | [diff] [blame] | 126 | |
jamescook | 788b4fc | 2017-05-18 16:16:06 | [diff] [blame] | 127 | // Initializes the shelf for this root window and notifies observers. |
| 128 | void InitializeShelf(); |
sky | b664383 | 2017-01-11 22:08:45 | [diff] [blame] | 129 | |
[email protected] | 2b8a9bb | 2013-07-01 22:43:40 | [diff] [blame] | 130 | // Get touch HUDs associated with this root window controller. |
jamescook | b8dcef52 | 2016-06-25 14:42:55 | [diff] [blame] | 131 | TouchHudDebug* touch_hud_debug() const { return touch_hud_debug_; } |
[email protected] | 2b8a9bb | 2013-07-01 22:43:40 | [diff] [blame] | 132 | TouchHudProjection* touch_hud_projection() const { |
| 133 | return touch_hud_projection_; |
| 134 | } |
| 135 | |
| 136 | // Set touch HUDs for this root window controller. The root window controller |
| 137 | // will not own the HUDs; their lifetimes are managed by themselves. Whenever |
| 138 | // the widget showing a HUD is being destroyed (e.g. because of detaching a |
| 139 | // display), the HUD deletes itself. |
jamescook | b8dcef52 | 2016-06-25 14:42:55 | [diff] [blame] | 140 | void set_touch_hud_debug(TouchHudDebug* hud) { touch_hud_debug_ = hud; } |
[email protected] | 2b8a9bb | 2013-07-01 22:43:40 | [diff] [blame] | 141 | void set_touch_hud_projection(TouchHudProjection* hud) { |
| 142 | touch_hud_projection_ = hud; |
| 143 | } |
| 144 | |
sky | b664383 | 2017-01-11 22:08:45 | [diff] [blame] | 145 | PanelLayoutManager* panel_layout_manager() { return panel_layout_manager_; } |
| 146 | |
| 147 | wm::RootWindowLayoutManager* root_window_layout_manager() { |
| 148 | return root_window_layout_manager_; |
| 149 | } |
| 150 | |
[email protected] | 478c6c3 | 2013-03-09 02:50:58 | [diff] [blame] | 151 | // Access the shelf layout manager associated with this root |
| 152 | // window controller, NULL if no such shelf exists. |
| 153 | ShelfLayoutManager* GetShelfLayoutManager(); |
[email protected] | d90b839 | 2012-06-13 09:34:56 | [diff] [blame] | 154 | |
sky | b664383 | 2017-01-11 22:08:45 | [diff] [blame] | 155 | // Returns the layout manager for the appropriate modal-container. If the |
| 156 | // window is inside the lockscreen modal container, then the layout manager |
| 157 | // for that is returned. Otherwise the layout manager for the default modal |
| 158 | // container is returned. |
| 159 | // If no window is specified (i.e. |window| is null), then the lockscreen |
| 160 | // modal container is used if the screen is currently locked. Otherwise, the |
| 161 | // default modal container is used. |
| 162 | SystemModalContainerLayoutManager* GetSystemModalLayoutManager( |
sky | 97f9a743 | 2017-05-09 05:14:31 | [diff] [blame] | 163 | aura::Window* window); |
sky | b664383 | 2017-01-11 22:08:45 | [diff] [blame] | 164 | |
| 165 | AlwaysOnTopController* always_on_top_controller() { |
| 166 | return always_on_top_controller_.get(); |
| 167 | } |
| 168 | |
jamescook | b551aba | 2016-09-01 01:00:16 | [diff] [blame] | 169 | // May return null, for example for a secondary monitor at the login screen. |
| 170 | StatusAreaWidget* GetStatusAreaWidget(); |
| 171 | |
[email protected] | a0afeb1 | 2012-12-10 22:57:09 | [diff] [blame] | 172 | // Returns the system tray on this root window. Note that |
[email protected] | 864b5855 | 2013-12-19 04:19:38 | [diff] [blame] | 173 | // calling this on the root window that doesn't have a shelf will |
[email protected] | a0afeb1 | 2012-12-10 22:57:09 | [diff] [blame] | 174 | // lead to a crash. |
| 175 | SystemTray* GetSystemTray(); |
| 176 | |
oshima | 9a61ecf | 2016-06-18 10:43:05 | [diff] [blame] | 177 | // True if the window can receive events on this root window. |
| 178 | bool CanWindowReceiveEvents(aura::Window* window); |
| 179 | |
sky | b664383 | 2017-01-11 22:08:45 | [diff] [blame] | 180 | // Returns the window events will be targeted at for the specified location |
| 181 | // (in screen coordinates). |
| 182 | // |
| 183 | // NOTE: the returned window may not contain the location as resize handles |
| 184 | // may extend outside the bounds of the window. |
sky | 4befdb0d | 2017-05-18 23:50:26 | [diff] [blame] | 185 | aura::Window* FindEventTarget(const gfx::Point& location_in_screen); |
sky | b664383 | 2017-01-11 22:08:45 | [diff] [blame] | 186 | |
| 187 | // Gets the last location seen in a mouse event in this root window's |
| 188 | // coordinates. This may return a point outside the root window's bounds. |
| 189 | gfx::Point GetLastMouseLocationInRoot(); |
| 190 | |
[email protected] | d90b839 | 2012-06-13 09:34:56 | [diff] [blame] | 191 | aura::Window* GetContainer(int container_id); |
[email protected] | d8a2495 | 2013-08-05 20:05:05 | [diff] [blame] | 192 | const aura::Window* GetContainer(int container_id) const; |
[email protected] | d90b839 | 2012-06-13 09:34:56 | [diff] [blame] | 193 | |
sky | b664383 | 2017-01-11 22:08:45 | [diff] [blame] | 194 | WallpaperWidgetController* wallpaper_widget_controller() { |
| 195 | return wallpaper_widget_controller_.get(); |
| 196 | } |
| 197 | void SetWallpaperWidgetController(WallpaperWidgetController* controller); |
| 198 | |
| 199 | AnimatingWallpaperWidgetController* animating_wallpaper_widget_controller() { |
| 200 | return animating_wallpaper_widget_controller_.get(); |
| 201 | } |
| 202 | void SetAnimatingWallpaperWidgetController( |
| 203 | AnimatingWallpaperWidgetController* controller); |
| 204 | |
[email protected] | bca9a7e | 2012-11-10 06:25:49 | [diff] [blame] | 205 | // Called when the brightness/grayscale animation from white to the login |
msw | 607227f8 | 2016-08-30 17:22:39 | [diff] [blame] | 206 | // wallpaper image has started. Starts |boot_splash_screen_|'s hiding |
| 207 | // animation (if the screen is non-NULL). |
msw | 3f439af | 2016-09-08 22:35:26 | [diff] [blame] | 208 | void OnInitialWallpaperAnimationStarted(); |
[email protected] | bca9a7e | 2012-11-10 06:25:49 | [diff] [blame] | 209 | |
msw | 607227f8 | 2016-08-30 17:22:39 | [diff] [blame] | 210 | // Called when the wallpaper animation is finished. Updates |
| 211 | // |system_wallpaper_| to be black and drops |boot_splash_screen_| and moves |
| 212 | // the wallpaper controller into the root window controller. |widget| holds |
| 213 | // the wallpaper image, or NULL if the wallpaper is a solid color. |
[email protected] | 0bf6173 | 2013-07-02 04:35:10 | [diff] [blame] | 214 | void OnWallpaperAnimationFinished(views::Widget* widget); |
[email protected] | d90b839 | 2012-06-13 09:34:56 | [diff] [blame] | 215 | |
[email protected] | 6675e1c | 2012-09-11 09:15:45 | [diff] [blame] | 216 | // Deletes associated objects and clears the state, but doesn't delete |
| 217 | // the root window yet. This is used to delete a secondary displays' |
| 218 | // root window safely when the display disconnect signal is received, |
gab | 2998ee7 | 2017-05-05 16:23:50 | [diff] [blame] | 219 | // which may come while we're in the nested run loop. |
[email protected] | 6675e1c | 2012-09-11 09:15:45 | [diff] [blame] | 220 | void Shutdown(); |
| 221 | |
[email protected] | d90b839 | 2012-06-13 09:34:56 | [diff] [blame] | 222 | // Deletes all child windows and performs necessary cleanup. |
| 223 | void CloseChildWindows(); |
| 224 | |
[email protected] | f185312 | 2012-06-27 16:21:26 | [diff] [blame] | 225 | // Moves child windows to |dest|. |
[email protected] | bf9cdb36 | 2013-10-25 19:22:45 | [diff] [blame] | 226 | void MoveWindowsTo(aura::Window* dest); |
[email protected] | f185312 | 2012-06-27 16:21:26 | [diff] [blame] | 227 | |
[email protected] | e74aaf0a | 2012-10-12 18:42:28 | [diff] [blame] | 228 | // Force the shelf to query for it's current visibility state. |
| 229 | void UpdateShelfVisibility(); |
| 230 | |
[email protected] | 2b8a9bb | 2013-07-01 22:43:40 | [diff] [blame] | 231 | // Initialize touch HUDs if necessary. |
| 232 | void InitTouchHuds(); |
| 233 | |
[email protected] | 2c9171d2 | 2013-12-10 21:55:10 | [diff] [blame] | 234 | // Returns the topmost window or one of its transient parents, if any of them |
| 235 | // are in fullscreen mode. |
varkha | d99fa94f | 2015-06-29 22:35:46 | [diff] [blame] | 236 | aura::Window* GetWindowForFullscreenMode(); |
[email protected] | 2ee2f5d | 2013-01-10 23:37:16 | [diff] [blame] | 237 | |
[email protected] | b6ba05d90 | 2013-10-04 21:38:45 | [diff] [blame] | 238 | // Activate virtual keyboard on current root window controller. |
| 239 | void ActivateKeyboard(keyboard::KeyboardController* keyboard_controller); |
| 240 | |
| 241 | // Deactivate virtual keyboard on current root window controller. |
| 242 | void DeactivateKeyboard(keyboard::KeyboardController* keyboard_controller); |
| 243 | |
[email protected] | 602022b | 2014-03-31 17:07:31 | [diff] [blame] | 244 | // Tests if a window is associated with the virtual keyboard. |
| 245 | bool IsVirtualKeyboardWindow(aura::Window* window); |
| 246 | |
dmazzoni | ff86e347 | 2016-06-03 19:52:32 | [diff] [blame] | 247 | // If touch exploration is enabled, update the touch exploration |
| 248 | // controller so that synthesized touch events are anchored at this point. |
| 249 | void SetTouchAccessibilityAnchorPoint(const gfx::Point& anchor_point); |
| 250 | |
sky | b664383 | 2017-01-11 22:08:45 | [diff] [blame] | 251 | // Shows a context menu at the |location_in_screen|. |
| 252 | void ShowContextMenu(const gfx::Point& location_in_screen, |
| 253 | ui::MenuSourceType source_type); |
| 254 | |
| 255 | // Called when the login status changes after login (such as lock/unlock). |
sky | b664383 | 2017-01-11 22:08:45 | [diff] [blame] | 256 | void UpdateAfterLoginStatusChange(LoginStatus status); |
| 257 | |
[email protected] | 431552c | 2012-10-23 00:38:33 | [diff] [blame] | 258 | private: |
sky | 00f98a37 | 2017-01-11 06:03:49 | [diff] [blame] | 259 | // TODO(sky): remove this. Temporary during ash-mus unification. |
| 260 | // http://crbug.com/671246. |
sky | 8a8ffd2 | 2017-01-19 15:55:29 | [diff] [blame] | 261 | friend class mus::WindowManager; |
sky | 00f98a37 | 2017-01-11 06:03:49 | [diff] [blame] | 262 | |
| 263 | // Creates a new RootWindowController with the specified host. Only one of |
| 264 | // |ash_host| or |window_tree_host| should be specified. This takes ownership |
| 265 | // of the supplied arguments. |
| 266 | // TODO(sky): mash should create AshWindowTreeHost, http://crbug.com/671246. |
| 267 | RootWindowController(AshWindowTreeHost* ash_host, |
| 268 | aura::WindowTreeHost* window_tree_host); |
[email protected] | a273d33a | 2013-10-17 12:41:21 | [diff] [blame] | 269 | |
jamescook | fda15900 | 2016-10-21 18:48:57 | [diff] [blame] | 270 | // Initializes the RootWindowController based on |root_window_type|. |
| 271 | void Init(RootWindowType root_window_type); |
[email protected] | a273d33a | 2013-10-17 12:41:21 | [diff] [blame] | 272 | |
[email protected] | 756bda1 | 2013-07-03 08:17:06 | [diff] [blame] | 273 | void InitLayoutManagers(); |
| 274 | |
varkha | 515b4346 | 2017-05-26 23:21:27 | [diff] [blame] | 275 | // Creates the containers (aura::Windows) used by the shell. |
sky | b664383 | 2017-01-11 22:08:45 | [diff] [blame] | 276 | void CreateContainers(); |
| 277 | |
msw | 607227f8 | 2016-08-30 17:22:39 | [diff] [blame] | 278 | // Initializes |system_wallpaper_| and possibly also |boot_splash_screen_|. |
jamescook | fda15900 | 2016-10-21 18:48:57 | [diff] [blame] | 279 | // The initial color is determined by the |root_window_type| and whether or |
| 280 | // not this is the first boot. |
| 281 | void CreateSystemWallpaper(RootWindowType root_window_type); |
[email protected] | 756bda1 | 2013-07-03 08:17:06 | [diff] [blame] | 282 | |
[email protected] | d141b92 | 2013-07-09 08:13:17 | [diff] [blame] | 283 | // Enables projection touch HUD. |
| 284 | void EnableTouchHudProjection(); |
| 285 | |
| 286 | // Disables projection touch HUD. |
| 287 | void DisableTouchHudProjection(); |
| 288 | |
sky | 2734438 | 2017-03-08 21:30:32 | [diff] [blame] | 289 | // Resets Shell::GetRootWindowForNewWindows() if appropriate. This is called |
sky | b664383 | 2017-01-11 22:08:45 | [diff] [blame] | 290 | // during shutdown to make sure GetRootWindowForNewWindows() isn't referencing |
| 291 | // this. |
| 292 | void ResetRootForNewWindowsIfNecessary(); |
| 293 | |
| 294 | // Callback for MenuModelAdapter. |
| 295 | void OnMenuClosed(); |
sky | 8d971a0a | 2016-09-21 23:37:57 | [diff] [blame] | 296 | |
[email protected] | d141b92 | 2013-07-09 08:13:17 | [diff] [blame] | 297 | // Overridden from ShellObserver. |
dcheng | 1f4538e | 2014-10-27 23:57:05 | [diff] [blame] | 298 | void OnTouchHudProjectionToggled(bool enabled) override; |
[email protected] | d141b92 | 2013-07-09 08:13:17 | [diff] [blame] | 299 | |
dcheng | a9454747 | 2016-04-08 08:41:11 | [diff] [blame] | 300 | std::unique_ptr<AshWindowTreeHost> ash_host_; |
sky | 00f98a37 | 2017-01-11 06:03:49 | [diff] [blame] | 301 | std::unique_ptr<aura::WindowTreeHost> mus_window_tree_host_; |
| 302 | // This comes from |ash_host_| or |mus_window_tree_host_|. |
| 303 | aura::WindowTreeHost* window_tree_host_; |
sky | ee78dde | 2016-06-01 01:21:43 | [diff] [blame] | 304 | |
sky | b664383 | 2017-01-11 22:08:45 | [diff] [blame] | 305 | // LayoutManagers are owned by the window they are installed on. |
sky | b664383 | 2017-01-11 22:08:45 | [diff] [blame] | 306 | PanelLayoutManager* panel_layout_manager_ = nullptr; |
| 307 | wm::RootWindowLayoutManager* root_window_layout_manager_ = nullptr; |
| 308 | |
| 309 | std::unique_ptr<WallpaperWidgetController> wallpaper_widget_controller_; |
| 310 | std::unique_ptr<AnimatingWallpaperWidgetController> |
| 311 | animating_wallpaper_widget_controller_; |
| 312 | std::unique_ptr<WorkspaceController> workspace_controller_; |
| 313 | |
| 314 | std::unique_ptr<AlwaysOnTopController> always_on_top_controller_; |
| 315 | |
| 316 | // Manages the context menu. |
| 317 | std::unique_ptr<ui::MenuModel> menu_model_; |
| 318 | std::unique_ptr<views::MenuModelAdapter> menu_model_adapter_; |
| 319 | std::unique_ptr<views::MenuRunner> menu_runner_; |
sky | ee78dde | 2016-06-01 01:21:43 | [diff] [blame] | 320 | |
dcheng | a9454747 | 2016-04-08 08:41:11 | [diff] [blame] | 321 | std::unique_ptr<StackingController> stacking_controller_; |
[email protected] | 2a2caa0 | 2013-01-22 20:50:36 | [diff] [blame] | 322 | |
jamescook | be6ed82 | 2016-06-06 20:08:55 | [diff] [blame] | 323 | // The shelf controller for this root window. Exists for the entire lifetime |
| 324 | // of the RootWindowController so that it is safe for observers to be added |
| 325 | // to it during construction of the shelf widget and status tray. |
James Cook | 840177e | 2017-05-25 02:20:01 | [diff] [blame] | 326 | std::unique_ptr<Shelf> shelf_; |
jamescook | be6ed82 | 2016-06-06 20:08:55 | [diff] [blame] | 327 | |
jamescook | 788b4fc | 2017-05-18 16:16:06 | [diff] [blame] | 328 | // TODO(jamescook): Eliminate this. It is left over from legacy shelf code and |
| 329 | // doesn't mean anything in particular. |
| 330 | bool shelf_initialized_ = false; |
| 331 | |
msw | 607227f8 | 2016-08-30 17:22:39 | [diff] [blame] | 332 | std::unique_ptr<SystemWallpaperController> system_wallpaper_; |
[email protected] | a825e831 | 2014-05-05 22:05:01 | [diff] [blame] | 333 | |
dcheng | a9454747 | 2016-04-08 08:41:11 | [diff] [blame] | 334 | std::unique_ptr<BootSplashScreen> boot_splash_screen_; |
[email protected] | a825e831 | 2014-05-05 22:05:01 | [diff] [blame] | 335 | // Responsible for initializing TouchExplorationController when spoken |
| 336 | // feedback is on. |
dcheng | a9454747 | 2016-04-08 08:41:11 | [diff] [blame] | 337 | std::unique_ptr<AshTouchExplorationManager> touch_exploration_manager_; |
[email protected] | 697f04c | 2012-10-03 01:15:10 | [diff] [blame] | 338 | |
[email protected] | 2b8a9bb | 2013-07-01 22:43:40 | [diff] [blame] | 339 | // Heads-up displays for touch events. These HUDs are not owned by the root |
| 340 | // window controller and manage their own lifetimes. |
sky | b664383 | 2017-01-11 22:08:45 | [diff] [blame] | 341 | TouchHudDebug* touch_hud_debug_ = nullptr; |
| 342 | TouchHudProjection* touch_hud_projection_ = nullptr; |
[email protected] | 5817504 | 2013-04-01 19:27:13 | [diff] [blame] | 343 | |
[email protected] | 3537d47 | 2014-01-15 05:45:31 | [diff] [blame] | 344 | // Handles double clicks on the panel window header. |
dcheng | a9454747 | 2016-04-08 08:41:11 | [diff] [blame] | 345 | std::unique_ptr<ui::EventHandler> panel_container_handler_; |
[email protected] | a4cd6d3 | 2012-09-12 03:42:13 | [diff] [blame] | 346 | |
dcheng | a9454747 | 2016-04-08 08:41:11 | [diff] [blame] | 347 | std::unique_ptr<::wm::ScopedCaptureClient> capture_client_; |
[email protected] | 0bf6173 | 2013-07-02 04:35:10 | [diff] [blame] | 348 | |
sky | abcae81 | 2017-01-18 17:01:34 | [diff] [blame] | 349 | static std::vector<RootWindowController*>* root_window_controllers_; |
| 350 | |
[email protected] | d90b839 | 2012-06-13 09:34:56 | [diff] [blame] | 351 | DISALLOW_COPY_AND_ASSIGN(RootWindowController); |
| 352 | }; |
| 353 | |
[email protected] | 76bc463 | 2014-06-16 19:07:46 | [diff] [blame] | 354 | } // namespace ash |
[email protected] | d90b839 | 2012-06-13 09:34:56 | [diff] [blame] | 355 | |
[email protected] | 76bc463 | 2014-06-16 19:07:46 | [diff] [blame] | 356 | #endif // ASH_ROOT_WINDOW_CONTROLLER_H_ |