| 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 | 9 |
| 10 #include "ash/ash_export.h" | 10 #include "ash/ash_export.h" |
| 11 #include "ash/host/ash_window_tree_host.h" |
| 11 #include "ash/shelf/shelf_types.h" | 12 #include "ash/shelf/shelf_types.h" |
| 12 #include "ash/shell_observer.h" | 13 #include "ash/shell_observer.h" |
| 13 #include "ash/system/user/login_status.h" | 14 #include "ash/system/user/login_status.h" |
| 14 #include "base/basictypes.h" | 15 #include "base/basictypes.h" |
| 15 #include "base/memory/scoped_ptr.h" | 16 #include "base/memory/scoped_ptr.h" |
| 16 #include "ui/aura/window.h" | 17 #include "ui/aura/window.h" |
| 17 #include "ui/aura/window_tree_host.h" | 18 #include "ui/aura/window_tree_host.h" |
| 18 #include "ui/base/ui_base_types.h" | 19 #include "ui/base/ui_base_types.h" |
| 19 | 20 |
| 20 class SkBitmap; | 21 class SkBitmap; |
| (...skipping 19 matching lines...) Expand all Loading... |
| 40 class Widget; | 41 class Widget; |
| 41 } | 42 } |
| 42 | 43 |
| 43 namespace wm { | 44 namespace wm { |
| 44 class InputMethodEventFilter; | 45 class InputMethodEventFilter; |
| 45 class RootWindowEventFilter; | 46 class RootWindowEventFilter; |
| 46 class ScopedCaptureClient; | 47 class ScopedCaptureClient; |
| 47 } | 48 } |
| 48 | 49 |
| 49 namespace ash { | 50 namespace ash { |
| 51 class AshWindowTreeHost; |
| 50 class ShelfWidget; | 52 class ShelfWidget; |
| 51 class StackingController; | 53 class StackingController; |
| 52 class SystemTray; | 54 class SystemTray; |
| 53 | 55 |
| 54 namespace internal { | 56 namespace internal { |
| 55 | 57 |
| 56 class AlwaysOnTopController; | 58 class AlwaysOnTopController; |
| 57 class AnimatingDesktopController; | 59 class AnimatingDesktopController; |
| 58 class DesktopBackgroundWidgetController; | 60 class DesktopBackgroundWidgetController; |
| 59 class DockedWindowLayoutManager; | 61 class DockedWindowLayoutManager; |
| (...skipping 16 matching lines...) Expand all Loading... |
| 76 // owns the root window and other dependent objects that should be | 78 // owns the root window and other dependent objects that should be |
| 77 // deleted upon the deletion of the root window. This object is | 79 // deleted upon the deletion of the root window. This object is |
| 78 // indirectly owned and deleted by |DisplayController|. | 80 // indirectly owned and deleted by |DisplayController|. |
| 79 // The RootWindowController for particular root window is stored in | 81 // The RootWindowController for particular root window is stored in |
| 80 // its property (RootWindowSettings) and can be obtained using | 82 // its property (RootWindowSettings) and can be obtained using |
| 81 // |GetRootWindowController(aura::WindowEventDispatcher*)| function. | 83 // |GetRootWindowController(aura::WindowEventDispatcher*)| function. |
| 82 class ASH_EXPORT RootWindowController : public ShellObserver { | 84 class ASH_EXPORT RootWindowController : public ShellObserver { |
| 83 public: | 85 public: |
| 84 | 86 |
| 85 // Creates and Initialize the RootWindowController for primary display. | 87 // Creates and Initialize the RootWindowController for primary display. |
| 86 static void CreateForPrimaryDisplay(aura::WindowTreeHost* host); | 88 static void CreateForPrimaryDisplay(AshWindowTreeHost* host); |
| 87 | 89 |
| 88 // Creates and Initialize the RootWindowController for secondary displays. | 90 // Creates and Initialize the RootWindowController for secondary displays. |
| 89 static void CreateForSecondaryDisplay(aura::WindowTreeHost* host); | 91 static void CreateForSecondaryDisplay(AshWindowTreeHost* host); |
| 90 | 92 |
| 91 // Creates and Initialize the RootWindowController for virtual | 93 // Creates and Initialize the RootWindowController for virtual |
| 92 // keyboard displays. | 94 // keyboard displays. |
| 93 static void CreateForVirtualKeyboardDisplay(aura::WindowTreeHost* host); | 95 static void CreateForVirtualKeyboardDisplay(AshWindowTreeHost* host); |
| 94 | 96 |
| 95 // Returns a RootWindowController that has a shelf for given | 97 // Returns a RootWindowController that has a shelf for given |
| 96 // |window|. This returns the RootWindowController for the |window|'s | 98 // |window|. This returns the RootWindowController for the |window|'s |
| 97 // root window when multiple shelf mode is enabled, or the primary | 99 // root window when multiple shelf mode is enabled, or the primary |
| 98 // RootWindowController otherwise. | 100 // RootWindowController otherwise. |
| 99 static RootWindowController* ForShelf(aura::Window* window); | 101 static RootWindowController* ForShelf(aura::Window* window); |
| 100 | 102 |
| 101 // Returns a RootWindowController of the window's root window. | 103 // Returns a RootWindowController of the window's root window. |
| 102 static RootWindowController* ForWindow(const aura::Window* window); | 104 static RootWindowController* ForWindow(const aura::Window* window); |
| 103 | 105 |
| 104 // Returns the RootWindowController of the target root window. | 106 // Returns the RootWindowController of the target root window. |
| 105 static internal::RootWindowController* ForTargetRootWindow(); | 107 static internal::RootWindowController* ForTargetRootWindow(); |
| 106 | 108 |
| 107 // Returns container which contains a given |window|. | 109 // Returns container which contains a given |window|. |
| 108 static aura::Window* GetContainerForWindow(aura::Window* window); | 110 static aura::Window* GetContainerForWindow(aura::Window* window); |
| 109 | 111 |
| 110 virtual ~RootWindowController(); | 112 virtual ~RootWindowController(); |
| 111 | 113 |
| 112 aura::Window* root_window() { return host_->window(); } | 114 aura::Window* root_window() { return host()->window(); } |
| 113 const aura::Window* root_window() const { return host_->window(); } | 115 const aura::Window* root_window() const { return host()->window(); } |
| 114 aura::WindowTreeHost* host() { return host_.get(); } | 116 aura::WindowTreeHost* host() { return ash_host_->AsWindowTreeHost(); } |
| 115 const aura::WindowTreeHost* host() const { return host_.get(); } | 117 const aura::WindowTreeHost* host() const { return ash_host_->AsWindowTreeHost(
); } |
| 118 |
| 119 AshWindowTreeHost* ash_host() { return ash_host_.get(); } |
| 120 const AshWindowTreeHost* ash_host() const { return ash_host_.get(); } |
| 121 |
| 116 | 122 |
| 117 RootWindowLayoutManager* root_window_layout() { return root_window_layout_; } | 123 RootWindowLayoutManager* root_window_layout() { return root_window_layout_; } |
| 118 | 124 |
| 119 WorkspaceController* workspace_controller() { | 125 WorkspaceController* workspace_controller() { |
| 120 return workspace_controller_.get(); | 126 return workspace_controller_.get(); |
| 121 } | 127 } |
| 122 | 128 |
| 123 AlwaysOnTopController* always_on_top_controller() { | 129 AlwaysOnTopController* always_on_top_controller() { |
| 124 return always_on_top_controller_.get(); | 130 return always_on_top_controller_.get(); |
| 125 } | 131 } |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 // are in fullscreen mode. | 234 // are in fullscreen mode. |
| 229 const aura::Window* GetWindowForFullscreenMode() const; | 235 const aura::Window* GetWindowForFullscreenMode() const; |
| 230 | 236 |
| 231 // Activate virtual keyboard on current root window controller. | 237 // Activate virtual keyboard on current root window controller. |
| 232 void ActivateKeyboard(keyboard::KeyboardController* keyboard_controller); | 238 void ActivateKeyboard(keyboard::KeyboardController* keyboard_controller); |
| 233 | 239 |
| 234 // Deactivate virtual keyboard on current root window controller. | 240 // Deactivate virtual keyboard on current root window controller. |
| 235 void DeactivateKeyboard(keyboard::KeyboardController* keyboard_controller); | 241 void DeactivateKeyboard(keyboard::KeyboardController* keyboard_controller); |
| 236 | 242 |
| 237 private: | 243 private: |
| 238 explicit RootWindowController(aura::WindowTreeHost* host); | 244 explicit RootWindowController(AshWindowTreeHost* host); |
| 239 enum RootWindowType { | 245 enum RootWindowType { |
| 240 PRIMARY, | 246 PRIMARY, |
| 241 SECONDARY, | 247 SECONDARY, |
| 242 VIRTUAL_KEYBOARD | 248 VIRTUAL_KEYBOARD |
| 243 }; | 249 }; |
| 244 | 250 |
| 245 // Initializes the RootWindowController. |is_primary| is true if | 251 // Initializes the RootWindowController. |is_primary| is true if |
| 246 // the controller is for primary display. |first_run_after_boot| is | 252 // the controller is for primary display. |first_run_after_boot| is |
| 247 // set to true only for primary root window after boot. | 253 // set to true only for primary root window after boot. |
| 248 void Init(RootWindowType root_window_type, bool first_run_after_boot); | 254 void Init(RootWindowType root_window_type, bool first_run_after_boot); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 260 // Enables projection touch HUD. | 266 // Enables projection touch HUD. |
| 261 void EnableTouchHudProjection(); | 267 void EnableTouchHudProjection(); |
| 262 | 268 |
| 263 // Disables projection touch HUD. | 269 // Disables projection touch HUD. |
| 264 void DisableTouchHudProjection(); | 270 void DisableTouchHudProjection(); |
| 265 | 271 |
| 266 // Overridden from ShellObserver. | 272 // Overridden from ShellObserver. |
| 267 virtual void OnLoginStateChanged(user::LoginStatus status) OVERRIDE; | 273 virtual void OnLoginStateChanged(user::LoginStatus status) OVERRIDE; |
| 268 virtual void OnTouchHudProjectionToggled(bool enabled) OVERRIDE; | 274 virtual void OnTouchHudProjectionToggled(bool enabled) OVERRIDE; |
| 269 | 275 |
| 270 scoped_ptr<aura::WindowTreeHost> host_; | 276 scoped_ptr<AshWindowTreeHost> ash_host_; |
| 271 RootWindowLayoutManager* root_window_layout_; | 277 RootWindowLayoutManager* root_window_layout_; |
| 272 | 278 |
| 273 scoped_ptr<StackingController> stacking_controller_; | 279 scoped_ptr<StackingController> stacking_controller_; |
| 274 | 280 |
| 275 // The shelf for managing the shelf and the status widget. | 281 // The shelf for managing the shelf and the status widget. |
| 276 scoped_ptr<ShelfWidget> shelf_; | 282 scoped_ptr<ShelfWidget> shelf_; |
| 277 | 283 |
| 278 // An invisible/empty window used as a event target for | 284 // An invisible/empty window used as a event target for |
| 279 // |MouseCursorEventFilter| before a user logs in. | 285 // |MouseCursorEventFilter| before a user logs in. |
| 280 // (crbug.com/266987) | 286 // (crbug.com/266987) |
| (...skipping 19 matching lines...) Expand all Loading... |
| 300 // Heads-up displays for touch events. These HUDs are not owned by the root | 306 // Heads-up displays for touch events. These HUDs are not owned by the root |
| 301 // window controller and manage their own lifetimes. | 307 // window controller and manage their own lifetimes. |
| 302 TouchHudDebug* touch_hud_debug_; | 308 TouchHudDebug* touch_hud_debug_; |
| 303 TouchHudProjection* touch_hud_projection_; | 309 TouchHudProjection* touch_hud_projection_; |
| 304 | 310 |
| 305 // Handles double clicks on the panel window header. | 311 // Handles double clicks on the panel window header. |
| 306 scoped_ptr<ui::EventHandler> panel_container_handler_; | 312 scoped_ptr<ui::EventHandler> panel_container_handler_; |
| 307 | 313 |
| 308 scoped_ptr<DesktopBackgroundWidgetController> wallpaper_controller_; | 314 scoped_ptr<DesktopBackgroundWidgetController> wallpaper_controller_; |
| 309 scoped_ptr<AnimatingDesktopController> animating_wallpaper_controller_; | 315 scoped_ptr<AnimatingDesktopController> animating_wallpaper_controller_; |
| 310 scoped_ptr< ::wm::ScopedCaptureClient> capture_client_; | 316 scoped_ptr<::wm::ScopedCaptureClient> capture_client_; |
| 311 | 317 |
| 312 DISALLOW_COPY_AND_ASSIGN(RootWindowController); | 318 DISALLOW_COPY_AND_ASSIGN(RootWindowController); |
| 313 }; | 319 }; |
| 314 | 320 |
| 315 | 321 |
| 316 // Gets the RootWindowController for |root_window|. | 322 // Gets the RootWindowController for |root_window|. |
| 317 ASH_EXPORT RootWindowController* GetRootWindowController( | 323 ASH_EXPORT RootWindowController* GetRootWindowController( |
| 318 const aura::Window* root_window); | 324 const aura::Window* root_window); |
| 319 | 325 |
| 320 } // namespace internal | 326 } // namespace internal |
| 321 } // ash | 327 } // ash |
| 322 | 328 |
| 323 #endif // ASH_ROOT_WINDOW_CONTROLLER_H_ | 329 #endif // ASH_ROOT_WINDOW_CONTROLLER_H_ |
| OLD | NEW |