OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "ui/native_theme/native_theme_dark_aura.h" |
| 6 |
| 7 #include "ui/base/resource/material_design/material_design_controller.h" |
| 8 |
| 9 namespace ui { |
| 10 |
| 11 NativeThemeDarkAura* NativeThemeDarkAura::instance() { |
| 12 CR_DEFINE_STATIC_LOCAL(NativeThemeDarkAura, s_native_theme, ()); |
| 13 return &s_native_theme; |
| 14 } |
| 15 |
| 16 SkColor NativeThemeDarkAura::GetSystemColor(ColorId color_id) const { |
| 17 if (!ui::MaterialDesignController::IsModeMaterial()) |
| 18 return NativeThemeAura::GetSystemColor(color_id); |
| 19 |
| 20 static const SkColor kLinkEnabledColor = SkColorSetRGB(0x7B, 0xAA, 0xF7); |
| 21 |
| 22 static const SkColor kTextfieldDefaultColor = SK_ColorWHITE; |
| 23 static const SkColor kTextfieldDefaultBackground = |
| 24 SkColorSetRGB(0x62, 0x62, 0x62); |
| 25 |
| 26 static const SkColor kResultsTableNormalBackground = |
| 27 SkColorSetRGB(0x28, 0x28, 0x28); |
| 28 static const SkColor kResultsTableText = SK_ColorWHITE; |
| 29 static const SkColor kResultsTableDimmedText = |
| 30 SkColorSetA(kResultsTableText, 0x80); |
| 31 |
| 32 switch (color_id) { |
| 33 // Link |
| 34 case kColorId_LinkEnabled: |
| 35 return kLinkEnabledColor; |
| 36 |
| 37 // Textfield |
| 38 case kColorId_TextfieldDefaultColor: |
| 39 return kTextfieldDefaultColor; |
| 40 case kColorId_TextfieldDefaultBackground: |
| 41 return kTextfieldDefaultBackground; |
| 42 |
| 43 // Results Tables |
| 44 case kColorId_ResultsTableNormalBackground: |
| 45 return kResultsTableNormalBackground; |
| 46 case kColorId_ResultsTableNormalText: |
| 47 case kColorId_ResultsTableHoveredText: |
| 48 case kColorId_ResultsTableSelectedText: |
| 49 case kColorId_ResultsTableNormalHeadline: |
| 50 case kColorId_ResultsTableHoveredHeadline: |
| 51 case kColorId_ResultsTableSelectedHeadline: |
| 52 return kResultsTableText; |
| 53 case kColorId_ResultsTableNormalDimmedText: |
| 54 case kColorId_ResultsTableHoveredDimmedText: |
| 55 case kColorId_ResultsTableSelectedDimmedText: |
| 56 return kResultsTableDimmedText; |
| 57 |
| 58 default: |
| 59 break; |
| 60 } |
| 61 |
| 62 return NativeThemeAura::GetSystemColor(color_id); |
| 63 } |
| 64 |
| 65 NativeThemeDarkAura::NativeThemeDarkAura() {} |
| 66 |
| 67 NativeThemeDarkAura::~NativeThemeDarkAura() {} |
| 68 |
| 69 } // namespace ui |
OLD | NEW |