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