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/shelf/shelf_types.h" | 11 #include "ash/shelf/shelf_types.h" |
| 12 #include "ash/shell_observer.h" |
12 #include "ash/system/user/login_status.h" | 13 #include "ash/system/user/login_status.h" |
13 #include "base/basictypes.h" | 14 #include "base/basictypes.h" |
14 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
15 #include "ui/base/ui_base_types.h" | 16 #include "ui/base/ui_base_types.h" |
16 | 17 |
17 class SkBitmap; | 18 class SkBitmap; |
18 | 19 |
19 namespace aura { | 20 namespace aura { |
20 class EventFilter; | 21 class EventFilter; |
21 class RootWindow; | 22 class RootWindow; |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 class SystemModalContainerLayoutManager; | 62 class SystemModalContainerLayoutManager; |
62 class TouchHudDebug; | 63 class TouchHudDebug; |
63 class TouchHudProjection; | 64 class TouchHudProjection; |
64 class WorkspaceController; | 65 class WorkspaceController; |
65 | 66 |
66 // This class maintains the per root window state for ash. This class | 67 // This class maintains the per root window state for ash. This class |
67 // owns the root window and other dependent objects that should be | 68 // owns the root window and other dependent objects that should be |
68 // deleted upon the deletion of the root window. The RootWindowController | 69 // deleted upon the deletion of the root window. The RootWindowController |
69 // for particular root window is stored as a property and can be obtained | 70 // for particular root window is stored as a property and can be obtained |
70 // using |GetRootWindowController(aura::RootWindow*)| function. | 71 // using |GetRootWindowController(aura::RootWindow*)| function. |
71 class ASH_EXPORT RootWindowController { | 72 class ASH_EXPORT RootWindowController : public ShellObserver { |
72 public: | 73 public: |
73 explicit RootWindowController(aura::RootWindow* root_window); | 74 explicit RootWindowController(aura::RootWindow* root_window); |
74 ~RootWindowController(); | 75 virtual ~RootWindowController(); |
75 | 76 |
76 // Returns a RootWindowController that has a launcher for given | 77 // Returns a RootWindowController that has a launcher for given |
77 // |window|. This returns the RootWindowController for the |window|'s | 78 // |window|. This returns the RootWindowController for the |window|'s |
78 // root window when multiple launcher mode is enabled, or the primary | 79 // root window when multiple launcher mode is enabled, or the primary |
79 // RootWindowController otherwise. | 80 // RootWindowController otherwise. |
80 static RootWindowController* ForLauncher(aura::Window* window); | 81 static RootWindowController* ForLauncher(aura::Window* window); |
81 | 82 |
82 // Returns a RootWindowController of the window's root window. | 83 // Returns a RootWindowController of the window's root window. |
83 static RootWindowController* ForWindow(const aura::Window* window); | 84 static RootWindowController* ForWindow(const aura::Window* window); |
84 | 85 |
(...skipping 30 matching lines...) Expand all Loading... |
115 // will not own the HUDs; their lifetimes are managed by themselves. Whenever | 116 // will not own the HUDs; their lifetimes are managed by themselves. Whenever |
116 // the widget showing a HUD is being destroyed (e.g. because of detaching a | 117 // the widget showing a HUD is being destroyed (e.g. because of detaching a |
117 // display), the HUD deletes itself. | 118 // display), the HUD deletes itself. |
118 void set_touch_hud_debug(TouchHudDebug* hud) { | 119 void set_touch_hud_debug(TouchHudDebug* hud) { |
119 touch_hud_debug_ = hud; | 120 touch_hud_debug_ = hud; |
120 } | 121 } |
121 void set_touch_hud_projection(TouchHudProjection* hud) { | 122 void set_touch_hud_projection(TouchHudProjection* hud) { |
122 touch_hud_projection_ = hud; | 123 touch_hud_projection_ = hud; |
123 } | 124 } |
124 | 125 |
125 // Enables projection touch HUD. | |
126 void EnableTouchHudProjection(); | |
127 | |
128 // Disables projection touch HUD. | |
129 void DisableTouchHudProjection(); | |
130 | |
131 DesktopBackgroundWidgetController* wallpaper_controller() { | 126 DesktopBackgroundWidgetController* wallpaper_controller() { |
132 return wallpaper_controller_.get(); | 127 return wallpaper_controller_.get(); |
133 } | 128 } |
134 void SetWallpaperController(DesktopBackgroundWidgetController* controller); | 129 void SetWallpaperController(DesktopBackgroundWidgetController* controller); |
135 AnimatingDesktopController* animating_wallpaper_controller() { | 130 AnimatingDesktopController* animating_wallpaper_controller() { |
136 return animating_wallpaper_controller_.get(); | 131 return animating_wallpaper_controller_.get(); |
137 } | 132 } |
138 void SetAnimatingWallpaperController(AnimatingDesktopController* controller); | 133 void SetAnimatingWallpaperController(AnimatingDesktopController* controller); |
139 | 134 |
140 // Access the shelf layout manager associated with this root | 135 // Access the shelf layout manager associated with this root |
(...skipping 25 matching lines...) Expand all Loading... |
166 // Initializes the RootWindowController. |first_run_after_boot| is | 161 // Initializes the RootWindowController. |first_run_after_boot| is |
167 // set to true only for primary root window after boot. | 162 // set to true only for primary root window after boot. |
168 void Init(bool first_run_after_boot); | 163 void Init(bool first_run_after_boot); |
169 | 164 |
170 // Show launcher view if it was created hidden (before session has started). | 165 // Show launcher view if it was created hidden (before session has started). |
171 void ShowLauncher(); | 166 void ShowLauncher(); |
172 | 167 |
173 // Called when the launcher associated with this root window is created. | 168 // Called when the launcher associated with this root window is created. |
174 void OnLauncherCreated(); | 169 void OnLauncherCreated(); |
175 | 170 |
176 // Called when the user logs in. | |
177 void OnLoginStateChanged(user::LoginStatus status); | |
178 | |
179 // Called when the login status changes after login (such as lock/unlock). | 171 // Called when the login status changes after login (such as lock/unlock). |
180 // TODO(oshima): Investigate if we can merge this and |OnLoginStateChanged|. | 172 // TODO(oshima): Investigate if we can merge this and |OnLoginStateChanged|. |
181 void UpdateAfterLoginStatusChange(user::LoginStatus status); | 173 void UpdateAfterLoginStatusChange(user::LoginStatus status); |
182 | 174 |
183 // Called when the brightness/grayscale animation from white to the login | 175 // Called when the brightness/grayscale animation from white to the login |
184 // desktop background image has started. Starts |boot_splash_screen_|'s | 176 // desktop background image has started. Starts |boot_splash_screen_|'s |
185 // hiding animation (if the screen is non-NULL). | 177 // hiding animation (if the screen is non-NULL). |
186 void HandleInitialDesktopBackgroundAnimationStarted(); | 178 void HandleInitialDesktopBackgroundAnimationStarted(); |
187 | 179 |
188 // Called when the wallpaper ainmation is finished. Updates |background_| | 180 // Called when the wallpaper ainmation is finished. Updates |background_| |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 // |is_first_run_after_boot| determines the background's initial color. | 213 // |is_first_run_after_boot| determines the background's initial color. |
222 void CreateSystemBackground(bool is_first_run_after_boot); | 214 void CreateSystemBackground(bool is_first_run_after_boot); |
223 | 215 |
224 // Creates each of the special window containers that holds windows of various | 216 // Creates each of the special window containers that holds windows of various |
225 // types in the shell UI. | 217 // types in the shell UI. |
226 void CreateContainersInRootWindow(aura::RootWindow* root_window); | 218 void CreateContainersInRootWindow(aura::RootWindow* root_window); |
227 | 219 |
228 // Initializes the virtual keyboard. | 220 // Initializes the virtual keyboard. |
229 void InitKeyboard(); | 221 void InitKeyboard(); |
230 | 222 |
| 223 // Enables projection touch HUD. |
| 224 void EnableTouchHudProjection(); |
| 225 |
| 226 // Disables projection touch HUD. |
| 227 void DisableTouchHudProjection(); |
| 228 |
| 229 // Overridden from ShellObserver. |
| 230 virtual void OnLoginStateChanged(user::LoginStatus status) OVERRIDE; |
| 231 virtual void OnTouchHudProjectionToggled(bool enabled) OVERRIDE; |
| 232 |
231 scoped_ptr<aura::RootWindow> root_window_; | 233 scoped_ptr<aura::RootWindow> root_window_; |
232 RootWindowLayoutManager* root_window_layout_; | 234 RootWindowLayoutManager* root_window_layout_; |
233 | 235 |
234 scoped_ptr<StackingController> stacking_controller_; | 236 scoped_ptr<StackingController> stacking_controller_; |
235 | 237 |
236 scoped_ptr<keyboard::KeyboardController> keyboard_controller_; | 238 scoped_ptr<keyboard::KeyboardController> keyboard_controller_; |
237 | 239 |
238 // The shelf for managing the launcher and the status widget. | 240 // The shelf for managing the launcher and the status widget. |
239 scoped_ptr<ShelfWidget> shelf_; | 241 scoped_ptr<ShelfWidget> shelf_; |
240 | 242 |
(...skipping 26 matching lines...) Expand all Loading... |
267 scoped_ptr<DesktopBackgroundWidgetController> wallpaper_controller_; | 269 scoped_ptr<DesktopBackgroundWidgetController> wallpaper_controller_; |
268 scoped_ptr<AnimatingDesktopController> animating_wallpaper_controller_; | 270 scoped_ptr<AnimatingDesktopController> animating_wallpaper_controller_; |
269 | 271 |
270 DISALLOW_COPY_AND_ASSIGN(RootWindowController); | 272 DISALLOW_COPY_AND_ASSIGN(RootWindowController); |
271 }; | 273 }; |
272 | 274 |
273 } // namespace internal | 275 } // namespace internal |
274 } // ash | 276 } // ash |
275 | 277 |
276 #endif // ASH_ROOT_WINDOW_CONTROLLER_H_ | 278 #endif // ASH_ROOT_WINDOW_CONTROLLER_H_ |
OLD | NEW |