summaryrefslogtreecommitdiffstats
path: root/ash/wm/power_button_controller.cc
diff options
context:
space:
mode:
authorgavinp@chromium.org <gavinp@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-17 14:47:48 +0000
committergavinp@chromium.org <gavinp@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-17 14:47:48 +0000
commitf2192efaf719d6e54459fde8ef38093e08e194e0 (patch)
tree26b06fa106a8ab701dcda5e4c00f959d9d82a700 /ash/wm/power_button_controller.cc
parentb0b94f5c503e44cc2190a9c7c4d20425f77e6a42 (diff)
downloadchromium_src-f2192efaf719d6e54459fde8ef38093e08e194e0.zip
chromium_src-f2192efaf719d6e54459fde8ef38093e08e194e0.tar.gz
chromium_src-f2192efaf719d6e54459fde8ef38093e08e194e0.tar.bz2
Revert 194578 "Add ash SessionStateDelegate"
> Add ash SessionStateDelegate > > This CL refactors the ShellDelegate by adding a SessionStateDelegate to > which methods dealing with the session state can be moved. This cleans up > the huge ShellDelegate interface and paves the way for further Chrome OS > multiprofile work which will need to add several new methods related to > the session state. > > This CL is only the first step. Several other methods should also move to > SessionStateDelegate but I do not want to overburden a single CL. > > BUG=None > TEST=Manual and browser/unit tests > > TBR=sky (for c/b/idle_chromeos.cc and c/chrome_browser_ui.gypi) > > Review URL: https://codereview.chromium.org/14295008 TBR=bartfab@google.com Review URL: https://codereview.chromium.org/14200034 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@194589 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/wm/power_button_controller.cc')
-rw-r--r--ash/wm/power_button_controller.cc23
1 files changed, 8 insertions, 15 deletions
diff --git a/ash/wm/power_button_controller.cc b/ash/wm/power_button_controller.cc
index 6850608..9359b8a 100644
--- a/ash/wm/power_button_controller.cc
+++ b/ash/wm/power_button_controller.cc
@@ -5,8 +5,8 @@
#include "ash/wm/power_button_controller.h"
#include "ash/ash_switches.h"
-#include "ash/session_state_delegate.h"
#include "ash/shell.h"
+#include "ash/shell_delegate.h"
#include "ash/shell_window_ids.h"
#include "ash/wm/session_state_animator.h"
#include "ash/wm/session_state_controller.h"
@@ -45,15 +45,13 @@ void PowerButtonController::OnPowerButtonEvent(
if (screen_is_off_)
return;
- const SessionStateDelegate* session_state_delegate =
- Shell::GetInstance()->session_state_delegate();
+ Shell* shell = Shell::GetInstance();
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->IsScreenLocked() &&
+ if (shell->CanLockScreen() && !shell->IsScreenLocked() &&
!controller_->LockRequested()) {
controller_->StartLockAnimationAndLockImmediately();
} else {
@@ -66,12 +64,10 @@ void PowerButtonController::OnPowerButtonEvent(
if (controller_->LockRequested())
return;
- if (session_state_delegate->CanLockScreen() &&
- !session_state_delegate->IsScreenLocked()) {
+ if (shell->CanLockScreen() && !shell->IsScreenLocked())
controller_->StartLockAnimation(true);
- } else {
+ else
controller_->StartShutdownAnimation();
- }
} else { // Button is up.
if (controller_->CanCancelLockAnimation())
controller_->CancelLockAnimation();
@@ -85,12 +81,9 @@ void PowerButtonController::OnLockButtonEvent(
bool down, const base::TimeTicks& timestamp) {
lock_button_down_ = down;
- const SessionStateDelegate* session_state_delegate =
- Shell::GetInstance()->session_state_delegate();
- if (!session_state_delegate->CanLockScreen() ||
- session_state_delegate->IsScreenLocked() ||
- controller_->LockRequested() ||
- controller_->ShutdownRequested()) {
+ Shell* shell = Shell::GetInstance();
+ if (!shell->CanLockScreen() || shell->IsScreenLocked() ||
+ controller_->LockRequested() || controller_->ShutdownRequested()) {
return;
}