diff options
Diffstat (limited to 'ash/root_window_controller.cc')
-rw-r--r-- | ash/root_window_controller.cc | 43 |
1 files changed, 27 insertions, 16 deletions
diff --git a/ash/root_window_controller.cc b/ash/root_window_controller.cc index 0bacb01..82ff30d 100644 --- a/ash/root_window_controller.cc +++ b/ash/root_window_controller.cc @@ -209,18 +209,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); @@ -234,6 +222,8 @@ void RootWindowController::SetAnimatingWallpaperController( } void RootWindowController::Shutdown() { + Shell::GetInstance()->RemoveShellObserver(this); + if (animating_wallpaper_controller_.get()) animating_wallpaper_controller_->StopAnimating(); wallpaper_controller_.reset(); @@ -298,6 +288,8 @@ void RootWindowController::Init(bool first_run_after_boot) { GetSystemModalLayoutManager(NULL)->has_modal_background()) { GetSystemModalLayoutManager(NULL)->CreateModalBackground(); } + + Shell::GetInstance()->AddShellObserver(this); } void RootWindowController::ShowLauncher() { @@ -314,10 +306,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()) @@ -708,5 +696,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 |