Chromium Code Reviews| 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 830 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 841 - (void)setRightMarginSpacing:(int)rightMarginSpacing; | 841 - (void)setRightMarginSpacing:(int)rightMarginSpacing; |
| 842 @end | 842 @end |
| 843 | 843 |
| 844 @implementation BackgroundColorHoverButton | 844 @implementation BackgroundColorHoverButton |
| 845 | 845 |
| 846 - (id)initWithFrame:(NSRect)frameRect | 846 - (id)initWithFrame:(NSRect)frameRect |
| 847 imageTitleSpacing:(int)imageTitleSpacing | 847 imageTitleSpacing:(int)imageTitleSpacing |
| 848 backgroundColor:(NSColor*)backgroundColor { | 848 backgroundColor:(NSColor*)backgroundColor { |
| 849 if ((self = [super initWithFrame:frameRect])) { | 849 if ((self = [super initWithFrame:frameRect])) { |
| 850 backgroundColor_.reset([backgroundColor retain]); | 850 backgroundColor_.reset([backgroundColor retain]); |
| 851 // Use a color from Aura, since this button is not trying to look like a | 851 // TODO(estade): share this with the Views version of this code. |
|
sky
2016/10/03 16:12:05
Why not move it now? Maybe in c/b/ui/profile_choos
Evan Stade
2016/10/03 19:46:44
I suspect we want to refactor this code to make it
| |
| 852 // native control. | 852 SkColor hoverColor = SkColorSetRGB(0xEA, 0xEA, 0xEA); |
| 853 SkColor hoverColor = ui::GetAuraColor( | |
| 854 ui::NativeTheme::kColorId_ButtonHoverBackgroundColor, nullptr); | |
| 855 hoverColor_.reset([skia::SkColorToSRGBNSColor(hoverColor) retain]); | 853 hoverColor_.reset([skia::SkColorToSRGBNSColor(hoverColor) retain]); |
| 856 | 854 |
| 857 [self setBordered:NO]; | 855 [self setBordered:NO]; |
| 858 [self setFont:[NSFont labelFontOfSize:kTextFontSize]]; | 856 [self setFont:[NSFont labelFontOfSize:kTextFontSize]]; |
| 859 [self setButtonType:NSMomentaryChangeButton]; | 857 [self setButtonType:NSMomentaryChangeButton]; |
| 860 | 858 |
| 861 base::scoped_nsobject<CustomPaddingImageButtonCell> cell( | 859 base::scoped_nsobject<CustomPaddingImageButtonCell> cell( |
| 862 [[CustomPaddingImageButtonCell alloc] | 860 [[CustomPaddingImageButtonCell alloc] |
| 863 initWithLeftMarginSpacing:kHorizontalSpacing | 861 initWithLeftMarginSpacing:kHorizontalSpacing |
| 864 imageTitleSpacing:imageTitleSpacing]); | 862 imageTitleSpacing:imageTitleSpacing]); |
| (...skipping 2071 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2936 } | 2934 } |
| 2937 | 2935 |
| 2938 - (bool)shouldShowGoIncognito { | 2936 - (bool)shouldShowGoIncognito { |
| 2939 bool incognitoAvailable = | 2937 bool incognitoAvailable = |
| 2940 IncognitoModePrefs::GetAvailability(browser_->profile()->GetPrefs()) != | 2938 IncognitoModePrefs::GetAvailability(browser_->profile()->GetPrefs()) != |
| 2941 IncognitoModePrefs::DISABLED; | 2939 IncognitoModePrefs::DISABLED; |
| 2942 return incognitoAvailable && !browser_->profile()->IsGuestSession(); | 2940 return incognitoAvailable && !browser_->profile()->IsGuestSession(); |
| 2943 } | 2941 } |
| 2944 | 2942 |
| 2945 @end | 2943 @end |
| OLD | NEW |