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

Unified Diff: ash/accelerators/accelerator_controller.cc

Issue 10388230: Allow Control+Shift+Q on lock screen. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix typo Created 8 years, 7 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/accelerators/accelerator_controller.h ('k') | ash/accelerators/accelerator_table.h » ('j') | no next file with comments »
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 2762f944573416de07351998dba4e09d1683d458..ee67958de0b9f685c35deceb5e57917483b8b6b8 100644
--- a/ash/accelerators/accelerator_controller.cc
+++ b/ash/accelerators/accelerator_controller.cc
@@ -189,8 +189,14 @@ AcceleratorController::~AcceleratorController() {
}
void AcceleratorController::Init() {
- for (size_t i = 0; i < kActionsAllowedAtLoginScreenLength; ++i) {
- actions_allowed_at_login_screen_.insert(kActionsAllowedAtLoginScreen[i]);
+ for (size_t i = 0; i < kActionsAllowedAtLoginOrLockScreenLength; ++i) {
+ actions_allowed_at_login_screen_.insert(
+ kActionsAllowedAtLoginOrLockScreen[i]);
+ actions_allowed_at_lock_screen_.insert(
+ kActionsAllowedAtLoginOrLockScreen[i]);
+ }
+ for (size_t i = 0; i < kActionsAllowedAtLockScreenLength; ++i) {
+ actions_allowed_at_lock_screen_.insert(kActionsAllowedAtLockScreen[i]);
}
for (size_t i = 0; i < kAcceleratorDataLength; ++i) {
@@ -265,18 +271,22 @@ bool AcceleratorController::AcceleratorPressed(
AcceleratorAction action = static_cast<AcceleratorAction>(it->second);
ash::Shell* shell = ash::Shell::GetInstance();
+ bool at_login_screen = false;
#if defined(OS_CHROMEOS)
- bool at_login_screen = shell->IsScreenLocked() ||
- (shell->delegate() && !shell->delegate()->IsUserLoggedIn());
-#else
- bool at_login_screen = shell->IsScreenLocked();
-#endif // OS_CHROMEOS
+ at_login_screen = (shell->delegate() && !shell->delegate()->IsUserLoggedIn());
+#endif
+ bool at_lock_screen = shell->IsScreenLocked();
if (at_login_screen &&
actions_allowed_at_login_screen_.find(action) ==
actions_allowed_at_login_screen_.end()) {
return false;
}
+ if (at_lock_screen &&
+ actions_allowed_at_lock_screen_.find(action) ==
+ actions_allowed_at_lock_screen_.end()) {
+ return false;
+ }
switch (action) {
case CYCLE_BACKWARD_MRU:
« no previous file with comments | « ash/accelerators/accelerator_controller.h ('k') | ash/accelerators/accelerator_table.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698