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

Unified Diff: ui/native_theme/native_theme_mac.mm

Issue 2303723003: macviews: always use Aura colors when --secondary-ui-md (Closed)
Patch Set: inline GetAuraColorWithSystemTint 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/native_theme/native_theme_mac.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/native_theme/native_theme_mac.mm
diff --git a/ui/native_theme/native_theme_mac.mm b/ui/native_theme/native_theme_mac.mm
index 1960780c25bb56abfa549dca114d35fdceec52aa..87bf24e608e144276b010d5ab5699b8efc2b6a21 100644
--- a/ui/native_theme/native_theme_mac.mm
+++ b/ui/native_theme/native_theme_mac.mm
@@ -126,28 +126,25 @@ SkColor ColorToGrayscale(SkColor color) {
}
SkColor NativeThemeMac::GetSystemColor(ColorId color_id) const {
+ if (ui::MaterialDesignController::IsSecondaryUiMaterial())
+ return ApplySystemControlTint(GetAuraColor(color_id, this));
+
// TODO(tapted): Add caching for these, and listen for
// NSSystemColorsDidChangeNotification.
switch (color_id) {
case kColorId_WindowBackground:
return NSSystemColorToSkColor([NSColor windowBackgroundColor]);
case kColorId_DialogBackground:
- return ui::MaterialDesignController::IsSecondaryUiMaterial()
- ? GetAuraColorWithSystemTint(color_id, this)
- : kDialogBackgroundColor;
+ return kDialogBackgroundColor;
case kColorId_BubbleBackground:
return SK_ColorWHITE;
case kColorId_FocusedBorderColor:
- return ui::MaterialDesignController::IsSecondaryUiMaterial()
- ? GetAuraColorWithSystemTint(color_id, this)
- : NSSystemColorToSkColor([NSColor keyboardFocusIndicatorColor]);
+ return NSSystemColorToSkColor([NSColor keyboardFocusIndicatorColor]);
case kColorId_FocusedMenuButtonBorderColor:
return NSSystemColorToSkColor([NSColor keyboardFocusIndicatorColor]);
case kColorId_UnfocusedBorderColor:
- return ui::MaterialDesignController::IsSecondaryUiMaterial()
- ? GetAuraColorWithSystemTint(color_id, this)
- : NSSystemColorToSkColor([NSColor controlColor]);
+ return NSSystemColorToSkColor([NSColor controlColor]);
// Buttons and labels.
case kColorId_ButtonBackgroundColor:
@@ -158,11 +155,8 @@ SkColor ColorToGrayscale(SkColor color) {
case kColorId_ButtonEnabledColor:
case kColorId_EnabledMenuButtonBorderColor:
case kColorId_LabelEnabledColor:
- return NSSystemColorToSkColor([NSColor controlTextColor]);
case kColorId_CallToActionColor:
- return ui::MaterialDesignController::IsSecondaryUiMaterial()
- ? GetAuraColorWithSystemTint(color_id, this)
- : NSSystemColorToSkColor([NSColor controlTextColor]);
+ return NSSystemColorToSkColor([NSColor controlTextColor]);
case kColorId_ButtonDisabledColor:
case kColorId_LabelDisabledColor:
return NSSystemColorToSkColor([NSColor disabledControlTextColor]);
@@ -427,12 +421,6 @@ SkColor ColorToGrayscale(SkColor color) {
canvas->drawDRRect(outer_shape, shape, paint);
}
-SkColor NativeThemeMac::GetAuraColorWithSystemTint(
- NativeTheme::ColorId color_id,
- const NativeTheme* base_theme) const {
- return ApplySystemControlTint(GetAuraColor(color_id, base_theme));
-}
-
NativeThemeMac::NativeThemeMac() {
}
« no previous file with comments | « ui/native_theme/native_theme_mac.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698