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

Side by Side Diff: ui/native_theme/native_theme_dark_aura.cc

Issue 2254933002: Reuse NativeThemeAuraDark for cros tray. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix Created 4 years, 4 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 | « ash/common/system/tray/tray_utils.cc ('k') | 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 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 kPrimaryTextColor = SK_ColorWHITE;
22 static const SkColor kDisabledTextColor = SkColorSetA(SK_ColorWHITE, 0x61);
23 static const SkColor kDefaultDarkBackground = SkColorSetRGB(0x3C, 0x3C, 0x3E);
24
21 static const SkColor kButtonEnabledColor = SK_ColorWHITE; 25 static const SkColor kButtonEnabledColor = SK_ColorWHITE;
22 static const SkColor kLinkEnabledColor = gfx::kGoogleBlue300;
23 26
24 static const SkColor kTextfieldDefaultColor = SK_ColorWHITE; 27 static const SkColor kTextfieldDefaultColor = SK_ColorWHITE;
25 static const SkColor kTextfieldDefaultBackground = 28 static const SkColor kTextfieldDefaultBackground =
26 SkColorSetRGB(0x62, 0x62, 0x62); 29 SkColorSetRGB(0x62, 0x62, 0x62);
27 static const SkColor kTextfieldSelectionBackgroundFocused = 30 static const SkColor kTextfieldSelectionBackgroundFocused =
28 SkColorSetA(gfx::kGoogleBlue700, 0xCC); 31 SkColorSetA(gfx::kGoogleBlue700, 0xCC);
29 32
30 static const SkColor kResultsTableNormalBackground = 33 static const SkColor kResultsTableNormalBackground =
31 SkColorSetRGB(0x28, 0x28, 0x28); 34 SkColorSetRGB(0x28, 0x28, 0x28);
32 static const SkColor kResultsTableText = SK_ColorWHITE; 35 static const SkColor kResultsTableText = SK_ColorWHITE;
33 static const SkColor kResultsTableDimmedText = 36 static const SkColor kResultsTableDimmedText =
34 SkColorSetA(kResultsTableText, 0x80); 37 SkColorSetA(kResultsTableText, 0x80);
35 38
36 switch (color_id) { 39 switch (color_id) {
37 // Button 40 // Button
38 case kColorId_ButtonEnabledColor: 41 case kColorId_ButtonEnabledColor:
39 return kButtonEnabledColor; 42 return kButtonEnabledColor;
40 case kColorId_CallToActionColor: 43 case kColorId_CallToActionColor:
41 return kLinkEnabledColor; 44 return gfx::kGoogleBlue300;
45
46 // Label
47 case kColorId_LabelEnabledColor:
48 return kPrimaryTextColor;
49 case kColorId_LabelDisabledColor:
50 return kDisabledTextColor;
51 case kColorId_LabelBackgroundColor:
52 return kDefaultDarkBackground;
42 53
43 // Link 54 // Link
44 case kColorId_LinkEnabled: 55 case kColorId_LinkEnabled:
45 case kColorId_LinkPressed: 56 case kColorId_LinkPressed:
46 return kLinkEnabledColor; 57 return gfx::kGoogleBlue300;
47 58
48 // Textfield 59 // Textfield
49 case kColorId_TextfieldDefaultColor: 60 case kColorId_TextfieldDefaultColor:
50 case kColorId_TextfieldSelectionColor: 61 case kColorId_TextfieldSelectionColor:
51 return kTextfieldDefaultColor; 62 return kTextfieldDefaultColor;
52 case kColorId_TextfieldDefaultBackground: 63 case kColorId_TextfieldDefaultBackground:
53 return kTextfieldDefaultBackground; 64 return kTextfieldDefaultBackground;
54 case kColorId_TextfieldSelectionBackgroundFocused: 65 case kColorId_TextfieldSelectionBackgroundFocused:
55 return kTextfieldSelectionBackgroundFocused; 66 return kTextfieldSelectionBackgroundFocused;
56 67
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 case kColorId_DisabledEmphasizedMenuItemForegroundColor: 110 case kColorId_DisabledEmphasizedMenuItemForegroundColor:
100 case kColorId_SelectedMenuItemForegroundColor: 111 case kColorId_SelectedMenuItemForegroundColor:
101 case kColorId_FocusedMenuItemBackgroundColor: 112 case kColorId_FocusedMenuItemBackgroundColor:
102 case kColorId_HoverMenuItemBackgroundColor: 113 case kColorId_HoverMenuItemBackgroundColor:
103 case kColorId_MenuSeparatorColor: 114 case kColorId_MenuSeparatorColor:
104 case kColorId_MenuBackgroundColor: 115 case kColorId_MenuBackgroundColor:
105 case kColorId_MenuBorderColor: 116 case kColorId_MenuBorderColor:
106 case kColorId_EnabledMenuButtonBorderColor: 117 case kColorId_EnabledMenuButtonBorderColor:
107 case kColorId_FocusedMenuButtonBorderColor: 118 case kColorId_FocusedMenuButtonBorderColor:
108 case kColorId_HoverMenuButtonBorderColor: 119 case kColorId_HoverMenuButtonBorderColor:
109 case kColorId_LabelEnabledColor:
110 case kColorId_LabelDisabledColor:
111 case kColorId_LabelBackgroundColor:
112 case kColorId_LinkDisabled: 120 case kColorId_LinkDisabled:
113 case kColorId_TextfieldReadOnlyColor: 121 case kColorId_TextfieldReadOnlyColor:
114 case kColorId_TextfieldReadOnlyBackground: 122 case kColorId_TextfieldReadOnlyBackground:
115 case kColorId_TooltipBackground: 123 case kColorId_TooltipBackground:
116 case kColorId_TooltipText: 124 case kColorId_TooltipText:
117 case kColorId_TreeBackground: 125 case kColorId_TreeBackground:
118 case kColorId_TreeText: 126 case kColorId_TreeText:
119 case kColorId_TreeSelectedText: 127 case kColorId_TreeSelectedText:
120 case kColorId_TreeSelectedTextUnfocused: 128 case kColorId_TreeSelectedTextUnfocused:
121 case kColorId_TreeSelectionBackgroundFocused: 129 case kColorId_TreeSelectionBackgroundFocused:
(...skipping 21 matching lines...) Expand all
143 151
144 NOTREACHED(); 152 NOTREACHED();
145 return gfx::kPlaceholderColor; 153 return gfx::kPlaceholderColor;
146 } 154 }
147 155
148 NativeThemeDarkAura::NativeThemeDarkAura() {} 156 NativeThemeDarkAura::NativeThemeDarkAura() {}
149 157
150 NativeThemeDarkAura::~NativeThemeDarkAura() {} 158 NativeThemeDarkAura::~NativeThemeDarkAura() {}
151 159
152 } // namespace ui 160 } // namespace ui
OLDNEW
« no previous file with comments | « ash/common/system/tray/tray_utils.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698