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

Unified Diff: ash/accelerators/accelerator_controller.cc

Issue 14295008: Add ash SessionStateDelegate (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Ready for review. Created 7 years, 8 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 | « no previous file | ash/accelerators/nested_dispatcher_controller_unittest.cc » ('j') | ash/ash.gyp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/accelerators/accelerator_controller.cc
diff --git a/ash/accelerators/accelerator_controller.cc b/ash/accelerators/accelerator_controller.cc
index 9face4f7a325d8e2f9a46f120c58692b0055f86e..a98c4b362a773f88d8c9a0fe551b8e626416ffac 100644
--- a/ash/accelerators/accelerator_controller.cc
+++ b/ash/accelerators/accelerator_controller.cc
@@ -26,6 +26,7 @@
#include "ash/root_window_controller.h"
#include "ash/rotator/screen_rotation.h"
#include "ash/screenshot_delegate.h"
+#include "ash/session_state_delegate.h"
#include "ash/shelf/shelf_widget.h"
#include "ash/shell.h"
#include "ash/shell_delegate.h"
@@ -101,7 +102,7 @@ void HandleCycleWindowLinear(CycleDirection direction) {
#if defined(OS_CHROMEOS)
bool HandleLock() {
- Shell::GetInstance()->delegate()->LockScreen();
+ Shell::GetInstance()->session_state_delegate()->LockScreen();
return true;
}
@@ -427,16 +428,12 @@ bool AcceleratorController::IsReservedAccelerator(
bool AcceleratorController::PerformAction(int action,
const ui::Accelerator& accelerator) {
ash::Shell* shell = ash::Shell::GetInstance();
- bool at_login_screen = false;
-#if defined(OS_CHROMEOS)
- at_login_screen = !shell->delegate()->IsSessionStarted();
-#endif
- if (at_login_screen &&
+ if (!shell->session_state_delegate()->IsActiveUserSessionStarted() &&
actions_allowed_at_login_screen_.find(action) ==
actions_allowed_at_login_screen_.end()) {
return false;
}
- if (shell->IsScreenLocked() &&
+ if (shell->session_state_delegate()->IsScreenLocked() &&
actions_allowed_at_lock_screen_.find(action) ==
actions_allowed_at_lock_screen_.end()) {
return false;
« no previous file with comments | « no previous file | ash/accelerators/nested_dispatcher_controller_unittest.cc » ('j') | ash/ash.gyp » ('J')

Powered by Google App Engine
This is Rietveld 408576698