Created
November 11, 2016 17:04
-
-
Save mblsha/44bd5f0609c2f0b6c73077ccf310befc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/chrome/browser/ui/cocoa/chrome_command_dispatcher_delegate.mm b/chrome/browser/ui/cocoa/chrome_command_dispatcher_delegate.mm | |
index 6d3cd88..88ad53c 100644 | |
--- a/chrome/browser/ui/cocoa/chrome_command_dispatcher_delegate.mm | |
+++ b/chrome/browser/ui/cocoa/chrome_command_dispatcher_delegate.mm | |
@@ -4,6 +4,10 @@ | |
#import "chrome/browser/ui/cocoa/chrome_command_dispatcher_delegate.h" | |
+#include "ui/views/widget/widget.h" | |
+#include "ui/events/event.h" | |
+#include "ui/views/focus/focus_manager.h" | |
+ | |
#include "base/logging.h" | |
#include "chrome/browser/global_keyboard_shortcuts_mac.h" | |
#include "chrome/browser/ui/browser_commands.h" | |
@@ -103,7 +107,14 @@ bool HandleExtraBrowserKeyboardShortcut(NSEvent* event, NSWindow* window) { | |
- (BOOL)postPerformKeyEquivalent:(NSEvent*)event window:(NSWindow*)window { | |
// Handle per-window shortcuts like Esc after giving everybody else a chance | |
// to handle them | |
- return HandleDelayedWindowKeyboardShortcut(event, window); | |
+ if (HandleDelayedWindowKeyboardShortcut(event, window)) | |
+ return true; | |
+ | |
+ ui::KeyEvent key_event(event); | |
+ ui::Accelerator accelerator(key_event); | |
+ return views::Widget::GetWidgetForNativeWindow(window) | |
+ ->GetFocusManager() | |
+ ->ProcessAccelerator(accelerator); | |
} | |
@end // ChromeCommandDispatchDelegate |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment