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

Unified Diff: chrome/browser/cocoa/chrome_event_processing_window.mm

Issue 491023: Add a keyboard shortcut on Escape that emits the IDC_STOP command.... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 11 years 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/cocoa/chrome_event_processing_window.mm
===================================================================
--- chrome/browser/cocoa/chrome_event_processing_window.mm (revision 34671)
+++ chrome/browser/cocoa/chrome_event_processing_window.mm (working copy)
@@ -44,6 +44,11 @@
fromTable:CommandForWindowKeyboardShortcut];
}
+- (BOOL)handleDelayedWindowKeyboardShortcut:(NSEvent*)event {
+ return [self handleExtraKeyboardShortcut:event
+ fromTable:CommandForDelayedWindowKeyboardShortcut];
+}
+
- (BOOL)handleExtraBrowserKeyboardShortcut:(NSEvent*)event {
return [self handleExtraKeyboardShortcut:event
fromTable:CommandForBrowserKeyboardShortcut];
@@ -64,7 +69,13 @@
// if e.g. the Omnibox has focus).
if ([self handleExtraWindowKeyboardShortcut:event])
return YES;
- return [super performKeyEquivalent:event];
+
+ if ([super performKeyEquivalent:event])
+ return YES;
+
+ // Handle per-window shortcuts like Esc after giving everybody else a chance
+ // to handle them
+ return [self handleDelayedWindowKeyboardShortcut:event];
}
- (BOOL)redispatchEvent:(NSEvent*)event {
« no previous file with comments | « chrome/browser/cocoa/chrome_event_processing_window.h ('k') | chrome/browser/global_keyboard_shortcuts_mac.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698