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

Unified Diff: chrome/browser/ui/views/accelerator_table.cc

Issue 2128243003: Make most browser accelerators not repeat. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update comment in test Created 4 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
« no previous file with comments | « chrome/browser/ui/views/accelerator_table.h ('k') | chrome/browser/ui/views/frame/browser_view.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/accelerator_table.cc
diff --git a/chrome/browser/ui/views/accelerator_table.cc b/chrome/browser/ui/views/accelerator_table.cc
index 2e07e0975ef74738843e56aa638d13044b217e75..f674d5a8f92abd8abc18a0c07fd5333fe0b799c3 100644
--- a/chrome/browser/ui/views/accelerator_table.cc
+++ b/chrome/browser/ui/views/accelerator_table.cc
@@ -179,7 +179,7 @@ const AcceleratorMapping kAcceleratorMap[] = {
// via WM_APPCOMMAND.
{ ui::VKEY_BROWSER_SEARCH, ui::EF_NONE, IDC_FOCUS_SEARCH },
{ ui::VKEY_M, ui::EF_SHIFT_DOWN | kPlatformModifier, IDC_SHOW_AVATAR_MENU},
- // On ChromeOS, these keys are assigned to change UI scale.
+ // On Chrome OS, these keys are assigned to change UI scale.
{ ui::VKEY_OEM_PLUS, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN, IDC_ZOOM_PLUS },
{ ui::VKEY_OEM_MINUS, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN,
IDC_ZOOM_MINUS },
@@ -198,6 +198,18 @@ const AcceleratorMapping kAcceleratorMap[] = {
};
const size_t kAcceleratorMapLength = arraysize(kAcceleratorMap);
+const int kRepeatableCommandIds[] = {
+ IDC_FIND_NEXT,
+ IDC_FIND_PREVIOUS,
+ IDC_FOCUS_NEXT_PANE,
+ IDC_FOCUS_PREVIOUS_PANE,
+ IDC_MOVE_TAB_NEXT,
+ IDC_MOVE_TAB_PREVIOUS,
+ IDC_SELECT_NEXT_TAB,
+ IDC_SELECT_PREVIOUS_TAB,
+};
+const size_t kRepeatableCommandIdsLength = arraysize(kRepeatableCommandIds);
+
#if defined(USE_ASH)
// Below we map Chrome command ids to Ash action ids for commands that have
// an shortcut that is handled by Ash (instead of Chrome). Adding entries
@@ -268,4 +280,12 @@ bool GetStandardAcceleratorForCommandId(int command_id,
return false;
}
+bool IsCommandRepeatable(int command_id) {
+ for (size_t i = 0; i < kRepeatableCommandIdsLength; ++i) {
+ if (kRepeatableCommandIds[i] == command_id)
+ return true;
+ }
+ return false;
+}
+
} // namespace chrome
« no previous file with comments | « chrome/browser/ui/views/accelerator_table.h ('k') | chrome/browser/ui/views/frame/browser_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698