Index: chrome/browser/ui/cocoa/browser_window_controller.mm |
=================================================================== |
--- chrome/browser/ui/cocoa/browser_window_controller.mm (revision 151684) |
+++ chrome/browser/ui/cocoa/browser_window_controller.mm (working copy) |
@@ -44,6 +44,7 @@ |
#import "chrome/browser/ui/cocoa/dev_tools_controller.h" |
#import "chrome/browser/ui/cocoa/download/download_shelf_controller.h" |
#import "chrome/browser/ui/cocoa/event_utils.h" |
+#include "chrome/browser/ui/cocoa/extensions/extension_keybinding_registry_cocoa.h" |
#import "chrome/browser/ui/cocoa/fast_resize_view.h" |
#import "chrome/browser/ui/cocoa/find_bar/find_bar_bridge.h" |
#import "chrome/browser/ui/cocoa/find_bar/find_bar_cocoa_controller.h" |
@@ -413,6 +414,10 @@ |
if ([self hasToolbar]) // Do not create the buttons in popups. |
[toolbarController_ createBrowserActionButtons]; |
+ extension_keybinding_registry_.reset( |
+ new ExtensionKeybindingRegistryCocoa(browser_->profile(), |
+ [self window])); |
+ |
// We are done initializing now. |
initializing_ = NO; |
} |
@@ -1166,6 +1171,11 @@ |
chrome::ExecuteCommand(browser_.get(), command); |
} |
+- (BOOL)HandledByExtensionCommand:(NSEvent*)event { |
+ return extension_keybinding_registry_->ProcessKeyEvent( |
+ content::NativeWebKeyboardEvent(event)); |
+} |
+ |
// StatusBubble delegate method: tell the status bubble the frame it should |
// position itself in. |
- (NSRect)statusBubbleBaseFrame { |