| 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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 | 44 |
| 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 AnimatingWallpaperWidgetController; |
| 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_widget_controller() { |
| 145 return wallpaper_controller_.get(); | 145 return wallpaper_widget_controller_.get(); |
| 146 } | 146 } |
| 147 void SetWallpaperController(DesktopBackgroundWidgetController* controller); | 147 void SetWallpaperWidgetController(WallpaperWidgetController* controller); |
| 148 AnimatingDesktopController* animating_wallpaper_controller() { | 148 AnimatingWallpaperWidgetController* animating_wallpaper_widget_controller() { |
| 149 return animating_wallpaper_controller_.get(); | 149 return animating_wallpaper_widget_controller_.get(); |
| 150 } | 150 } |
| 151 void SetAnimatingWallpaperController(AnimatingDesktopController* controller); | 151 void SetAnimatingWallpaperWidgetController( |
| 152 AnimatingWallpaperWidgetController* controller); |
| 152 | 153 |
| 153 // Access the shelf layout manager associated with this root | 154 // Access the shelf layout manager associated with this root |
| 154 // window controller, NULL if no such shelf exists. | 155 // window controller, NULL if no such shelf exists. |
| 155 ShelfLayoutManager* GetShelfLayoutManager(); | 156 ShelfLayoutManager* GetShelfLayoutManager(); |
| 156 | 157 |
| 157 // Returns the system tray on this root window. Note that | 158 // Returns the system tray on this root window. Note that |
| 158 // calling this on the root window that doesn't have a shelf will | 159 // calling this on the root window that doesn't have a shelf will |
| 159 // lead to a crash. | 160 // lead to a crash. |
| 160 SystemTray* GetSystemTray(); | 161 SystemTray* GetSystemTray(); |
| 161 | 162 |
| (...skipping 27 matching lines...) Expand all Loading... |
| 189 | 190 |
| 190 // Returns the shelf controller for this root window. | 191 // Returns the shelf controller for this root window. |
| 191 // TODO(jamescook): Remove this and use WmRootWindowController::GetShelf(). | 192 // TODO(jamescook): Remove this and use WmRootWindowController::GetShelf(). |
| 192 Shelf* GetShelf() const; | 193 Shelf* GetShelf() const; |
| 193 | 194 |
| 194 // Called when the login status changes after login (such as lock/unlock). | 195 // Called when the login status changes after login (such as lock/unlock). |
| 195 // TODO(oshima): Investigate if we can merge this and |OnLoginStateChanged|. | 196 // TODO(oshima): Investigate if we can merge this and |OnLoginStateChanged|. |
| 196 void UpdateAfterLoginStatusChange(LoginStatus status); | 197 void UpdateAfterLoginStatusChange(LoginStatus status); |
| 197 | 198 |
| 198 // Called when the brightness/grayscale animation from white to the login | 199 // Called when the brightness/grayscale animation from white to the login |
| 199 // desktop background image has started. Starts |boot_splash_screen_|'s | 200 // wallpaper image has started. Starts |boot_splash_screen_|'s hiding |
| 200 // hiding animation (if the screen is non-NULL). | 201 // animation (if the screen is non-NULL). |
| 201 void HandleInitialDesktopBackgroundAnimationStarted(); | 202 void HandleInitialWallpaperAnimationStarted(); |
| 202 | 203 |
| 203 // Called when the wallpaper ainmation is finished. Updates |background_| | 204 // Called when the wallpaper animation is finished. Updates |
| 204 // to be black and drops |boot_splash_screen_| and moves the wallpaper | 205 // |system_wallpaper_| to be black and drops |boot_splash_screen_| and moves |
| 205 // controller into the root window controller. |widget| holds the wallpaper | 206 // the wallpaper controller into the root window controller. |widget| holds |
| 206 // image, or NULL if the background is a solid color. | 207 // the wallpaper image, or NULL if the wallpaper is a solid color. |
| 207 void OnWallpaperAnimationFinished(views::Widget* widget); | 208 void OnWallpaperAnimationFinished(views::Widget* widget); |
| 208 | 209 |
| 209 // Deletes associated objects and clears the state, but doesn't delete | 210 // Deletes associated objects and clears the state, but doesn't delete |
| 210 // the root window yet. This is used to delete a secondary displays' | 211 // the root window yet. This is used to delete a secondary displays' |
| 211 // root window safely when the display disconnect signal is received, | 212 // root window safely when the display disconnect signal is received, |
| 212 // which may come while we're in the nested message loop. | 213 // which may come while we're in the nested message loop. |
| 213 void Shutdown(); | 214 void Shutdown(); |
| 214 | 215 |
| 215 // Deletes all child windows and performs necessary cleanup. | 216 // Deletes all child windows and performs necessary cleanup. |
| 216 void CloseChildWindows(); | 217 void CloseChildWindows(); |
| (...skipping 28 matching lines...) Expand all Loading... |
| 245 explicit RootWindowController(AshWindowTreeHost* host); | 246 explicit RootWindowController(AshWindowTreeHost* host); |
| 246 enum RootWindowType { PRIMARY, SECONDARY }; | 247 enum RootWindowType { PRIMARY, SECONDARY }; |
| 247 | 248 |
| 248 // Initializes the RootWindowController. |is_primary| is true if | 249 // Initializes the RootWindowController. |is_primary| is true if |
| 249 // the controller is for primary display. |first_run_after_boot| is | 250 // the controller is for primary display. |first_run_after_boot| is |
| 250 // set to true only for primary root window after boot. | 251 // set to true only for primary root window after boot. |
| 251 void Init(RootWindowType root_window_type, bool first_run_after_boot); | 252 void Init(RootWindowType root_window_type, bool first_run_after_boot); |
| 252 | 253 |
| 253 void InitLayoutManagers(); | 254 void InitLayoutManagers(); |
| 254 | 255 |
| 255 // Initializes |system_background_| and possibly also |boot_splash_screen_|. | 256 // Initializes |system_wallpaper_| and possibly also |boot_splash_screen_|. |
| 256 // |is_first_run_after_boot| determines the background's initial color. | 257 // |is_first_run_after_boot| determines the wallpaper's initial color. |
| 257 void CreateSystemBackground(bool is_first_run_after_boot); | 258 void CreateSystemWallpaper(bool is_first_run_after_boot); |
| 258 | 259 |
| 259 // Enables projection touch HUD. | 260 // Enables projection touch HUD. |
| 260 void EnableTouchHudProjection(); | 261 void EnableTouchHudProjection(); |
| 261 | 262 |
| 262 // Disables projection touch HUD. | 263 // Disables projection touch HUD. |
| 263 void DisableTouchHudProjection(); | 264 void DisableTouchHudProjection(); |
| 264 | 265 |
| 265 // Callback for MenuModelAdapter. | 266 // Callback for MenuModelAdapter. |
| 266 void OnMenuClosed(); | 267 void OnMenuClosed(); |
| 267 | 268 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 282 | 283 |
| 283 // Legacy shelf controller. Only present after shelf is created (post-login). | 284 // Legacy shelf controller. Only present after shelf is created (post-login). |
| 284 std::unique_ptr<Shelf> shelf_; | 285 std::unique_ptr<Shelf> shelf_; |
| 285 | 286 |
| 286 // The shelf widget for this root window. | 287 // The shelf widget for this root window. |
| 287 std::unique_ptr<ShelfWidget> shelf_widget_; | 288 std::unique_ptr<ShelfWidget> shelf_widget_; |
| 288 | 289 |
| 289 // An invisible/empty window used as a event target for | 290 // An invisible/empty window used as a event target for |
| 290 // |MouseCursorEventFilter| before a user logs in. | 291 // |MouseCursorEventFilter| before a user logs in. |
| 291 // (crbug.com/266987) | 292 // (crbug.com/266987) |
| 292 // Its container is |LockScreenBackgroundContainer| and | 293 // Its container is |LockScreenWallpaperContainer| and |
| 293 // this must be deleted before the container is deleted. | 294 // this must be deleted before the container is deleted. |
| 294 std::unique_ptr<aura::Window> mouse_event_target_; | 295 std::unique_ptr<aura::Window> mouse_event_target_; |
| 295 | 296 |
| 296 // Manages layout of docked windows. Owned by DockedContainer. | 297 // Manages layout of docked windows. Owned by DockedContainer. |
| 297 DockedWindowLayoutManager* docked_layout_manager_; | 298 DockedWindowLayoutManager* docked_layout_manager_; |
| 298 | 299 |
| 299 // Manages layout of panels. Owned by PanelContainer. | 300 // Manages layout of panels. Owned by PanelContainer. |
| 300 PanelLayoutManager* panel_layout_manager_; | 301 PanelLayoutManager* panel_layout_manager_; |
| 301 | 302 |
| 302 std::unique_ptr<SystemBackgroundController> system_background_; | 303 std::unique_ptr<SystemWallpaperController> system_wallpaper_; |
| 303 | 304 |
| 304 #if defined(OS_CHROMEOS) | 305 #if defined(OS_CHROMEOS) |
| 305 std::unique_ptr<BootSplashScreen> boot_splash_screen_; | 306 std::unique_ptr<BootSplashScreen> boot_splash_screen_; |
| 306 // Responsible for initializing TouchExplorationController when spoken | 307 // Responsible for initializing TouchExplorationController when spoken |
| 307 // feedback is on. | 308 // feedback is on. |
| 308 std::unique_ptr<AshTouchExplorationManager> touch_exploration_manager_; | 309 std::unique_ptr<AshTouchExplorationManager> touch_exploration_manager_; |
| 309 #endif | 310 #endif |
| 310 | 311 |
| 311 std::unique_ptr<WorkspaceController> workspace_controller_; | 312 std::unique_ptr<WorkspaceController> workspace_controller_; |
| 312 std::unique_ptr<AlwaysOnTopController> always_on_top_controller_; | 313 std::unique_ptr<AlwaysOnTopController> always_on_top_controller_; |
| 313 | 314 |
| 314 // Heads-up displays for touch events. These HUDs are not owned by the root | 315 // Heads-up displays for touch events. These HUDs are not owned by the root |
| 315 // window controller and manage their own lifetimes. | 316 // window controller and manage their own lifetimes. |
| 316 TouchHudDebug* touch_hud_debug_; | 317 TouchHudDebug* touch_hud_debug_; |
| 317 TouchHudProjection* touch_hud_projection_; | 318 TouchHudProjection* touch_hud_projection_; |
| 318 | 319 |
| 319 // Handles double clicks on the panel window header. | 320 // Handles double clicks on the panel window header. |
| 320 std::unique_ptr<ui::EventHandler> panel_container_handler_; | 321 std::unique_ptr<ui::EventHandler> panel_container_handler_; |
| 321 | 322 |
| 322 std::unique_ptr<DesktopBackgroundWidgetController> wallpaper_controller_; | 323 std::unique_ptr<WallpaperWidgetController> wallpaper_widget_controller_; |
| 323 std::unique_ptr<AnimatingDesktopController> animating_wallpaper_controller_; | 324 std::unique_ptr<AnimatingWallpaperWidgetController> |
| 325 animating_wallpaper_widget_controller_; |
| 324 std::unique_ptr<::wm::ScopedCaptureClient> capture_client_; | 326 std::unique_ptr<::wm::ScopedCaptureClient> capture_client_; |
| 325 | 327 |
| 326 // Manages the context menu. | 328 // Manages the context menu. |
| 327 std::unique_ptr<ui::MenuModel> menu_model_; | 329 std::unique_ptr<ui::MenuModel> menu_model_; |
| 328 std::unique_ptr<views::MenuModelAdapter> menu_model_adapter_; | 330 std::unique_ptr<views::MenuModelAdapter> menu_model_adapter_; |
| 329 std::unique_ptr<views::MenuRunner> menu_runner_; | 331 std::unique_ptr<views::MenuRunner> menu_runner_; |
| 330 | 332 |
| 331 DISALLOW_COPY_AND_ASSIGN(RootWindowController); | 333 DISALLOW_COPY_AND_ASSIGN(RootWindowController); |
| 332 }; | 334 }; |
| 333 | 335 |
| 334 // On classic ash, returns the RootWindowController for the given |root_window|. | 336 // On classic ash, returns the RootWindowController for the given |root_window|. |
| 335 // On mus ash, returns the RootWindowController for the primary display. | 337 // On mus ash, returns the RootWindowController for the primary display. |
| 336 // See RootWindowController class comment above. | 338 // See RootWindowController class comment above. |
| 337 ASH_EXPORT RootWindowController* GetRootWindowController( | 339 ASH_EXPORT RootWindowController* GetRootWindowController( |
| 338 const aura::Window* root_window); | 340 const aura::Window* root_window); |
| 339 | 341 |
| 340 } // namespace ash | 342 } // namespace ash |
| 341 | 343 |
| 342 #endif // ASH_ROOT_WINDOW_CONTROLLER_H_ | 344 #endif // ASH_ROOT_WINDOW_CONTROLLER_H_ |
| OLD | NEW |