Chromium Code Reviews| Index: chrome/browser/ui/cocoa/constrained_window/constrained_window_button.mm |
| diff --git a/chrome/browser/ui/cocoa/constrained_window/constrained_window_button.mm b/chrome/browser/ui/cocoa/constrained_window/constrained_window_button.mm |
| index 9ea5fe9033078ebe66ba7cb3255fa80418f95bd4..8a981da83f6d67f3d317a72d1fecc9b60ebee62b 100644 |
| --- a/chrome/browser/ui/cocoa/constrained_window/constrained_window_button.mm |
| +++ b/chrome/browser/ui/cocoa/constrained_window/constrained_window_button.mm |
| @@ -4,6 +4,8 @@ |
| #import "chrome/browser/ui/cocoa/constrained_window/constrained_window_button.h" |
| +#import <Carbon/Carbon.h> // kVK_Return. |
| + |
| #include "base/mac/scoped_nsobject.h" |
| #import "chrome/browser/ui/cocoa/key_equivalent_constants.h" |
| #include "skia/ext/skia_utils_mac.h" |
| @@ -245,6 +247,20 @@ void DrawBorder(const NSRect& frame, |
| [path stroke]; |
| } |
| +- (BOOL)canBecomeKeyView { |
| + return YES; |
| +} |
| + |
| +- (void)keyDown:(NSEvent*)event { |
| + // Since there is no default button in the bubble, it is safe to activate |
| + // all buttons on Enter as well, and be consistent with the Windows |
| + // implementation. |
| + if ([event keyCode] == kVK_Return) |
|
Robert Sesek
2016/03/25 20:16:03
Return is not typically how buttons are invoked on
juncai
2016/03/25 20:31:54
The space works without this change to -keyDown:.
|
| + [self performClick:self]; |
| + else |
| + [super keyDown:event]; |
| +} |
| + |
| @end |
| @implementation ConstrainedWindowButtonCell |