Index: ash/root_window_controller.cc |
diff --git a/ash/root_window_controller.cc b/ash/root_window_controller.cc |
index ba20f5834e0bf87f04a86edb151b4e80957d664e..7ba969a4836e0f21cd69747d9f9f8ed6dd3b24eb 100644 |
--- a/ash/root_window_controller.cc |
+++ b/ash/root_window_controller.cc |
@@ -203,18 +203,6 @@ RootWindowController* RootWindowController::ForActiveRootWindow() { |
return GetRootWindowController(Shell::GetActiveRootWindow()); |
} |
-void RootWindowController::EnableTouchHudProjection() { |
- if (touch_hud_projection_) |
- return; |
- set_touch_hud_projection(new TouchHudProjection(root_window_.get())); |
-} |
- |
-void RootWindowController::DisableTouchHudProjection() { |
- if (!touch_hud_projection_) |
- return; |
- touch_hud_projection_->Remove(); |
-} |
- |
void RootWindowController::SetWallpaperController( |
DesktopBackgroundWidgetController* controller) { |
wallpaper_controller_.reset(controller); |
@@ -228,6 +216,8 @@ void RootWindowController::SetAnimatingWallpaperController( |
} |
void RootWindowController::Shutdown() { |
+ Shell::GetInstance()->RemoveShellObserver(this); |
+ |
if (animating_wallpaper_controller_.get()) |
animating_wallpaper_controller_->StopAnimating(); |
wallpaper_controller_.reset(); |
@@ -292,6 +282,8 @@ void RootWindowController::Init(bool first_run_after_boot) { |
GetSystemModalLayoutManager(NULL)->has_modal_background()) { |
GetSystemModalLayoutManager(NULL)->CreateModalBackground(); |
} |
+ |
+ Shell::GetInstance()->AddShellObserver(this); |
} |
void RootWindowController::ShowLauncher() { |
@@ -308,10 +300,6 @@ void RootWindowController::OnLauncherCreated() { |
docked_layout_manager_->SetLauncher(shelf_->launcher()); |
} |
-void RootWindowController::OnLoginStateChanged(user::LoginStatus status) { |
- shelf_->shelf_layout_manager()->UpdateVisibilityState(); |
-} |
- |
void RootWindowController::UpdateAfterLoginStatusChange( |
user::LoginStatus status) { |
if (shelf_->status_area_widget()) |
@@ -700,5 +688,28 @@ void RootWindowController::CreateContainersInRootWindow( |
"PowerButtonAnimationContainer", root_window) ; |
} |
+void RootWindowController::EnableTouchHudProjection() { |
+ if (touch_hud_projection_) |
+ return; |
+ set_touch_hud_projection(new TouchHudProjection(root_window_.get())); |
+} |
+ |
+void RootWindowController::DisableTouchHudProjection() { |
+ if (!touch_hud_projection_) |
+ return; |
+ touch_hud_projection_->Remove(); |
+} |
+ |
+void RootWindowController::OnLoginStateChanged(user::LoginStatus status) { |
+ shelf_->shelf_layout_manager()->UpdateVisibilityState(); |
+} |
+ |
+void RootWindowController::OnTouchHudProjectionToggled(bool enabled) { |
+ if (enabled) |
+ EnableTouchHudProjection(); |
+ else |
+ DisableTouchHudProjection(); |
+} |
+ |
} // namespace internal |
} // namespace ash |