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

Unified Diff: ui/views/style/typography_provider.cc

Issue 2910153002: Remove views::Label::SetDisabledColor(). Replace with typography colors. (Closed)
Patch Set: Use STYLE_HINT more. Fix SadTab Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: ui/views/style/typography_provider.cc
diff --git a/ui/views/style/typography_provider.cc b/ui/views/style/typography_provider.cc
index ab46a0a9302cd072ba81234fc1e0eeda4ec4be09..acb35ddad3234c688b69b034849b2c90935952af 100644
--- a/ui/views/style/typography_provider.cc
+++ b/ui/views/style/typography_provider.cc
@@ -7,6 +7,7 @@
#include "base/logging.h"
#include "ui/base/default_style.h"
#include "ui/base/resource/resource_bundle.h"
+#include "ui/native_theme/native_theme.h"
#include "ui/views/style/typography.h"
using gfx::Font;
@@ -47,8 +48,16 @@ const gfx::FontList& DefaultTypographyProvider::GetFont(int context,
size_delta, Font::NORMAL, font_weight);
}
-SkColor DefaultTypographyProvider::GetColor(int context, int style) const {
- return SK_ColorBLACK;
+SkColor DefaultTypographyProvider::GetColor(
+ int context,
+ int style,
+ const ui::NativeTheme& theme) const {
+ switch (style) {
+ case style::STYLE_DISABLED:
+ return theme.GetSystemColor(ui::NativeTheme::kColorId_LabelDisabledColor);
+ }
+
+ return theme.GetSystemColor(ui::NativeTheme::kColorId_LabelEnabledColor);
Peter Kasting 2017/06/01 04:55:58 Nit: Simpler: return theme.GetSystemColor(
tapted 2017/06/01 11:22:18 Done.
}
int DefaultTypographyProvider::GetLineHeight(int context, int style) const {
« ui/views/style/typography_provider.h ('K') | « ui/views/style/typography_provider.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698