Chromium Code Reviews| 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 43e2a670ebaa36f9058564108f5a35c2be77735c..34822ac6f95055738aee5c575cce05883aa0e3cc 100644 |
| --- a/ui/native_theme/native_theme_mac.mm |
| +++ b/ui/native_theme/native_theme_mac.mm |
| @@ -127,7 +127,7 @@ SkColor ColorToGrayscale(SkColor color) { |
| SkColor NativeThemeMac::GetSystemColor(ColorId color_id) const { |
| // Even with --secondary-ui-md, menus use the platform colors and styling, and |
| - // Mac has a couple of specific color overrides. |
| + // Mac has a couple of specific color overrides, documented below. |
| switch (color_id) { |
| case kColorId_EnabledMenuItemForegroundColor: |
| return NSSystemColorToSkColor([NSColor controlTextColor]); |
| @@ -147,8 +147,17 @@ SkColor ColorToGrayscale(SkColor color) { |
| case kColorId_MenuBorderColor: |
| return kMenuBorderColor; |
| + // Mac has a different "pressed button" styling because it doesn't use |
| + // ripples. |
| case kColorId_ButtonPressedShade: |
| return SkColorSetA(SK_ColorBLACK, 0x08); |
| + |
| + // There's a system setting General > Highlight color which sets the |
| + // background color for text selections. We honor that setting. |
| + // TODO(ellyjones): Listen for NSSystemColorsDidChangeNotification somewhere |
| + // and propagate it to the View hierarchy. |
| + case kColorId_TextfieldSelectionBackgroundFocused: |
|
Evan Stade
2016/09/19 16:03:49
Is it not possible to change other textfield color
|
| + return NSSystemColorToSkColor([NSColor selectedTextBackgroundColor]); |
| default: |
| break; |
| } |
| @@ -212,8 +221,6 @@ SkColor ColorToGrayscale(SkColor color) { |
| return NSSystemColorToSkColor([NSColor textBackgroundColor]); |
| case kColorId_TextfieldSelectionColor: |
| return NSSystemColorToSkColor([NSColor selectedTextColor]); |
| - case kColorId_TextfieldSelectionBackgroundFocused: |
| - return NSSystemColorToSkColor([NSColor selectedTextBackgroundColor]); |
| // Trees/Tables. For focused text, use the alternate* versions, which |
| // NSColor documents as "the table and list view equivalent to the |