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

Side by Side Diff: ui/native_theme/native_theme_mac.mm

Issue 2256323003: views: use cross-platform border colors (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: also use the right CallToActionColor 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 (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 #include "ui/native_theme/native_theme_mac.h" 5 #include "ui/native_theme/native_theme_mac.h"
6 6
7 #import <Cocoa/Cocoa.h> 7 #import <Cocoa/Cocoa.h>
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include "base/mac/mac_util.h" 10 #include "base/mac/mac_util.h"
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 case kColorId_WindowBackground: 132 case kColorId_WindowBackground:
133 return NSSystemColorToSkColor([NSColor windowBackgroundColor]); 133 return NSSystemColorToSkColor([NSColor windowBackgroundColor]);
134 case kColorId_DialogBackground: 134 case kColorId_DialogBackground:
135 return ui::MaterialDesignController::IsSecondaryUiMaterial() 135 return ui::MaterialDesignController::IsSecondaryUiMaterial()
136 ? GetAuraColor(color_id, this) 136 ? GetAuraColor(color_id, this)
137 : kDialogBackgroundColor; 137 : kDialogBackgroundColor;
138 case kColorId_BubbleBackground: 138 case kColorId_BubbleBackground:
139 return SK_ColorWHITE; 139 return SK_ColorWHITE;
140 140
141 case kColorId_FocusedBorderColor: 141 case kColorId_FocusedBorderColor:
142 return ui::MaterialDesignController::IsSecondaryUiMaterial()
Evan Stade 2016/08/30 16:09:54 seems perhaps worth separating this out, a la: if
143 ? GetAuraColor(color_id, this)
144 : NSSystemColorToSkColor([NSColor keyboardFocusIndicatorColor]);
142 case kColorId_FocusedMenuButtonBorderColor: 145 case kColorId_FocusedMenuButtonBorderColor:
143 return NSSystemColorToSkColor([NSColor keyboardFocusIndicatorColor]); 146 return NSSystemColorToSkColor([NSColor keyboardFocusIndicatorColor]);
144 case kColorId_UnfocusedBorderColor: 147 case kColorId_UnfocusedBorderColor:
145 return NSSystemColorToSkColor([NSColor controlColor]); 148 return ui::MaterialDesignController::IsSecondaryUiMaterial()
149 ? GetAuraColor(color_id, this)
150 : NSSystemColorToSkColor([NSColor controlColor]);
146 151
147 // Buttons and labels. 152 // Buttons and labels.
148 case kColorId_ButtonBackgroundColor: 153 case kColorId_ButtonBackgroundColor:
149 case kColorId_ButtonHoverBackgroundColor: 154 case kColorId_ButtonHoverBackgroundColor:
150 case kColorId_HoverMenuButtonBorderColor: 155 case kColorId_HoverMenuButtonBorderColor:
151 case kColorId_LabelBackgroundColor: 156 case kColorId_LabelBackgroundColor:
152 return NSSystemColorToSkColor([NSColor controlBackgroundColor]); 157 return NSSystemColorToSkColor([NSColor controlBackgroundColor]);
153 case kColorId_ButtonEnabledColor: 158 case kColorId_ButtonEnabledColor:
154 case kColorId_EnabledMenuButtonBorderColor: 159 case kColorId_EnabledMenuButtonBorderColor:
155 case kColorId_LabelEnabledColor: 160 case kColorId_LabelEnabledColor:
156 return NSSystemColorToSkColor([NSColor controlTextColor]); 161 return NSSystemColorToSkColor([NSColor controlTextColor]);
157 case kColorId_CallToActionColor: 162 case kColorId_CallToActionColor:
158 return NSSystemColorToSkColor([NSColor controlTextColor]); 163 return ui::MaterialDesignController::IsSecondaryUiMaterial()
164 ? GetAuraColor(color_id, this)
165 : NSSystemColorToSkColor([NSColor controlTextColor]);
159 case kColorId_ButtonDisabledColor: 166 case kColorId_ButtonDisabledColor:
160 case kColorId_LabelDisabledColor: 167 case kColorId_LabelDisabledColor:
161 return NSSystemColorToSkColor([NSColor disabledControlTextColor]); 168 return NSSystemColorToSkColor([NSColor disabledControlTextColor]);
162 case kColorId_ButtonHighlightColor: 169 case kColorId_ButtonHighlightColor:
163 // Although the NSColor documentation names "selectedControlTextColor" as 170 // Although the NSColor documentation names "selectedControlTextColor" as
164 // the color for a "text in a .. control being clicked or dragged", it 171 // the color for a "text in a .. control being clicked or dragged", it
165 // remains black, and text on Yosemite-style pressed buttons is white. 172 // remains black, and text on Yosemite-style pressed buttons is white.
166 return SK_ColorWHITE; 173 return SK_ColorWHITE;
167 case kColorId_ButtonHoverColor: 174 case kColorId_ButtonHoverColor:
168 return NSSystemColorToSkColor([NSColor selectedControlTextColor]); 175 return NSSystemColorToSkColor([NSColor selectedControlTextColor]);
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after
420 canvas->drawDRRect(outer_shape, shape, paint); 427 canvas->drawDRRect(outer_shape, shape, paint);
421 } 428 }
422 429
423 NativeThemeMac::NativeThemeMac() { 430 NativeThemeMac::NativeThemeMac() {
424 } 431 }
425 432
426 NativeThemeMac::~NativeThemeMac() { 433 NativeThemeMac::~NativeThemeMac() {
427 } 434 }
428 435
429 } // namespace ui 436 } // namespace ui
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