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

Unified Diff: ash/wm/power_button_controller.cc

Issue 2734933004: ash: Use SessionController instead of SessionStateDelegate (Closed)
Patch Set: rebase Created 3 years, 9 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
Index: ash/wm/power_button_controller.cc
diff --git a/ash/wm/power_button_controller.cc b/ash/wm/power_button_controller.cc
index 104d612dd7877cead0d573f7c6cd46fcc22d069e..1d949b4e54a04cee0d37b2bf545ec5dcdd8cacf0 100644
--- a/ash/wm/power_button_controller.cc
+++ b/ash/wm/power_button_controller.cc
@@ -6,7 +6,7 @@
#include "ash/common/accelerators/accelerator_controller.h"
#include "ash/common/ash_switches.h"
-#include "ash/common/session/session_state_delegate.h"
+#include "ash/common/session/session_controller.h"
#include "ash/common/system/chromeos/audio/tray_audio.h"
#include "ash/common/system/tray/system_tray.h"
#include "ash/common/wm/maximize_mode/maximize_mode_controller.h"
@@ -103,15 +103,15 @@ void PowerButtonController::OnPowerButtonEvent(
return;
}
- const SessionStateDelegate* session_state_delegate =
- WmShell::Get()->GetSessionStateDelegate();
+ const SessionController* const session_controller =
+ WmShell::Get()->session_controller();
if (has_legacy_power_button_) {
// If power button releases won't get reported correctly because we're not
// running on official hardware, just lock the screen or shut down
// immediately.
if (down) {
- if (session_state_delegate->CanLockScreen() &&
- !session_state_delegate->IsUserSessionBlocked() &&
+ if (session_controller->CanLockScreen() &&
+ !session_controller->IsUserSessionBlocked() &&
!lock_state_controller_->LockRequested()) {
lock_state_controller_->StartLockAnimationAndLockImmediately(false);
} else {
@@ -124,8 +124,8 @@ void PowerButtonController::OnPowerButtonEvent(
if (lock_state_controller_->LockRequested())
return;
- if (session_state_delegate->CanLockScreen() &&
- !session_state_delegate->IsUserSessionBlocked()) {
+ if (session_controller->CanLockScreen() &&
+ !session_controller->IsUserSessionBlocked()) {
lock_state_controller_->StartLockAnimation(true);
} else {
lock_state_controller_->StartShutdownAnimation();
@@ -144,10 +144,10 @@ void PowerButtonController::OnLockButtonEvent(
const base::TimeTicks& timestamp) {
lock_button_down_ = down;
- const SessionStateDelegate* session_state_delegate =
- WmShell::Get()->GetSessionStateDelegate();
- if (!session_state_delegate->CanLockScreen() ||
- session_state_delegate->IsScreenLocked() ||
+ const SessionController* const session_controller =
+ WmShell::Get()->session_controller();
+ if (!session_controller->CanLockScreen() ||
+ session_controller->IsScreenLocked() ||
lock_state_controller_->LockRequested() ||
lock_state_controller_->ShutdownRequested()) {
return;

Powered by Google App Engine
This is Rietveld 408576698