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

Unified Diff: ui/native_theme/native_theme_dark_aura.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: init param, pkasting feedback 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/native_theme/native_theme_dark_aura.h ('k') | ui/native_theme/native_theme_dark_win.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/native_theme/native_theme_dark_aura.cc
diff --git a/ui/native_theme/native_theme_dark_aura.cc b/ui/native_theme/native_theme_dark_aura.cc
new file mode 100644
index 0000000000000000000000000000000000000000..f33e67e0206ad4f7a830efd1e686560c72237a52
--- /dev/null
+++ b/ui/native_theme/native_theme_dark_aura.cc
@@ -0,0 +1,69 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ui/native_theme/native_theme_dark_aura.h"
+
+#include "ui/base/resource/material_design/material_design_controller.h"
+
+namespace ui {
+
+NativeThemeDarkAura* NativeThemeDarkAura::instance() {
+ CR_DEFINE_STATIC_LOCAL(NativeThemeDarkAura, s_native_theme, ());
+ return &s_native_theme;
+}
+
+SkColor NativeThemeDarkAura::GetSystemColor(ColorId color_id) const {
+ if (!ui::MaterialDesignController::IsModeMaterial())
+ return NativeThemeAura::GetSystemColor(color_id);
+
+ static const SkColor kLinkEnabledColor = SkColorSetRGB(0x7B, 0xAA, 0xF7);
+
+ static const SkColor kTextfieldDefaultColor = SK_ColorWHITE;
+ static const SkColor kTextfieldDefaultBackground =
+ SkColorSetRGB(0x62, 0x62, 0x62);
+
+ static const SkColor kResultsTableNormalBackground =
+ SkColorSetRGB(0x28, 0x28, 0x28);
+ static const SkColor kResultsTableText = SK_ColorWHITE;
+ static const SkColor kResultsTableDimmedText =
+ SkColorSetA(kResultsTableText, 0x80);
+
+ switch (color_id) {
+ // Link
+ case kColorId_LinkEnabled:
+ return kLinkEnabledColor;
+
+ // Textfield
+ case kColorId_TextfieldDefaultColor:
+ return kTextfieldDefaultColor;
+ case kColorId_TextfieldDefaultBackground:
+ return kTextfieldDefaultBackground;
+
+ // Results Tables
+ case kColorId_ResultsTableNormalBackground:
+ return kResultsTableNormalBackground;
+ case kColorId_ResultsTableNormalText:
+ case kColorId_ResultsTableHoveredText:
+ case kColorId_ResultsTableSelectedText:
+ case kColorId_ResultsTableNormalHeadline:
+ case kColorId_ResultsTableHoveredHeadline:
+ case kColorId_ResultsTableSelectedHeadline:
+ return kResultsTableText;
+ case kColorId_ResultsTableNormalDimmedText:
+ case kColorId_ResultsTableHoveredDimmedText:
+ case kColorId_ResultsTableSelectedDimmedText:
+ return kResultsTableDimmedText;
+
+ default:
+ break;
+ }
+
+ return NativeThemeAura::GetSystemColor(color_id);
+}
+
+NativeThemeDarkAura::NativeThemeDarkAura() {}
+
+NativeThemeDarkAura::~NativeThemeDarkAura() {}
+
+} // namespace ui
« no previous file with comments | « ui/native_theme/native_theme_dark_aura.h ('k') | ui/native_theme/native_theme_dark_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698