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

Unified Diff: ash/accelerators/accelerator_controller.cc

Issue 10977088: Fix for Ash shortcuts unexpectedly working in system model dialog (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 3 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/accelerators/accelerator_controller.cc
diff --git a/ash/accelerators/accelerator_controller.cc b/ash/accelerators/accelerator_controller.cc
index fc050a1b7392670193293d0a50f90bc3990a3bd9..914a1e8cc347120455f5b3e7593299a851f125c9 100644
--- a/ash/accelerators/accelerator_controller.cc
+++ b/ash/accelerators/accelerator_controller.cc
@@ -350,6 +350,9 @@ void AcceleratorController::Init() {
for (size_t i = 0; i < kActionsAllowedAtLockScreenLength; ++i) {
actions_allowed_at_lock_screen_.insert(kActionsAllowedAtLockScreen[i]);
}
+ for (size_t i = 0; i < kActionsAllowedAtModalWindowLength; ++i) {
+ actions_allowed_at_modal_window_.insert(kActionsAllowedAtModalWindow[i]);
+ }
for (size_t i = 0; i < kReservedActionsLength; ++i) {
reserved_actions_.insert(kReservedActions[i]);
}
@@ -410,6 +413,7 @@ bool AcceleratorController::PerformAction(int action,
at_login_screen = shell->delegate() && !shell->delegate()->IsSessionStarted();
#endif
bool at_lock_screen = shell->IsScreenLocked();
+ bool at_modal_window = shell->IsModalWindowOpen();
if (at_login_screen &&
actions_allowed_at_login_screen_.find(action) ==
@@ -421,6 +425,15 @@ bool AcceleratorController::PerformAction(int action,
actions_allowed_at_lock_screen_.end()) {
return false;
}
+ if (at_modal_window &&
+ actions_allowed_at_modal_window_.find(action) ==
+ actions_allowed_at_modal_window_.end()) {
+ // Note: we return true. This indicates the shortcut is handled
+ // and will not be passed to the modal window. This is important
+ // for things Alt+Tab that would cause an undesired effect in
Daniel Erat 2012/09/30 01:24:47 nit: s/things/things like/
sschmitz 2012/10/15 23:50:34 Done.
+ // the modal window by cycling through its window elements.
+ return true;
+ }
const ui::KeyboardCode key_code = accelerator.key_code();
const ui::AcceleratorManagerContext& context =

Powered by Google App Engine
This is Rietveld 408576698