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

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

Issue 2382443007: Clean up NativeTheme (particularly CommonTheme). (Closed)
Patch Set: two slight fixes Created 4 years, 2 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
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 830 matching lines...) Expand 10 before | Expand all | Expand 10 after
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.
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
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
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/libgtk2ui/gtk2_ui.cc » ('j') | chrome/browser/ui/libgtk2ui/native_theme_gtk2.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698