Index: chrome/browser/ui/cocoa/chrome_event_processing_window.mm |
diff --git a/chrome/browser/ui/cocoa/chrome_event_processing_window.mm b/chrome/browser/ui/cocoa/chrome_event_processing_window.mm |
index 85e0cc704c07b99faf0d543b0df0c76d1183f477..43d0feb3e9e780e7edcab49776bfd9e51770bc2d 100644 |
--- a/chrome/browser/ui/cocoa/chrome_event_processing_window.mm |
+++ b/chrome/browser/ui/cocoa/chrome_event_processing_window.mm |
@@ -61,18 +61,25 @@ typedef int (*KeyToCommandMapper)(bool, bool, bool, bool, int, unichar); |
} |
- (BOOL)performKeyEquivalent:(NSEvent*)event { |
- if (redispatchingEvent_) |
- return NO; |
- |
+ // Some extension commands have higher priority than web content, and some |
+ // have lower priority. Regardless of whether the event is being |
+ // redispatched, let the extension system try to handle the event. |
NSWindow* window = event.window; |
if (window) { |
BrowserWindowController* controller = [window windowController]; |
- if ([controller respondsToSelector:@selector(handledByExtensionCommand:)]) { |
- if ([controller handledByExtensionCommand:event]) |
+ if ([controller respondsToSelector:@selector(handledByExtensionCommand: |
+ priority:)]) { |
+ ui::AcceleratorManager::HandlerPriority priority = |
+ redispatchingEvent_ ? ui::AcceleratorManager::kNormalPriority |
+ : ui::AcceleratorManager::kHighPriority; |
+ if ([controller handledByExtensionCommand:event priority:priority]) |
return YES; |
} |
} |
+ if (redispatchingEvent_) |
+ return NO; |
+ |
// Give the web site a chance to handle the event. If it doesn't want to |
// handle it, it will call us back with one of the |handle*| methods above. |
NSResponder* r = [self firstResponder]; |