| 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> |
| 9 |
| 8 #include "ash/ash_export.h" | 10 #include "ash/ash_export.h" |
| 9 #include "ash/shelf/shelf_types.h" | 11 #include "ash/shelf/shelf_types.h" |
| 10 #include "ash/system/user/login_status.h" | 12 #include "ash/system/user/login_status.h" |
| 11 #include "base/basictypes.h" | 13 #include "base/basictypes.h" |
| 12 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
| 13 #include "ui/base/ui_base_types.h" | 15 #include "ui/base/ui_base_types.h" |
| 14 | 16 |
| 15 class SkBitmap; | 17 class SkBitmap; |
| 16 | 18 |
| 17 namespace aura { | 19 namespace aura { |
| (...skipping 27 matching lines...) Expand all Loading... |
| 45 | 47 |
| 46 class BootSplashScreen; | 48 class BootSplashScreen; |
| 47 class DockedWindowLayoutManager; | 49 class DockedWindowLayoutManager; |
| 48 class PanelLayoutManager; | 50 class PanelLayoutManager; |
| 49 class RootWindowLayoutManager; | 51 class RootWindowLayoutManager; |
| 50 class ScreenDimmer; | 52 class ScreenDimmer; |
| 51 class ShelfLayoutManager; | 53 class ShelfLayoutManager; |
| 52 class StatusAreaWidget; | 54 class StatusAreaWidget; |
| 53 class SystemBackgroundController; | 55 class SystemBackgroundController; |
| 54 class SystemModalContainerLayoutManager; | 56 class SystemModalContainerLayoutManager; |
| 55 class TouchObserverHUD; | 57 class TouchHudDebug; |
| 58 class TouchHudProjection; |
| 56 class WorkspaceController; | 59 class WorkspaceController; |
| 57 | 60 |
| 58 // This class maintains the per root window state for ash. This class | 61 // This class maintains the per root window state for ash. This class |
| 59 // owns the root window and other dependent objects that should be | 62 // owns the root window and other dependent objects that should be |
| 60 // deleted upon the deletion of the root window. The RootWindowController | 63 // deleted upon the deletion of the root window. The RootWindowController |
| 61 // for particular root window is stored as a property and can be obtained | 64 // for particular root window is stored as a property and can be obtained |
| 62 // using |GetRootWindowController(aura::RootWindow*)| function. | 65 // using |GetRootWindowController(aura::RootWindow*)| function. |
| 63 class ASH_EXPORT RootWindowController { | 66 class ASH_EXPORT RootWindowController { |
| 64 public: | 67 public: |
| 65 explicit RootWindowController(aura::RootWindow* root_window); | 68 explicit RootWindowController(aura::RootWindow* root_window); |
| (...skipping 18 matching lines...) Expand all Loading... |
| 84 WorkspaceController* workspace_controller() { | 87 WorkspaceController* workspace_controller() { |
| 85 return workspace_controller_.get(); | 88 return workspace_controller_.get(); |
| 86 } | 89 } |
| 87 | 90 |
| 88 ScreenDimmer* screen_dimmer() { return screen_dimmer_.get(); } | 91 ScreenDimmer* screen_dimmer() { return screen_dimmer_.get(); } |
| 89 | 92 |
| 90 // Access the shelf associated with this root window controller, | 93 // Access the shelf associated with this root window controller, |
| 91 // NULL if no such shelf exists. | 94 // NULL if no such shelf exists. |
| 92 ShelfWidget* shelf() { return shelf_.get(); } | 95 ShelfWidget* shelf() { return shelf_.get(); } |
| 93 | 96 |
| 94 TouchObserverHUD* touch_observer_hud() { return touch_observer_hud_; } | 97 // Get touch HUDs associated with this root window controller. |
| 98 TouchHudDebug* touch_hud_debug() const { |
| 99 return touch_hud_debug_; |
| 100 } |
| 101 TouchHudProjection* touch_hud_projection() const { |
| 102 return touch_hud_projection_; |
| 103 } |
| 95 | 104 |
| 96 // Sets the touch HUD. The RootWindowController will not own this HUD; its | 105 // Set touch HUDs for this root window controller. The root window controller |
| 97 // lifetime is managed by itself. | 106 // will not own the HUDs; their lifetimes are managed by themselves. Whenever |
| 98 void set_touch_observer_hud(TouchObserverHUD* hud) { | 107 // the widget showing a HUD is being destroyed (e.g. because of detaching a |
| 99 touch_observer_hud_ = hud; | 108 // display), the HUD deletes itself. |
| 109 void set_touch_hud_debug(TouchHudDebug* hud) { |
| 110 touch_hud_debug_ = hud; |
| 100 } | 111 } |
| 112 void set_touch_hud_projection(TouchHudProjection* hud) { |
| 113 touch_hud_projection_ = hud; |
| 114 } |
| 115 |
| 116 // Enables projection touch HUD. |
| 117 void EnableTouchHudProjection(); |
| 118 |
| 119 // Disables projection touch HUD. |
| 120 void DisableTouchHudProjection(); |
| 121 |
| 101 // Access the shelf layout manager associated with this root | 122 // Access the shelf layout manager associated with this root |
| 102 // window controller, NULL if no such shelf exists. | 123 // window controller, NULL if no such shelf exists. |
| 103 ShelfLayoutManager* GetShelfLayoutManager(); | 124 ShelfLayoutManager* GetShelfLayoutManager(); |
| 104 | 125 |
| 105 // Returns the system tray on this root window. Note that | 126 // Returns the system tray on this root window. Note that |
| 106 // calling this on the root window that doesn't have a launcher will | 127 // calling this on the root window that doesn't have a launcher will |
| 107 // lead to a crash. | 128 // lead to a crash. |
| 108 SystemTray* GetSystemTray(); | 129 SystemTray* GetSystemTray(); |
| 109 | 130 |
| 110 // Shows context menu at the |location_in_screen|. This uses | 131 // Shows context menu at the |location_in_screen|. This uses |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 | 186 |
| 166 // Deletes all child windows and performs necessary cleanup. | 187 // Deletes all child windows and performs necessary cleanup. |
| 167 void CloseChildWindows(); | 188 void CloseChildWindows(); |
| 168 | 189 |
| 169 // Moves child windows to |dest|. | 190 // Moves child windows to |dest|. |
| 170 void MoveWindowsTo(aura::RootWindow* dest); | 191 void MoveWindowsTo(aura::RootWindow* dest); |
| 171 | 192 |
| 172 // Force the shelf to query for it's current visibility state. | 193 // Force the shelf to query for it's current visibility state. |
| 173 void UpdateShelfVisibility(); | 194 void UpdateShelfVisibility(); |
| 174 | 195 |
| 196 // Initialize touch HUDs if necessary. |
| 197 void InitTouchHuds(); |
| 198 |
| 175 // Returns the window, if any, which is in fullscreen mode in the active | 199 // Returns the window, if any, which is in fullscreen mode in the active |
| 176 // workspace. Exposed here so clients of Ash don't need to know the details | 200 // workspace. Exposed here so clients of Ash don't need to know the details |
| 177 // of workspace management. | 201 // of workspace management. |
| 178 aura::Window* GetFullscreenWindow() const; | 202 aura::Window* GetFullscreenWindow() const; |
| 179 | 203 |
| 180 private: | 204 private: |
| 181 // Creates each of the special window containers that holds windows of various | 205 // Creates each of the special window containers that holds windows of various |
| 182 // types in the shell UI. | 206 // types in the shell UI. |
| 183 void CreateContainersInRootWindow(aura::RootWindow* root_window); | 207 void CreateContainersInRootWindow(aura::RootWindow* root_window); |
| 184 | 208 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 200 | 224 |
| 201 // Manages layout of panels. Owned by PanelContainer. | 225 // Manages layout of panels. Owned by PanelContainer. |
| 202 PanelLayoutManager* panel_layout_manager_; | 226 PanelLayoutManager* panel_layout_manager_; |
| 203 | 227 |
| 204 scoped_ptr<SystemBackgroundController> system_background_; | 228 scoped_ptr<SystemBackgroundController> system_background_; |
| 205 scoped_ptr<BootSplashScreen> boot_splash_screen_; | 229 scoped_ptr<BootSplashScreen> boot_splash_screen_; |
| 206 | 230 |
| 207 scoped_ptr<ScreenDimmer> screen_dimmer_; | 231 scoped_ptr<ScreenDimmer> screen_dimmer_; |
| 208 scoped_ptr<WorkspaceController> workspace_controller_; | 232 scoped_ptr<WorkspaceController> workspace_controller_; |
| 209 | 233 |
| 210 // Heads-up display for touch events. The RootWindowController does not own | 234 // Heads-up displays for touch events. These HUDs are not owned by the root |
| 211 // this HUD; its lifetime is managed by itself. | 235 // window controller and manage their own lifetimes. |
| 212 TouchObserverHUD* touch_observer_hud_; | 236 TouchHudDebug* touch_hud_debug_; |
| 237 TouchHudProjection* touch_hud_projection_; |
| 213 | 238 |
| 214 // We need to own event handlers for various containers. | 239 // We need to own event handlers for various containers. |
| 215 scoped_ptr<ToplevelWindowEventHandler> default_container_handler_; | 240 scoped_ptr<ToplevelWindowEventHandler> default_container_handler_; |
| 216 scoped_ptr<ToplevelWindowEventHandler> always_on_top_container_handler_; | 241 scoped_ptr<ToplevelWindowEventHandler> always_on_top_container_handler_; |
| 217 scoped_ptr<ToplevelWindowEventHandler> modal_container_handler_; | 242 scoped_ptr<ToplevelWindowEventHandler> modal_container_handler_; |
| 218 scoped_ptr<ToplevelWindowEventHandler> lock_modal_container_handler_; | 243 scoped_ptr<ToplevelWindowEventHandler> lock_modal_container_handler_; |
| 219 scoped_ptr<ToplevelWindowEventHandler> panel_container_handler_; | 244 scoped_ptr<ToplevelWindowEventHandler> panel_container_handler_; |
| 220 scoped_ptr<ToplevelWindowEventHandler> docked_container_handler_; | 245 scoped_ptr<ToplevelWindowEventHandler> docked_container_handler_; |
| 221 | 246 |
| 222 DISALLOW_COPY_AND_ASSIGN(RootWindowController); | 247 DISALLOW_COPY_AND_ASSIGN(RootWindowController); |
| 223 }; | 248 }; |
| 224 | 249 |
| 225 } // namespace internal | 250 } // namespace internal |
| 226 } // ash | 251 } // ash |
| 227 | 252 |
| 228 #endif // ASH_ROOT_WINDOW_CONTROLLER_H_ | 253 #endif // ASH_ROOT_WINDOW_CONTROLLER_H_ |
| OLD | NEW |