Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2366)

Unified Diff: ash/wm/lock_state_controller.cc

Issue 2652093002: mash: Make the power button shut the system down. (Closed)
Patch Set: add comment about CursorManager Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/shell.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/lock_state_controller.cc
diff --git a/ash/wm/lock_state_controller.cc b/ash/wm/lock_state_controller.cc
index 31a874d1583cc4d34e7b6034f799abb46c97b8ec..293d95a9424f4f3d22d086b52e152166fab11f35 100644
--- a/ash/wm/lock_state_controller.cc
+++ b/ash/wm/lock_state_controller.cc
@@ -162,8 +162,12 @@ void LockStateController::RequestShutdown() {
shutting_down_ = true;
Shell* shell = Shell::GetInstance();
- shell->cursor_manager()->HideCursor();
- shell->cursor_manager()->LockCursor();
+ // TODO(derat): Remove these null checks once mash instantiates a
+ // CursorManager.
+ if (shell->cursor_manager()) {
+ shell->cursor_manager()->HideCursor();
+ shell->cursor_manager()->LockCursor();
+ }
animator_->StartAnimation(
SessionStateAnimator::ROOT_CONTAINER,
@@ -200,8 +204,10 @@ void LockStateController::OnAppTerminating() {
if (!shutting_down_) {
shutting_down_ = true;
Shell* shell = Shell::GetInstance();
- shell->cursor_manager()->HideCursor();
- shell->cursor_manager()->LockCursor();
+ if (shell->cursor_manager()) {
+ shell->cursor_manager()->HideCursor();
+ shell->cursor_manager()->LockCursor();
+ }
animator_->StartAnimation(SessionStateAnimator::kAllNonRootContainersMask,
SessionStateAnimator::ANIMATION_HIDE_IMMEDIATELY,
SessionStateAnimator::ANIMATION_SPEED_IMMEDIATE);
@@ -271,7 +277,8 @@ void LockStateController::OnPreShutdownAnimationTimeout() {
shutting_down_ = true;
Shell* shell = Shell::GetInstance();
- shell->cursor_manager()->HideCursor();
+ if (shell->cursor_manager())
+ shell->cursor_manager()->HideCursor();
StartRealShutdownTimer(false);
}
@@ -307,7 +314,8 @@ void LockStateController::OnRealPowerTimeout() {
void LockStateController::StartCancellableShutdownAnimation() {
Shell* shell = Shell::GetInstance();
// Hide cursor, but let it reappear if the mouse moves.
- shell->cursor_manager()->HideCursor();
+ if (shell->cursor_manager())
+ shell->cursor_manager()->HideCursor();
animator_->StartAnimation(
SessionStateAnimator::ROOT_CONTAINER,
« no previous file with comments | « ash/shell.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698