| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_dark_aura.h" | 5 #include "ui/native_theme/native_theme_dark_aura.h" |
| 6 | 6 |
| 7 #include "ui/base/material_design/material_design_controller.h" | 7 #include "ui/base/material_design/material_design_controller.h" |
| 8 #include "ui/gfx/color_palette.h" | 8 #include "ui/gfx/color_palette.h" |
| 9 | 9 |
| 10 namespace ui { | 10 namespace ui { |
| 11 | 11 |
| 12 NativeThemeDarkAura* NativeThemeDarkAura::instance() { | 12 NativeThemeDarkAura* NativeThemeDarkAura::instance() { |
| 13 CR_DEFINE_STATIC_LOCAL(NativeThemeDarkAura, s_native_theme, ()); | 13 CR_DEFINE_STATIC_LOCAL(NativeThemeDarkAura, s_native_theme, ()); |
| 14 return &s_native_theme; | 14 return &s_native_theme; |
| 15 } | 15 } |
| 16 | 16 |
| 17 SkColor NativeThemeDarkAura::GetSystemColor(ColorId color_id) const { | 17 SkColor NativeThemeDarkAura::GetSystemColor(ColorId color_id) const { |
| 18 if (!ui::MaterialDesignController::IsModeMaterial()) | 18 if (!ui::MaterialDesignController::IsModeMaterial()) |
| 19 return NativeThemeAura::GetSystemColor(color_id); | 19 return NativeThemeAura::GetSystemColor(color_id); |
| 20 | 20 |
| 21 static const SkColor kButtonEnabledColor = SK_ColorWHITE; |
| 21 static const SkColor kLinkEnabledColor = gfx::kGoogleBlue300; | 22 static const SkColor kLinkEnabledColor = gfx::kGoogleBlue300; |
| 22 | 23 |
| 23 static const SkColor kTextfieldDefaultColor = SK_ColorWHITE; | 24 static const SkColor kTextfieldDefaultColor = SK_ColorWHITE; |
| 24 static const SkColor kTextfieldDefaultBackground = | 25 static const SkColor kTextfieldDefaultBackground = |
| 25 SkColorSetRGB(0x62, 0x62, 0x62); | 26 SkColorSetRGB(0x62, 0x62, 0x62); |
| 26 static const SkColor kTextfieldSelectionBackgroundFocused = | 27 static const SkColor kTextfieldSelectionBackgroundFocused = |
| 27 SkColorSetA(gfx::kGoogleBlue700, 0xCC); | 28 SkColorSetA(gfx::kGoogleBlue700, 0xCC); |
| 28 | 29 |
| 29 static const SkColor kResultsTableNormalBackground = | 30 static const SkColor kResultsTableNormalBackground = |
| 30 SkColorSetRGB(0x28, 0x28, 0x28); | 31 SkColorSetRGB(0x28, 0x28, 0x28); |
| 31 static const SkColor kResultsTableText = SK_ColorWHITE; | 32 static const SkColor kResultsTableText = SK_ColorWHITE; |
| 32 static const SkColor kResultsTableDimmedText = | 33 static const SkColor kResultsTableDimmedText = |
| 33 SkColorSetA(kResultsTableText, 0x80); | 34 SkColorSetA(kResultsTableText, 0x80); |
| 34 | 35 |
| 35 switch (color_id) { | 36 switch (color_id) { |
| 36 // Button | 37 // Button |
| 38 case kColorId_ButtonEnabledColor: |
| 39 return kButtonEnabledColor; |
| 37 case kColorId_CallToActionColor: | 40 case kColorId_CallToActionColor: |
| 38 return kLinkEnabledColor; | 41 return kLinkEnabledColor; |
| 39 | 42 |
| 40 // Link | 43 // Link |
| 41 case kColorId_LinkEnabled: | 44 case kColorId_LinkEnabled: |
| 42 case kColorId_LinkPressed: | 45 case kColorId_LinkPressed: |
| 43 return kLinkEnabledColor; | 46 return kLinkEnabledColor; |
| 44 | 47 |
| 45 // Textfield | 48 // Textfield |
| 46 case kColorId_TextfieldDefaultColor: | 49 case kColorId_TextfieldDefaultColor: |
| (...skipping 14 matching lines...) Expand all Loading... |
| 61 case kColorId_ResultsTableNormalDimmedText: | 64 case kColorId_ResultsTableNormalDimmedText: |
| 62 case kColorId_ResultsTableHoveredDimmedText: | 65 case kColorId_ResultsTableHoveredDimmedText: |
| 63 case kColorId_ResultsTableSelectedDimmedText: | 66 case kColorId_ResultsTableSelectedDimmedText: |
| 64 return kResultsTableDimmedText; | 67 return kResultsTableDimmedText; |
| 65 | 68 |
| 66 // FocusableBorder | 69 // FocusableBorder |
| 67 case kColorId_FocusedBorderColor: | 70 case kColorId_FocusedBorderColor: |
| 68 return gfx::kGoogleBlue300; | 71 return gfx::kGoogleBlue300; |
| 69 | 72 |
| 70 // Intentional pass-throughs to NativeThemeAura. | 73 // Intentional pass-throughs to NativeThemeAura. |
| 71 case kColorId_ButtonEnabledColor: | |
| 72 case kColorId_TextOnCallToActionColor: | 74 case kColorId_TextOnCallToActionColor: |
| 73 case kColorId_ResultsTableHoveredBackground: | 75 case kColorId_ResultsTableHoveredBackground: |
| 74 case kColorId_ResultsTableSelectedBackground: | 76 case kColorId_ResultsTableSelectedBackground: |
| 75 case kColorId_ResultsTableNormalUrl: | 77 case kColorId_ResultsTableNormalUrl: |
| 76 case kColorId_ResultsTableHoveredUrl: | 78 case kColorId_ResultsTableHoveredUrl: |
| 77 case kColorId_ResultsTableSelectedUrl: | 79 case kColorId_ResultsTableSelectedUrl: |
| 78 return NativeThemeAura::GetSystemColor(color_id); | 80 return NativeThemeAura::GetSystemColor(color_id); |
| 79 | 81 |
| 80 // Any other color is not defined and shouldn't be used in a dark theme. | 82 // Any other color is not defined and shouldn't be used in a dark theme. |
| 81 case kColorId_WindowBackground: | 83 case kColorId_WindowBackground: |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 | 143 |
| 142 NOTREACHED(); | 144 NOTREACHED(); |
| 143 return gfx::kPlaceholderColor; | 145 return gfx::kPlaceholderColor; |
| 144 } | 146 } |
| 145 | 147 |
| 146 NativeThemeDarkAura::NativeThemeDarkAura() {} | 148 NativeThemeDarkAura::NativeThemeDarkAura() {} |
| 147 | 149 |
| 148 NativeThemeDarkAura::~NativeThemeDarkAura() {} | 150 NativeThemeDarkAura::~NativeThemeDarkAura() {} |
| 149 | 151 |
| 150 } // namespace ui | 152 } // namespace ui |
| OLD | NEW |