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

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

Issue 1438513003: [MD] Implement incognito colors as a NativeTheme (for Aura). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: use ViewsDelegate Created 5 years, 1 month 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
OLDNEW
(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_aura_dark.h"
6
7 #include "ui/base/resource/material_design/material_design_controller.h"
8
9 namespace ui {
10
11 NativeThemeAuraDark* NativeThemeAuraDark::instance() {
12 CR_DEFINE_STATIC_LOCAL(NativeThemeAuraDark, s_native_theme, ());
13 return &s_native_theme;
14 }
15
16 NativeThemeAuraDark::NativeThemeAuraDark() {}
17
18 NativeThemeAuraDark::~NativeThemeAuraDark() {}
19
20 SkColor NativeThemeAuraDark::GetSystemColor(ColorId color_id) const {
21 if (!ui::MaterialDesignController::IsModeMaterial())
22 return NativeThemeAura::GetSystemColor(color_id);
23
24 static const SkColor kLinkEnabledColor = SkColorSetRGB(0x7B, 0xAA, 0xF7);
25
26 static const SkColor kTextfieldDefaultColor = SK_ColorWHITE;
27 static const SkColor kTextfieldDefaultBackground =
28 SkColorSetRGB(0x62, 0x62, 0x62);
29
30 static const SkColor kResultsTableNormalBackground =
31 SkColorSetRGB(0x28, 0x28, 0x28);
32 static const SkColor kResultsTableText = SK_ColorWHITE;
33 static const SkColor kResultsTableDimmedText =
34 SkColorSetA(kResultsTableText, 0x80);
35
36 switch (color_id) {
37 // Link
38 case kColorId_LinkEnabled:
39 return kLinkEnabledColor;
40
41 // Textfield
42 case kColorId_TextfieldDefaultColor:
43 return kTextfieldDefaultColor;
44 case kColorId_TextfieldDefaultBackground:
45 return kTextfieldDefaultBackground;
46
47 // Results Tables
48 case kColorId_ResultsTableNormalBackground:
49 return kResultsTableNormalBackground;
50 case kColorId_ResultsTableNormalText:
51 case kColorId_ResultsTableHoveredText:
52 case kColorId_ResultsTableSelectedText:
53 case kColorId_ResultsTableNormalHeadline:
54 case kColorId_ResultsTableHoveredHeadline:
55 case kColorId_ResultsTableSelectedHeadline:
56 return kResultsTableText;
57 case kColorId_ResultsTableNormalDimmedText:
58 case kColorId_ResultsTableHoveredDimmedText:
59 case kColorId_ResultsTableSelectedDimmedText:
60 return kResultsTableDimmedText;
61
62 default:
63 break;
64 }
65
66 return NativeThemeAura::GetSystemColor(color_id);
67 }
68
69 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698