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

Unified Diff: chrome/browser/ui/cocoa/profiles/profile_chooser_controller.mm

Issue 890143005: [Mac] Allow "Enter" to activate the buttons in the new avatar bubble. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: simplify code Created 5 years, 11 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/profiles/profile_chooser_controller.mm
diff --git a/chrome/browser/ui/cocoa/profiles/profile_chooser_controller.mm b/chrome/browser/ui/cocoa/profiles/profile_chooser_controller.mm
index cbdbc703cd1c1592f58d667de3fac489f5371169..b86fd5541f34527ef4bbcf38841f86eec36d2cdc 100644
--- a/chrome/browser/ui/cocoa/profiles/profile_chooser_controller.mm
+++ b/chrome/browser/ui/cocoa/profiles/profile_chooser_controller.mm
@@ -3,6 +3,7 @@
// found in the LICENSE file.
#import <Cocoa/Cocoa.h>
+#import <Carbon/Carbon.h> // kVK_Return.
#import "chrome/browser/ui/cocoa/profiles/profile_chooser_controller.h"
@@ -789,6 +790,16 @@ class ActiveProfileObserverBridge : public AvatarMenuObserver,
[[self cell] setBackgroundColor:backgroundColor];
}
+-(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)
+ [self performClick:self];
+ else
+ [super keyDown:event];
+}
+
- (BOOL)canBecomeKeyView {
return YES;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698