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

Unified Diff: ash/wm/lock_state_controller.cc

Issue 811033002: Add device policy to disallow shutdown - ash UI modifications (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 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/wm/lock_state_controller.h ('k') | ash/wm/lock_state_controller_unittest.cc » ('j') | 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 0bf6d30043b3086054c338eafa86f338e0808975..3b6c04bef12bd4b3bd790ac09f5fa3e7f0e33c1a 100644
--- a/ash/wm/lock_state_controller.cc
+++ b/ash/wm/lock_state_controller.cc
@@ -167,7 +167,7 @@ void LockStateController::OnStartingLock() {
StartImmediatePreLockAnimation(false /* request_lock_on_completion */);
}
-void LockStateController::RequestShutdown(ShutdownMode mode) {
+void LockStateController::RequestShutdown() {
if (shutting_down_)
return;
@@ -181,7 +181,7 @@ void LockStateController::RequestShutdown(ShutdownMode mode) {
SessionStateAnimator::ROOT_CONTAINER,
SessionStateAnimator::ANIMATION_GRAYSCALE_BRIGHTNESS,
SessionStateAnimator::ANIMATION_SPEED_SHUTDOWN);
- StartRealShutdownTimer(true, mode);
+ StartRealShutdownTimer(true);
}
void LockStateController::OnLockScreenHide(
@@ -271,11 +271,10 @@ void LockStateController::OnPreShutdownAnimationTimeout() {
Shell* shell = ash::Shell::GetInstance();
shell->cursor_manager()->HideCursor();
- StartRealShutdownTimer(false, POWER_OFF);
+ StartRealShutdownTimer(false);
}
-void LockStateController::StartRealShutdownTimer(bool with_animation_time,
- ShutdownMode shutdown_mode) {
+void LockStateController::StartRealShutdownTimer(bool with_animation_time) {
base::TimeDelta duration =
base::TimeDelta::FromMilliseconds(kShutdownRequestDelayMs);
if (with_animation_time) {
@@ -295,10 +294,10 @@ void LockStateController::StartRealShutdownTimer(bool with_animation_time,
real_shutdown_timer_.Start(
FROM_HERE, duration, base::Bind(&LockStateController::OnRealPowerTimeout,
- base::Unretained(this), shutdown_mode));
+ base::Unretained(this)));
}
-void LockStateController::OnRealPowerTimeout(ShutdownMode shutdown_mode) {
+void LockStateController::OnRealPowerTimeout() {
VLOG(1) << "OnRealPowerTimeout";
DCHECK(shutting_down_);
#if defined(OS_CHROMEOS)
@@ -310,15 +309,9 @@ void LockStateController::OnRealPowerTimeout(ShutdownMode shutdown_mode) {
}
}
#endif
- if (shutdown_mode == POWER_OFF) {
- Shell::GetInstance()->metrics()->RecordUserMetricsAction(
- UMA_ACCEL_SHUT_DOWN_POWER_BUTTON);
- delegate_->RequestShutdown();
- return;
- }
Shell::GetInstance()->metrics()->RecordUserMetricsAction(
- UMA_ACCEL_RESTART_POWER_BUTTON);
- delegate_->RequestRestart();
+ UMA_ACCEL_SHUT_DOWN_POWER_BUTTON);
+ delegate_->RequestShutdown();
}
void LockStateController::StartCancellableShutdownAnimation() {
« no previous file with comments | « ash/wm/lock_state_controller.h ('k') | ash/wm/lock_state_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698