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

Side by Side Diff: chrome/browser/ui/cocoa/profiles/profile_chooser_controller.mm

Issue 2355703004: profile switcher: allow numpad enter for button activations (Closed)
Patch Set: Created 4 years, 3 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #import "chrome/browser/ui/cocoa/profiles/profile_chooser_controller.h" 5 #import "chrome/browser/ui/cocoa/profiles/profile_chooser_controller.h"
6 6
7 #import <Carbon/Carbon.h> // kVK_Return. 7 #import <Carbon/Carbon.h> // kVK_Return.
8 #import <Cocoa/Cocoa.h> 8 #import <Cocoa/Cocoa.h>
9 #include <stddef.h> 9 #include <stddef.h>
10 10
(...skipping 869 matching lines...) Expand 10 before | Expand all | Expand 10 after
880 NSColor* backgroundColor = isHighlighted ? hoverColor_ : backgroundColor_; 880 NSColor* backgroundColor = isHighlighted ? hoverColor_ : backgroundColor_;
881 [[self cell] setBackgroundColor:backgroundColor]; 881 [[self cell] setBackgroundColor:backgroundColor];
882 } 882 }
883 [super drawRect:dirtyRect]; 883 [super drawRect:dirtyRect];
884 } 884 }
885 885
886 -(void)keyDown:(NSEvent*)event { 886 -(void)keyDown:(NSEvent*)event {
887 // Since there is no default button in the bubble, it is safe to activate 887 // Since there is no default button in the bubble, it is safe to activate
888 // all buttons on Enter as well, and be consistent with the Windows 888 // all buttons on Enter as well, and be consistent with the Windows
889 // implementation. 889 // implementation.
890 if ([event keyCode] == kVK_Return) 890 if ([event keyCode] == kVK_Return || [event keyCode] == kVK_ANSI_KeypadEnter)
891 [self performClick:self]; 891 [self performClick:self];
892 else 892 else
893 [super keyDown:event]; 893 [super keyDown:event];
894 } 894 }
895 895
896 - (BOOL)canBecomeKeyView { 896 - (BOOL)canBecomeKeyView {
897 return [self isEnabled] ? YES : NO; 897 return [self isEnabled] ? YES : NO;
898 } 898 }
899 899
900 @end 900 @end
(...skipping 2034 matching lines...) Expand 10 before | Expand all | Expand 10 after
2935 } 2935 }
2936 2936
2937 - (bool)shouldShowGoIncognito { 2937 - (bool)shouldShowGoIncognito {
2938 bool incognitoAvailable = 2938 bool incognitoAvailable =
2939 IncognitoModePrefs::GetAvailability(browser_->profile()->GetPrefs()) != 2939 IncognitoModePrefs::GetAvailability(browser_->profile()->GetPrefs()) !=
2940 IncognitoModePrefs::DISABLED; 2940 IncognitoModePrefs::DISABLED;
2941 return incognitoAvailable && !browser_->profile()->IsGuestSession(); 2941 return incognitoAvailable && !browser_->profile()->IsGuestSession();
2942 } 2942 }
2943 2943
2944 @end 2944 @end
OLDNEW
« 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