| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |