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

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

Issue 2964453002: Use style::CONTEXT_TEXTFIELD for Combobox and Textfield (Closed)
Patch Set: Rebase on top of https://codereview.chromium.org/2957263002 Created 3 years, 6 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
« no previous file with comments | « ui/views/controls/textfield/textfield.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/style/typography_provider.cc
diff --git a/ui/views/style/typography_provider.cc b/ui/views/style/typography_provider.cc
index 4c10182482587ce6bec942afdc80a51b9732f711..f8f7f3774c4a2a6393a47022a8ba0f249119fcbe 100644
--- a/ui/views/style/typography_provider.cc
+++ b/ui/views/style/typography_provider.cc
@@ -52,9 +52,9 @@ SkColor DefaultTypographyProvider::GetColor(
int context,
int style,
const ui::NativeTheme& theme) const {
+ ui::NativeTheme::ColorId color_id =
+ ui::NativeTheme::kColorId_LabelEnabledColor;
if (context == style::CONTEXT_BUTTON_MD) {
- ui::NativeTheme::ColorId color_id =
- ui::NativeTheme::kColorId_ButtonEnabledColor;
switch (style) {
case views::style::STYLE_DIALOG_BUTTON_DEFAULT:
color_id = ui::NativeTheme::kColorId_TextOnProminentButtonColor;
@@ -62,14 +62,18 @@ SkColor DefaultTypographyProvider::GetColor(
case views::style::STYLE_DISABLED:
color_id = ui::NativeTheme::kColorId_ButtonDisabledColor;
break;
+ default:
+ color_id = ui::NativeTheme::kColorId_ButtonEnabledColor;
+ break;
}
- return theme.GetSystemColor(color_id);
+ } else if (context == style::CONTEXT_TEXTFIELD) {
+ color_id = style == style::STYLE_DISABLED
+ ? ui::NativeTheme::kColorId_TextfieldReadOnlyColor
+ : ui::NativeTheme::kColorId_TextfieldDefaultColor;
+ } else if (style == style::STYLE_DISABLED) {
+ color_id = ui::NativeTheme::kColorId_LabelDisabledColor;
}
-
- return theme.GetSystemColor(
- (style == style::STYLE_DISABLED)
- ? ui::NativeTheme::kColorId_LabelDisabledColor
- : ui::NativeTheme::kColorId_LabelEnabledColor);
+ return theme.GetSystemColor(color_id);
}
int DefaultTypographyProvider::GetLineHeight(int context, int style) const {
« no previous file with comments | « ui/views/controls/textfield/textfield.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698