| Index: chrome/browser/chrome_application_mac.mm
|
| diff --git a/chrome/browser/chrome_application_mac.mm b/chrome/browser/chrome_application_mac.mm
|
| index a94d3aac93e1ead66cf62586da73bee921eae574..456ba3533b74d6ad838c7de42bd0c20f045fc10d 100644
|
| --- a/chrome/browser/chrome_application_mac.mm
|
| +++ b/chrome/browser/chrome_application_mac.mm
|
| @@ -4,6 +4,8 @@
|
|
|
| #import "chrome/browser/chrome_application_mac.h"
|
|
|
| +#import "chrome/browser/renderer_host/render_widget_host_view_mac.h"
|
| +
|
| @implementation CrApplication
|
|
|
| // -terminate: is the entry point for orderly "quit" operations in Cocoa.
|
| @@ -83,4 +85,25 @@
|
| return [super sendAction:anAction to:aTarget from:sender];
|
| }
|
|
|
| +- (void)sendEvent:(NSEvent*)event {
|
| + // The superclass's |sendEvent:| sends keyboard events to the menu before
|
| + // dispatching them to |keyDown:|. Since we want to send keys to the renderer
|
| + // before sending them to the menu, change this behavior.
|
| + if ([event type] == NSKeyDown || [event type] == NSKeyUp) {
|
| + 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;
|
| +
|
| + [[self keyWindow] sendEvent:event];
|
| + return;
|
| + }
|
| + }
|
| +
|
| + [super sendEvent:event];
|
| +}
|
| +
|
| @end
|
|
|