Index: chrome/browser/ui/cocoa/chrome_command_dispatch_delegate.h |
diff --git a/chrome/browser/ui/cocoa/chrome_command_dispatch_delegate.h b/chrome/browser/ui/cocoa/chrome_command_dispatch_delegate.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..88afef207b687a0b32225cb49e625842d0644fe4 |
--- /dev/null |
+++ b/chrome/browser/ui/cocoa/chrome_command_dispatch_delegate.h |
@@ -0,0 +1,27 @@ |
+// Copyright 2015 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. |
+ |
+#ifndef CHROME_BROWSER_UI_COCOA_CHROME_COMMAND_DISPATCH_DELEGATE_H_ |
+#define CHROME_BROWSER_UI_COCOA_CHROME_COMMAND_DISPATCH_DELEGATE_H_ |
+ |
+#import <Cocoa/Cocoa.h> |
+ |
+#import "ui/base/cocoa/command_dispatch_delegate.h" |
+ |
+// Implement CommandDispatchDelegate by intercepting browser window keyboard |
+// shortcuts and executing them with chrome::ExecuteCommand. |
+@interface ChromeCommandDispatchDelegate : NSObject<CommandDispatchDelegate> { |
+ @private |
+ BOOL redispatchingEvent_; |
+ BOOL eventHandled_; |
+} |
+ |
+// Checks if |event| is a window, delayed window, or browser keyboard shortcut. |
+// (See global_keyboard_shortcuts_mac.h for details). If so, execute the |
+// associated command. Returns YES if the event was handled. |
+- (BOOL)handleExtraKeyboardShortcut:(NSEvent*)event window:(NSWindow*)window; |
+ |
+@end |
+ |
+#endif // CHROME_BROWSER_UI_COCOA_CHROME_COMMAND_DISPATCH_DELEGATE_H_ |