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

Unified Diff: ash/accelerators/accelerator_controller.cc

Issue 2130603002: ash: Explicitly enumerate repeatable accelerators. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 c90b71777c260974419f76c5bbebb801b1132390..a76b761ffcfcb2f91f8b7f021deffb5b2475ed33 100644
--- a/ash/accelerators/accelerator_controller.cc
+++ b/ash/accelerators/accelerator_controller.cc
@@ -904,8 +904,8 @@ void AcceleratorController::Init() {
preferred_actions_.insert(kPreferredActions[i]);
for (size_t i = 0; i < kReservedActionsLength; ++i)
reserved_actions_.insert(kReservedActions[i]);
- for (size_t i = 0; i < kNonrepeatableActionsLength; ++i)
- nonrepeatable_actions_.insert(kNonrepeatableActions[i]);
+ for (size_t i = 0; i < kRepeatableActionsLength; ++i)
+ repeatable_actions_.insert(kRepeatableActions[i]);
for (size_t i = 0; i < kActionsAllowedInAppModeOrPinnedModeLength; ++i) {
actions_allowed_in_app_mode_.insert(
kActionsAllowedInAppModeOrPinnedMode[i]);
@@ -971,10 +971,8 @@ void AcceleratorController::RegisterDeprecatedAccelerators() {
bool AcceleratorController::CanPerformAction(
AcceleratorAction action,
const ui::Accelerator& accelerator) {
- if (nonrepeatable_actions_.find(action) != nonrepeatable_actions_.end() &&
- accelerator.IsRepeat()) {
+ if (accelerator.IsRepeat() && !repeatable_actions_.count(action))
return false;
- }
AcceleratorProcessingRestriction restriction =
GetAcceleratorProcessingRestriction(action);
« 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