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

Unified Diff: ash/accelerators/accelerator_controller.cc

Issue 12389083: cros: Add app mode restrictions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: for comments in #3 Created 7 years, 10 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 b9e12bb24763e2f3170ee0a4676d4e29db8d4f5a..68291486e30cb29c6952d1adb45d0dccdbc15f15 100644
--- a/ash/accelerators/accelerator_controller.cc
+++ b/ash/accelerators/accelerator_controller.cc
@@ -337,6 +337,8 @@ void AcceleratorController::Init() {
reserved_actions_.insert(kReservedActions[i]);
for (size_t i = 0; i < kNonrepeatableActionsLength; ++i)
nonrepeatable_actions_.insert(kNonrepeatableActions[i]);
+ for (size_t i = 0; i < kActionsAllowedInAppModeLength; ++i)
+ actions_allowed_in_app_mode_.insert(kActionsAllowedInAppMode[i]);
RegisterAccelerators(kAcceleratorData, kAcceleratorDataLength);
@@ -417,6 +419,12 @@ bool AcceleratorController::PerformAction(int action,
// in the modal window by cycling through its window elements.
return true;
}
+ if (shell->delegate()->IsRunningInForcedAppMode() &&
+ actions_allowed_in_app_mode_.find(action) ==
+ actions_allowed_in_app_mode_.end()) {
+ return false;
+ }
+
const ui::KeyboardCode key_code = accelerator.key_code();
// PerformAction() is performed from gesture controllers and passes
// empty Accelerator() instance as the second argument. Such events
« 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