OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef ASH_ROOT_WINDOW_CONTROLLER_H_ | 5 #ifndef ASH_ROOT_WINDOW_CONTROLLER_H_ |
6 #define ASH_ROOT_WINDOW_CONTROLLER_H_ | 6 #define ASH_ROOT_WINDOW_CONTROLLER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <memory> | 9 #include <memory> |
10 | 10 |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 namespace wm { | 45 namespace wm { |
46 class InputMethodEventFilter; | 46 class InputMethodEventFilter; |
47 class RootWindowEventFilter; | 47 class RootWindowEventFilter; |
48 class ScopedCaptureClient; | 48 class ScopedCaptureClient; |
49 } | 49 } |
50 | 50 |
51 namespace ash { | 51 namespace ash { |
52 class AshWindowTreeHost; | 52 class AshWindowTreeHost; |
53 class AlwaysOnTopController; | 53 class AlwaysOnTopController; |
54 class AnimatingDesktopController; | 54 class AnimatingDesktopController; |
55 class DesktopBackgroundWidgetController; | |
56 class DockedWindowLayoutManager; | 55 class DockedWindowLayoutManager; |
57 enum class LoginStatus; | 56 enum class LoginStatus; |
58 class PanelLayoutManager; | 57 class PanelLayoutManager; |
59 class RootWindowControllerCommon; | 58 class RootWindowControllerCommon; |
60 class Shelf; | 59 class Shelf; |
61 class ShelfLayoutManager; | 60 class ShelfLayoutManager; |
62 class ShelfWidget; | 61 class ShelfWidget; |
63 class StackingController; | 62 class StackingController; |
64 class StatusAreaWidget; | 63 class StatusAreaWidget; |
65 class SystemBackgroundController; | |
66 class SystemModalContainerLayoutManager; | 64 class SystemModalContainerLayoutManager; |
67 class SystemTray; | 65 class SystemTray; |
| 66 class SystemWallpaperController; |
68 class TouchHudDebug; | 67 class TouchHudDebug; |
69 class TouchHudProjection; | 68 class TouchHudProjection; |
| 69 class WallpaperWidgetController; |
70 class WmShelfAura; | 70 class WmShelfAura; |
71 class WmWindow; | 71 class WmWindow; |
72 class WorkspaceController; | 72 class WorkspaceController; |
73 | 73 |
74 #if defined(OS_CHROMEOS) | 74 #if defined(OS_CHROMEOS) |
75 class BootSplashScreen; | 75 class BootSplashScreen; |
76 class AshTouchExplorationManager; | 76 class AshTouchExplorationManager; |
77 #endif | 77 #endif |
78 | 78 |
79 // This class maintains the per root window state for ash. This class | 79 // This class maintains the per root window state for ash. This class |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 | 134 |
135 // Set touch HUDs for this root window controller. The root window controller | 135 // Set touch HUDs for this root window controller. The root window controller |
136 // will not own the HUDs; their lifetimes are managed by themselves. Whenever | 136 // will not own the HUDs; their lifetimes are managed by themselves. Whenever |
137 // the widget showing a HUD is being destroyed (e.g. because of detaching a | 137 // the widget showing a HUD is being destroyed (e.g. because of detaching a |
138 // display), the HUD deletes itself. | 138 // display), the HUD deletes itself. |
139 void set_touch_hud_debug(TouchHudDebug* hud) { touch_hud_debug_ = hud; } | 139 void set_touch_hud_debug(TouchHudDebug* hud) { touch_hud_debug_ = hud; } |
140 void set_touch_hud_projection(TouchHudProjection* hud) { | 140 void set_touch_hud_projection(TouchHudProjection* hud) { |
141 touch_hud_projection_ = hud; | 141 touch_hud_projection_ = hud; |
142 } | 142 } |
143 | 143 |
144 DesktopBackgroundWidgetController* wallpaper_controller() { | 144 WallpaperWidgetController* wallpaper_controller() { |
145 return wallpaper_controller_.get(); | 145 return wallpaper_controller_.get(); |
146 } | 146 } |
147 void SetWallpaperController(DesktopBackgroundWidgetController* controller); | 147 void SetWallpaperController(WallpaperWidgetController* controller); |
148 AnimatingDesktopController* animating_wallpaper_controller() { | 148 AnimatingDesktopController* animating_wallpaper_controller() { |
149 return animating_wallpaper_controller_.get(); | 149 return animating_wallpaper_controller_.get(); |
150 } | 150 } |
151 void SetAnimatingWallpaperController(AnimatingDesktopController* controller); | 151 void SetAnimatingWallpaperController(AnimatingDesktopController* controller); |
152 | 152 |
153 // Access the shelf layout manager associated with this root | 153 // Access the shelf layout manager associated with this root |
154 // window controller, NULL if no such shelf exists. | 154 // window controller, NULL if no such shelf exists. |
155 ShelfLayoutManager* GetShelfLayoutManager(); | 155 ShelfLayoutManager* GetShelfLayoutManager(); |
156 | 156 |
157 // Returns the system tray on this root window. Note that | 157 // Returns the system tray on this root window. Note that |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 | 189 |
190 // Returns the shelf controller for this root window. | 190 // Returns the shelf controller for this root window. |
191 // TODO(jamescook): Remove this and use WmRootWindowController::GetShelf(). | 191 // TODO(jamescook): Remove this and use WmRootWindowController::GetShelf(). |
192 Shelf* GetShelf() const; | 192 Shelf* GetShelf() const; |
193 | 193 |
194 // Called when the login status changes after login (such as lock/unlock). | 194 // Called when the login status changes after login (such as lock/unlock). |
195 // TODO(oshima): Investigate if we can merge this and |OnLoginStateChanged|. | 195 // TODO(oshima): Investigate if we can merge this and |OnLoginStateChanged|. |
196 void UpdateAfterLoginStatusChange(LoginStatus status); | 196 void UpdateAfterLoginStatusChange(LoginStatus status); |
197 | 197 |
198 // Called when the brightness/grayscale animation from white to the login | 198 // Called when the brightness/grayscale animation from white to the login |
199 // desktop background image has started. Starts |boot_splash_screen_|'s | 199 // wallpaper image has started. Starts |boot_splash_screen_|'s hiding |
200 // hiding animation (if the screen is non-NULL). | 200 // animation (if the screen is non-NULL). |
201 void HandleInitialDesktopBackgroundAnimationStarted(); | 201 void HandleInitialWallpaperAnimationStarted(); |
202 | 202 |
203 // Called when the wallpaper ainmation is finished. Updates |background_| | 203 // Called when the wallpaper animation is finished. Updates |
204 // to be black and drops |boot_splash_screen_| and moves the wallpaper | 204 // |system_wallpaper_| to be black and drops |boot_splash_screen_| and moves |
205 // controller into the root window controller. |widget| holds the wallpaper | 205 // the wallpaper controller into the root window controller. |widget| holds |
206 // image, or NULL if the background is a solid color. | 206 // the wallpaper image, or NULL if the wallpaper is a solid color. |
207 void OnWallpaperAnimationFinished(views::Widget* widget); | 207 void OnWallpaperAnimationFinished(views::Widget* widget); |
208 | 208 |
209 // Deletes associated objects and clears the state, but doesn't delete | 209 // Deletes associated objects and clears the state, but doesn't delete |
210 // the root window yet. This is used to delete a secondary displays' | 210 // the root window yet. This is used to delete a secondary displays' |
211 // root window safely when the display disconnect signal is received, | 211 // root window safely when the display disconnect signal is received, |
212 // which may come while we're in the nested message loop. | 212 // which may come while we're in the nested message loop. |
213 void Shutdown(); | 213 void Shutdown(); |
214 | 214 |
215 // Deletes all child windows and performs necessary cleanup. | 215 // Deletes all child windows and performs necessary cleanup. |
216 void CloseChildWindows(); | 216 void CloseChildWindows(); |
(...skipping 28 matching lines...) Expand all Loading... |
245 explicit RootWindowController(AshWindowTreeHost* host); | 245 explicit RootWindowController(AshWindowTreeHost* host); |
246 enum RootWindowType { PRIMARY, SECONDARY }; | 246 enum RootWindowType { PRIMARY, SECONDARY }; |
247 | 247 |
248 // Initializes the RootWindowController. |is_primary| is true if | 248 // Initializes the RootWindowController. |is_primary| is true if |
249 // the controller is for primary display. |first_run_after_boot| is | 249 // the controller is for primary display. |first_run_after_boot| is |
250 // set to true only for primary root window after boot. | 250 // set to true only for primary root window after boot. |
251 void Init(RootWindowType root_window_type, bool first_run_after_boot); | 251 void Init(RootWindowType root_window_type, bool first_run_after_boot); |
252 | 252 |
253 void InitLayoutManagers(); | 253 void InitLayoutManagers(); |
254 | 254 |
255 // Initializes |system_background_| and possibly also |boot_splash_screen_|. | 255 // Initializes |system_wallpaper_| and possibly also |boot_splash_screen_|. |
256 // |is_first_run_after_boot| determines the background's initial color. | 256 // |is_first_run_after_boot| determines the wallpaper's initial color. |
257 void CreateSystemBackground(bool is_first_run_after_boot); | 257 void CreateSystemWallpaper(bool is_first_run_after_boot); |
258 | 258 |
259 // Enables projection touch HUD. | 259 // Enables projection touch HUD. |
260 void EnableTouchHudProjection(); | 260 void EnableTouchHudProjection(); |
261 | 261 |
262 // Disables projection touch HUD. | 262 // Disables projection touch HUD. |
263 void DisableTouchHudProjection(); | 263 void DisableTouchHudProjection(); |
264 | 264 |
265 // Callback for MenuModelAdapter. | 265 // Callback for MenuModelAdapter. |
266 void OnMenuClosed(); | 266 void OnMenuClosed(); |
267 | 267 |
(...skipping 14 matching lines...) Expand all Loading... |
282 | 282 |
283 // Legacy shelf controller. Only present after shelf is created (post-login). | 283 // Legacy shelf controller. Only present after shelf is created (post-login). |
284 std::unique_ptr<Shelf> shelf_; | 284 std::unique_ptr<Shelf> shelf_; |
285 | 285 |
286 // The shelf widget for this root window. | 286 // The shelf widget for this root window. |
287 std::unique_ptr<ShelfWidget> shelf_widget_; | 287 std::unique_ptr<ShelfWidget> shelf_widget_; |
288 | 288 |
289 // An invisible/empty window used as a event target for | 289 // An invisible/empty window used as a event target for |
290 // |MouseCursorEventFilter| before a user logs in. | 290 // |MouseCursorEventFilter| before a user logs in. |
291 // (crbug.com/266987) | 291 // (crbug.com/266987) |
292 // Its container is |LockScreenBackgroundContainer| and | 292 // Its container is |LockScreenWallpaperContainer| and |
293 // this must be deleted before the container is deleted. | 293 // this must be deleted before the container is deleted. |
294 std::unique_ptr<aura::Window> mouse_event_target_; | 294 std::unique_ptr<aura::Window> mouse_event_target_; |
295 | 295 |
296 // Manages layout of docked windows. Owned by DockedContainer. | 296 // Manages layout of docked windows. Owned by DockedContainer. |
297 DockedWindowLayoutManager* docked_layout_manager_; | 297 DockedWindowLayoutManager* docked_layout_manager_; |
298 | 298 |
299 // Manages layout of panels. Owned by PanelContainer. | 299 // Manages layout of panels. Owned by PanelContainer. |
300 PanelLayoutManager* panel_layout_manager_; | 300 PanelLayoutManager* panel_layout_manager_; |
301 | 301 |
302 std::unique_ptr<SystemBackgroundController> system_background_; | 302 std::unique_ptr<SystemWallpaperController> system_wallpaper_; |
303 | 303 |
304 #if defined(OS_CHROMEOS) | 304 #if defined(OS_CHROMEOS) |
305 std::unique_ptr<BootSplashScreen> boot_splash_screen_; | 305 std::unique_ptr<BootSplashScreen> boot_splash_screen_; |
306 // Responsible for initializing TouchExplorationController when spoken | 306 // Responsible for initializing TouchExplorationController when spoken |
307 // feedback is on. | 307 // feedback is on. |
308 std::unique_ptr<AshTouchExplorationManager> touch_exploration_manager_; | 308 std::unique_ptr<AshTouchExplorationManager> touch_exploration_manager_; |
309 #endif | 309 #endif |
310 | 310 |
311 std::unique_ptr<WorkspaceController> workspace_controller_; | 311 std::unique_ptr<WorkspaceController> workspace_controller_; |
312 std::unique_ptr<AlwaysOnTopController> always_on_top_controller_; | 312 std::unique_ptr<AlwaysOnTopController> always_on_top_controller_; |
313 | 313 |
314 // Heads-up displays for touch events. These HUDs are not owned by the root | 314 // Heads-up displays for touch events. These HUDs are not owned by the root |
315 // window controller and manage their own lifetimes. | 315 // window controller and manage their own lifetimes. |
316 TouchHudDebug* touch_hud_debug_; | 316 TouchHudDebug* touch_hud_debug_; |
317 TouchHudProjection* touch_hud_projection_; | 317 TouchHudProjection* touch_hud_projection_; |
318 | 318 |
319 // Handles double clicks on the panel window header. | 319 // Handles double clicks on the panel window header. |
320 std::unique_ptr<ui::EventHandler> panel_container_handler_; | 320 std::unique_ptr<ui::EventHandler> panel_container_handler_; |
321 | 321 |
322 std::unique_ptr<DesktopBackgroundWidgetController> wallpaper_controller_; | 322 std::unique_ptr<WallpaperWidgetController> wallpaper_controller_; |
323 std::unique_ptr<AnimatingDesktopController> animating_wallpaper_controller_; | 323 std::unique_ptr<AnimatingDesktopController> animating_wallpaper_controller_; |
324 std::unique_ptr<::wm::ScopedCaptureClient> capture_client_; | 324 std::unique_ptr<::wm::ScopedCaptureClient> capture_client_; |
325 | 325 |
326 // Manages the context menu. | 326 // Manages the context menu. |
327 std::unique_ptr<ui::MenuModel> menu_model_; | 327 std::unique_ptr<ui::MenuModel> menu_model_; |
328 std::unique_ptr<views::MenuModelAdapter> menu_model_adapter_; | 328 std::unique_ptr<views::MenuModelAdapter> menu_model_adapter_; |
329 std::unique_ptr<views::MenuRunner> menu_runner_; | 329 std::unique_ptr<views::MenuRunner> menu_runner_; |
330 | 330 |
331 DISALLOW_COPY_AND_ASSIGN(RootWindowController); | 331 DISALLOW_COPY_AND_ASSIGN(RootWindowController); |
332 }; | 332 }; |
333 | 333 |
334 // On classic ash, returns the RootWindowController for the given |root_window|. | 334 // On classic ash, returns the RootWindowController for the given |root_window|. |
335 // On mus ash, returns the RootWindowController for the primary display. | 335 // On mus ash, returns the RootWindowController for the primary display. |
336 // See RootWindowController class comment above. | 336 // See RootWindowController class comment above. |
337 ASH_EXPORT RootWindowController* GetRootWindowController( | 337 ASH_EXPORT RootWindowController* GetRootWindowController( |
338 const aura::Window* root_window); | 338 const aura::Window* root_window); |
339 | 339 |
340 } // namespace ash | 340 } // namespace ash |
341 | 341 |
342 #endif // ASH_ROOT_WINDOW_CONTROLLER_H_ | 342 #endif // ASH_ROOT_WINDOW_CONTROLLER_H_ |
OLD | NEW |