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

Unified Diff: chrome/browser/ui/cocoa/chrome_command_dispatcher_delegate.h

Issue 1259903002: DO NOT COMMIT: [Mac] Refactor keyboard shortcut handling so it can be reused in Views. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Sync to new CommandDispatcher design. Created 5 years, 4 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.h
diff --git a/chrome/browser/ui/cocoa/chrome_command_dispatcher_delegate.h b/chrome/browser/ui/cocoa/chrome_command_dispatcher_delegate.h
new file mode 100644
index 0000000000000000000000000000000000000000..ac56759785f010780a73ee1d30a1c98e5f2b5fd8
--- /dev/null
+++ b/chrome/browser/ui/cocoa/chrome_command_dispatcher_delegate.h
@@ -0,0 +1,24 @@
+// 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_DISPATCHER_DELEGATE_H_
+#define CHROME_BROWSER_UI_COCOA_CHROME_COMMAND_DISPATCHER_DELEGATE_H_
+
+#import <Cocoa/Cocoa.h>
+
+#import "ui/base/cocoa/command_dispatcher.h"
+
+// Implement CommandDispatcherDelegate by intercepting browser window keyboard
+// shortcuts and executing them with chrome::ExecuteCommand.
+@interface ChromeCommandDispatcherDelegate
+ : NSObject<CommandDispatcherDelegate, UserInterfaceItemCommandHandler>
+
+// Checks if |event| is a keyboard shortcut listed in
+// global_keyboard_shortcuts_mac.h. 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_DISPATCHER_DELEGATE_H_
« no previous file with comments | « chrome/browser/ui/cocoa/browser_window_controller.mm ('k') | chrome/browser/ui/cocoa/chrome_command_dispatcher_delegate.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698