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

Unified Diff: chrome/browser/global_keyboard_shortcuts_mac.h

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: Fix review issues. Created 4 years, 2 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: chrome/browser/global_keyboard_shortcuts_mac.h
diff --git a/chrome/browser/global_keyboard_shortcuts_mac.h b/chrome/browser/global_keyboard_shortcuts_mac.h
index be5223ed8af0ce79993c978871c9b568cde7ff72..3844058c06973502aa3f39db1e01e571a89b3eea 100644
--- a/chrome/browser/global_keyboard_shortcuts_mac.h
+++ b/chrome/browser/global_keyboard_shortcuts_mac.h
@@ -65,9 +65,24 @@ int CommandForBrowserKeyboardShortcut(
bool command_key, bool shift_key, bool cntrl_key, bool opt_key,
int vkey_code, unichar key_char);
+// This returns shortcuts that should work no matter what component of the
+// browser is focused. They are executed by the window, after any view has the
+// opportunity to override the shortcut.
+// Only handles shortcuts that are impossible to migrate to accelerator_table.cc
+// (crbug.com/25946).
+int CommandForMacViewsKeyboardShortcut(
+ bool command_key, bool shift_key, bool cntrl_key, bool opt_key,
+ int vkey_code, unichar key_char);
+
// Returns the Chrome command associated with |event|, or -1 if not found.
+// Internally consults WindowKeyboardShortcutTable and
+// BrowserKeyboardShortcutTable, which are not appropriate for MacViews.
int CommandForKeyEvent(NSEvent* event);
+// Returns the Chrome command associated with |event|, or -1 if not found.
+// Only appropriate for use on MacViews.
+int CommandForKeyEventOnMacViews(NSEvent* event);
+
// Returns a keyboard event character for the given |event|. In most cases
// this returns the first character of [NSEvent charactersIgnoringModifiers],
// but when [NSEvent character] has different printable ascii character
@@ -81,7 +96,9 @@ unichar KeyCharacterForEvent(NSEvent* event);
const KeyboardShortcutData* GetWindowKeyboardShortcutTable(size_t* num_entries);
const KeyboardShortcutData*
GetDelayedWindowKeyboardShortcutTable(size_t* num_entries);
-const KeyboardShortcutData*
- GetBrowserKeyboardShortcutTable(size_t* num_entries);
+const KeyboardShortcutData* GetBrowserKeyboardShortcutTable(
+ size_t* num_entries);
+const KeyboardShortcutData* GetMacViewsKeyboardShortcutTable(
+ size_t* num_entries);
#endif // #ifndef CHROME_BROWSER_GLOBAL_KEYBOARD_SHORTCUTS_MAC_H_
« no previous file with comments | « no previous file | chrome/browser/global_keyboard_shortcuts_mac.mm » ('j') | chrome/browser/global_keyboard_shortcuts_mac.mm » ('J')

Powered by Google App Engine
This is Rietveld 408576698