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

Unified Diff: ui/native_theme/native_theme_win.cc

Issue 2345183002: Views: Draw Textfield selected text in gray when top-level Widget loses focus.
Patch Set: Fix rebase. Created 4 years, 2 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/native_theme/native_theme_win.cc
diff --git a/ui/native_theme/native_theme_win.cc b/ui/native_theme/native_theme_win.cc
index 674352c4a22f553e26c974d337371fb0efd907dc..3c87f4db1c69679ad337a3d8d436946d7bc0dc42 100644
--- a/ui/native_theme/native_theme_win.cc
+++ b/ui/native_theme/native_theme_win.cc
@@ -563,6 +563,8 @@ SkColor NativeThemeWin::GetSystemColor(ColorId color_id) const {
return system_colors_[COLOR_HIGHLIGHTTEXT];
case kColorId_TextfieldSelectionBackgroundFocused:
return system_colors_[COLOR_HIGHLIGHT];
+ case kColorId_TextfieldSelectionBackgroundUnfocused:
+ return GetUnfocusedSelectionBackgroundColor();
// Tooltip
case kColorId_TooltipBackground:
@@ -583,8 +585,7 @@ SkColor NativeThemeWin::GetSystemColor(ColorId color_id) const {
case kColorId_TreeSelectionBackgroundFocused:
return system_colors_[COLOR_HIGHLIGHT];
case kColorId_TreeSelectionBackgroundUnfocused:
- return system_colors_[IsUsingHighContrastTheme() ?
- COLOR_MENUHIGHLIGHT : COLOR_BTNFACE];
+ return GetUnfocusedSelectionBackgroundColor();
case kColorId_TreeArrow:
return system_colors_[COLOR_WINDOWTEXT];
@@ -600,8 +601,7 @@ SkColor NativeThemeWin::GetSystemColor(ColorId color_id) const {
case kColorId_TableSelectionBackgroundFocused:
return system_colors_[COLOR_HIGHLIGHT];
case kColorId_TableSelectionBackgroundUnfocused:
- return system_colors_[IsUsingHighContrastTheme() ?
- COLOR_MENUHIGHLIGHT : COLOR_BTNFACE];
+ return GetUnfocusedSelectionBackgroundColor();
case kColorId_TableGroupingIndicatorColor:
return system_colors_[COLOR_GRAYTEXT];
@@ -2001,6 +2001,11 @@ int NativeThemeWin::GetWindowsState(Part part,
return 0;
}
+SkColor NativeThemeWin::GetUnfocusedSelectionBackgroundColor() const {
+ return system_colors_[IsUsingHighContrastTheme() ? COLOR_MENUHIGHLIGHT
+ : COLOR_BTNFACE];
+}
+
HRESULT NativeThemeWin::GetThemeInt(ThemeName theme,
int part_id,
int state_id,

Powered by Google App Engine
This is Rietveld 408576698