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

Unified Diff: chrome/browser/global_keyboard_shortcuts_cocoa_mac.mm

Issue 2074643003: MacViews: Views accelerators table should match the Cocoa one. (Closed) Base URL: ssh://bitbucket.browser.yandex-team.ru/chromium/src.git@master
Patch Set: GetWindowKeyboardShortcutTable is now shared between Cocoa and MacViews. Created 4 years, 1 month 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: chrome/browser/global_keyboard_shortcuts_cocoa_mac.mm
diff --git a/chrome/browser/global_keyboard_shortcuts_cocoa_mac.mm b/chrome/browser/global_keyboard_shortcuts_cocoa_mac.mm
new file mode 100644
index 0000000000000000000000000000000000000000..9ff196aa498b0b923ebdc07f0c6409e8968e4dfd
--- /dev/null
+++ b/chrome/browser/global_keyboard_shortcuts_cocoa_mac.mm
@@ -0,0 +1,38 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "base/macros.h"
+#include "chrome/app/chrome_command_ids.h"
+#include "chrome/browser/global_keyboard_shortcuts_mac.h"
+
+// Basically, there are two kinds of keyboard shortcuts: Ones that should work
+// only if the tab contents is focused (BrowserKeyboardShortcut), and ones that
+// should work in all other cases (WindowKeyboardShortcut). In the latter case,
+// we differentiate between shortcuts that are checked before any other view
+// gets the chance to handle them (WindowKeyboardShortcut) or after all views
+// had a chance but did not handle the keypress event
+// (DelayedWindowKeyboardShortcut).
+
+const std::vector<KeyboardShortcutData>&
+GetDelayedWindowKeyboardShortcutTable() {
+ CR_DEFINE_STATIC_LOCAL(std::vector<KeyboardShortcutData>, result, ({
+ //cmd shift cntrl option
+ //--- ----- ----- ------
+ {false, false, false, false, kVK_Escape, 0, IDC_STOP},
+ }));
+ return result;
+}
+
+const std::vector<KeyboardShortcutData>& GetBrowserKeyboardShortcutTable() {
+ CR_DEFINE_STATIC_LOCAL(std::vector<KeyboardShortcutData>, result, ({
+ //cmd shift cntrl option
+ //--- ----- ----- ------
+ {true, false, false, false, kVK_LeftArrow, 0, IDC_BACK},
+ {true, false, false, false, kVK_RightArrow, 0, IDC_FORWARD},
+ {false, false, false, false, kVK_Delete, 0, IDC_BACKSPACE_BACK},
+ {false, true, false, false, kVK_Delete, 0, IDC_BACKSPACE_FORWARD},
+ {true, true, false, false, 0, 'c', IDC_DEV_TOOLS_INSPECT},
+ }));
+ return result;
+}

Powered by Google App Engine
This is Rietveld 408576698