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

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

Issue 271054: Send key equivalents to renderer first, sendEvent-based. (Closed)
Patch Set: speling Created 11 years, 2 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
« no previous file with comments | « chrome/browser/chrome_application_mac.mm ('k') | chrome/browser/tab_contents/tab_contents_view_mac.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/cocoa/chrome_browser_window.mm
diff --git a/chrome/browser/cocoa/chrome_browser_window.mm b/chrome/browser/cocoa/chrome_browser_window.mm
index 6786cda3cd38ab406962399a4bc74ab1bdc46f9b..e9eff6c83124fb42aadf27c1f93abd6236f83ae2 100644
--- a/chrome/browser/cocoa/chrome_browser_window.mm
+++ b/chrome/browser/cocoa/chrome_browser_window.mm
@@ -298,16 +298,12 @@ typedef int (*KeyToCommandMapper)(bool, bool, bool, int);
}
- (BOOL)performKeyEquivalent:(NSEvent*)event {
- // 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];
- if ([r isKindOfClass:[RenderWidgetHostViewCocoa class]])
- return [r performKeyEquivalent:event];
-
// Handle per-window shortcuts like cmd-1, but do not handle browser-level
// shortcuts like cmd-left (else, cmd-left would do history navigation even
- // if e.g. the Omnibox has focus).
- if ([self handleExtraWindowKeyboardShortcut:event])
+ // if e.g. the Omnibox has focus). If the web has focus, don't do this here,
+ // since the web needs to get a chance at swallowing the event first.
+ if (![[self firstResponder] isKindOfClass:[RenderWidgetHostViewCocoa class]]
+ && [self handleExtraWindowKeyboardShortcut:event])
return YES;
return [super performKeyEquivalent:event];
}
« no previous file with comments | « chrome/browser/chrome_application_mac.mm ('k') | chrome/browser/tab_contents/tab_contents_view_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698