Chromium Code Reviews| Index: ash/wm/lock_state_controller.cc |
| diff --git a/ash/wm/lock_state_controller.cc b/ash/wm/lock_state_controller.cc |
| index 09a46afa2a1436404485a642a920205f69a4cad8..cb2b1dc99cc02e443bd8da846f12026b1f063fac 100644 |
| --- a/ash/wm/lock_state_controller.cc |
| +++ b/ash/wm/lock_state_controller.cc |
| @@ -16,6 +16,7 @@ |
| #include "ash/wm/session_state_animator.h" |
| #include "base/bind_helpers.h" |
| #include "base/command_line.h" |
| +#include "base/strings/string_util.h" |
| #include "base/timer/timer.h" |
| #include "ui/aura/window_tree_host.h" |
| #include "ui/compositor/layer_animation_sequence.h" |
| @@ -584,34 +585,36 @@ void LockStateController::LockAnimationCancelled() { |
| } |
| void LockStateController::PreLockAnimationFinished(bool request_lock) { |
| - can_cancel_lock_animation_ = false; |
| VLOG(1) << "PreLockAnimationFinished"; |
| - if (request_lock) { |
| - Shell::GetInstance()->metrics()->RecordUserMetricsAction( |
| - shutdown_after_lock_ ? |
| - UMA_ACCEL_LOCK_SCREEN_POWER_BUTTON : |
| - UMA_ACCEL_LOCK_SCREEN_LOCK_BUTTON); |
| - delegate_->RequestLockScreen(); |
| + can_cancel_lock_animation_ = false; |
| + if (!request_lock) |
| + return; |
| + |
| + if (system_is_locked_) { |
|
Daniel Erat
2014/08/01 22:55:07
another option would be structuring the body of th
|
| + LOG(DFATAL) << "Got request to lock already-locked system at completion " |
| + << "of pre-lock animation"; |
| + return; |
| } |
| - int lock_timeout = kLockFailTimeoutMs; |
| + Shell::GetInstance()->metrics()->RecordUserMetricsAction( |
| + shutdown_after_lock_ ? |
| + UMA_ACCEL_LOCK_SCREEN_POWER_BUTTON : |
| + UMA_ACCEL_LOCK_SCREEN_LOCK_BUTTON); |
| + delegate_->RequestLockScreen(); |
| + base::TimeDelta timeout = |
| + base::TimeDelta::FromMilliseconds(kLockFailTimeoutMs); |
| #if defined(OS_CHROMEOS) |
| - std::string board = base::SysInfo::GetLsbReleaseBoard(); |
| - |
| // Increase lock timeout for slower hardware, see http://crbug.com/350628 |
| + const std::string board = base::SysInfo::GetLsbReleaseBoard(); |
| if (board == "x86-mario" || |
| - board.substr(0, 8) == "x86-alex" || |
| - board.substr(0, 7) == "x86-zgb") { |
| - lock_timeout *= 2; |
| + StartsWithASCII(board, "x86-alex", true) || |
| + StartsWithASCII(board, "x86-zgb", true)) { |
| + timeout *= 2; |
| } |
| #endif |
| - |
| lock_fail_timer_.Start( |
| - FROM_HERE, |
| - base::TimeDelta::FromMilliseconds(lock_timeout), |
| - this, |
| - &LockStateController::OnLockFailTimeout); |
| + FROM_HERE, timeout, this, &LockStateController::OnLockFailTimeout); |
| } |
| void LockStateController::PostLockAnimationFinished() { |