Chromium Code Reviews| Index: chrome/browser/chrome_application_mac.mm |
| diff --git a/chrome/browser/chrome_application_mac.mm b/chrome/browser/chrome_application_mac.mm |
| index aece9a0bdba395179933ea77530e233a5c1acc64..d9b5eb4ec48ea9dfbe710061e9364c53b8a08216 100644 |
| --- a/chrome/browser/chrome_application_mac.mm |
| +++ b/chrome/browser/chrome_application_mac.mm |
| @@ -8,6 +8,7 @@ |
| #import "base/logging.h" |
| #import "base/scoped_nsobject.h" |
| #import "chrome/app/breakpad_mac.h" |
| +#import "chrome/browser/renderer_host/render_widget_host_view_mac.h" |
| namespace CrApplicationNSException { |
| @@ -184,6 +185,29 @@ class ScopedCrashKey { |
| return [super sendAction:anAction to:aTarget from:sender]; |
| } |
| +- (void)sendEvent:(NSEvent*)event { |
|
Mark Mentovai
2009/10/22 20:44:36
This change may have regressed startup time, but t
|
| + // The superclass's |sendEvent:| sends keyboard events to the menu and the key |
| + // view loop before dispatching them to |keyDown:|. Since we want to send keys |
| + // to the renderer before sending them to the menu, and we never want them to |
| + // the kev view loop when the web is focussed, we change this behavior. |
| + if ([event type] == NSKeyDown || [event type] == NSKeyUp) { |
|
pink (ping after 24hrs)
2009/10/19 15:18:24
I really dislike the app controller having this ki
Nico
2009/10/19 20:06:43
I'm addressing this comment (and more) in http://c
|
| + if ([[[self keyWindow] firstResponder] |
| + isKindOfClass:[RenderWidgetHostViewCocoa class]]) { |
| + // No other mac browser sends keyup() for keyboard equivalents, so let's |
| + // suppress this. |
| + if (([event modifierFlags] & NSCommandKeyMask) && [event type] == NSKeyUp) |
| + return; |
| + |
| + RenderWidgetHostViewCocoa* rwhv = static_cast<RenderWidgetHostViewCocoa*>( |
| + [[self keyWindow] firstResponder]); |
| + [rwhv keyEvent:event]; |
| + return; |
| + } |
| + } |
| + |
| + [super sendEvent:event]; |
| +} |
| + |
| // NSExceptions which are caught by the event loop are logged here. |
| // NSException uses setjmp/longjmp, which can be very bad for C++, so |
| // we attempt to track and report them. |