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

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

Issue 2382443007: Clean up NativeTheme (particularly CommonTheme). (Closed)
Patch Set: share color constant 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
« no previous file with comments | « no previous file | chrome/browser/ui/libgtk2ui/gtk2_ui.cc » ('j') | 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 27 matching lines...) Expand all
38 #include "chrome/browser/ui/browser_commands.h" 38 #include "chrome/browser/ui/browser_commands.h"
39 #include "chrome/browser/ui/browser_list.h" 39 #include "chrome/browser/ui/browser_list.h"
40 #include "chrome/browser/ui/browser_window.h" 40 #include "chrome/browser/ui/browser_window.h"
41 #include "chrome/browser/ui/chrome_pages.h" 41 #include "chrome/browser/ui/chrome_pages.h"
42 #include "chrome/browser/ui/chrome_style.h" 42 #include "chrome/browser/ui/chrome_style.h"
43 #import "chrome/browser/ui/cocoa/browser_window_utils.h" 43 #import "chrome/browser/ui/cocoa/browser_window_utils.h"
44 #import "chrome/browser/ui/cocoa/info_bubble_view.h" 44 #import "chrome/browser/ui/cocoa/info_bubble_view.h"
45 #import "chrome/browser/ui/cocoa/info_bubble_window.h" 45 #import "chrome/browser/ui/cocoa/info_bubble_window.h"
46 #include "chrome/browser/ui/cocoa/profiles/signin_view_controller_delegate_mac.h " 46 #include "chrome/browser/ui/cocoa/profiles/signin_view_controller_delegate_mac.h "
47 #import "chrome/browser/ui/cocoa/profiles/user_manager_mac.h" 47 #import "chrome/browser/ui/cocoa/profiles/user_manager_mac.h"
48 #include "chrome/browser/ui/profile_chooser_constants.h"
48 #include "chrome/browser/ui/singleton_tabs.h" 49 #include "chrome/browser/ui/singleton_tabs.h"
49 #include "chrome/browser/ui/user_manager.h" 50 #include "chrome/browser/ui/user_manager.h"
50 #include "chrome/browser/ui/webui/signin/login_ui_service.h" 51 #include "chrome/browser/ui/webui/signin/login_ui_service.h"
51 #include "chrome/browser/ui/webui/signin/login_ui_service_factory.h" 52 #include "chrome/browser/ui/webui/signin/login_ui_service_factory.h"
52 #include "chrome/common/pref_names.h" 53 #include "chrome/common/pref_names.h"
53 #include "chrome/common/url_constants.h" 54 #include "chrome/common/url_constants.h"
54 #include "chrome/grit/chromium_strings.h" 55 #include "chrome/grit/chromium_strings.h"
55 #include "chrome/grit/generated_resources.h" 56 #include "chrome/grit/generated_resources.h"
56 #include "chrome/grit/theme_resources.h" 57 #include "chrome/grit/theme_resources.h"
57 #include "components/browser_sync/profile_sync_service.h" 58 #include "components/browser_sync/profile_sync_service.h"
(...skipping 783 matching lines...) Expand 10 before | Expand all | Expand 10 after
841 - (void)setRightMarginSpacing:(int)rightMarginSpacing; 842 - (void)setRightMarginSpacing:(int)rightMarginSpacing;
842 @end 843 @end
843 844
844 @implementation BackgroundColorHoverButton 845 @implementation BackgroundColorHoverButton
845 846
846 - (id)initWithFrame:(NSRect)frameRect 847 - (id)initWithFrame:(NSRect)frameRect
847 imageTitleSpacing:(int)imageTitleSpacing 848 imageTitleSpacing:(int)imageTitleSpacing
848 backgroundColor:(NSColor*)backgroundColor { 849 backgroundColor:(NSColor*)backgroundColor {
849 if ((self = [super initWithFrame:frameRect])) { 850 if ((self = [super initWithFrame:frameRect])) {
850 backgroundColor_.reset([backgroundColor retain]); 851 backgroundColor_.reset([backgroundColor retain]);
851 // Use a color from Aura, since this button is not trying to look like a 852 hoverColor_.reset([skia::SkColorToSRGBNSColor(profiles::kHoverColor)
852 // native control. 853 retain]);
853 SkColor hoverColor = ui::GetAuraColor(
854 ui::NativeTheme::kColorId_ButtonHoverBackgroundColor, nullptr);
855 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]);
865 [cell setLineBreakMode:NSLineBreakByTruncatingTail]; 863 [cell setLineBreakMode:NSLineBreakByTruncatingTail];
(...skipping 2070 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') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698