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

Unified Diff: chrome/browser/ui/cocoa/chrome_command_dispatcher_delegate.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: 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/ui/cocoa/chrome_command_dispatcher_delegate.mm
diff --git a/chrome/browser/ui/cocoa/chrome_command_dispatcher_delegate.mm b/chrome/browser/ui/cocoa/chrome_command_dispatcher_delegate.mm
index 6d3cd88777924595c3554a6767da7a36d40e2e66..67c762e445fe9c9e79ca6ab96cb5e76f0fc415f1 100644
--- a/chrome/browser/ui/cocoa/chrome_command_dispatcher_delegate.mm
+++ b/chrome/browser/ui/cocoa/chrome_command_dispatcher_delegate.mm
@@ -13,11 +13,25 @@
namespace {
-// Type of functions listed in global_keyboard_shortcuts_mac.h.
-typedef int (*KeyToCommandMapper)(bool, bool, bool, bool, int, unichar);
+bool HandleExtraWindowKeyboardShortcut(NSEvent* event, NSWindow* window) {
+ return command_dispatcher::HandleExtraKeyboardShortcut(
+ event, window, CommandForWindowKeyboardShortcut);
+}
+
+bool HandleDelayedWindowKeyboardShortcut(NSEvent* event, NSWindow* window) {
+ return command_dispatcher::HandleExtraKeyboardShortcut(
+ event, window, CommandForDelayedWindowKeyboardShortcut);
+}
+
+bool HandleExtraBrowserKeyboardShortcut(NSEvent* event, NSWindow* window) {
+ return command_dispatcher::HandleExtraKeyboardShortcut(
+ event, window, CommandForBrowserKeyboardShortcut);
+}
+
+} // namespace
+
+namespace command_dispatcher {
-// If the event is for a Browser window, and the key combination has an
-// associated command, execute the command.
bool HandleExtraKeyboardShortcut(
NSEvent* event,
NSWindow* window,
@@ -46,22 +60,7 @@ bool HandleExtraKeyboardShortcut(
return true;
}
-bool HandleExtraWindowKeyboardShortcut(NSEvent* event, NSWindow* window) {
- return HandleExtraKeyboardShortcut(event, window,
- CommandForWindowKeyboardShortcut);
-}
-
-bool HandleDelayedWindowKeyboardShortcut(NSEvent* event, NSWindow* window) {
- return HandleExtraKeyboardShortcut(event, window,
- CommandForDelayedWindowKeyboardShortcut);
-}
-
-bool HandleExtraBrowserKeyboardShortcut(NSEvent* event, NSWindow* window) {
- return HandleExtraKeyboardShortcut(event, window,
- CommandForBrowserKeyboardShortcut);
-}
-
-} // namespace
+} // namespace command_dispatcher
@implementation ChromeCommandDispatcherDelegate

Powered by Google App Engine
This is Rietveld 408576698