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

Unified Diff: ui/native_theme/native_theme_win.cc

Issue 2076893002: Theme code cleanup. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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/native_theme/native_theme_dark_aura.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 eb7b82f30d33390534331b82697136375146ed37..dc854900b38903d8ee9d8dc3f53a5e21acac71ef 100644
--- a/ui/native_theme/native_theme_win.cc
+++ b/ui/native_theme/native_theme_win.cc
@@ -465,8 +465,25 @@ void NativeThemeWin::PaintDirect(SkCanvas* canvas,
}
SkColor NativeThemeWin::GetSystemColor(ColorId color_id) const {
+ if (!ui::MaterialDesignController::IsModeMaterial()) {
+ // Link:
+ const SkColor kLinkPressedColor = SkColorSetRGB(200, 0, 0);
+
+ switch (color_id) {
+ // Link
+ case kColorId_LinkDisabled:
+ return system_colors_[COLOR_WINDOWTEXT];
+ case kColorId_LinkEnabled:
+ return system_colors_[COLOR_HOTLIGHT];
+ case kColorId_LinkPressed:
+ return kLinkPressedColor;
+
+ default:
+ break;
+ }
+ }
+
// TODO: Obtain the correct colors using GetSysColor.
- const SkColor kUrlTextColor = SkColorSetRGB(0x0b, 0x80, 0x43);
// Dialogs:
const SkColor kDialogBackgroundColor = SkColorSetRGB(251, 251, 251);
// FocusableBorder:
@@ -480,11 +497,11 @@ SkColor NativeThemeWin::GetSystemColor(ColorId color_id) const {
// MenuItem:
const SkColor kMenuSchemeHighlightBackgroundColorInvert =
SkColorSetRGB(0x30, 0x30, 0x30);
- // Link:
- const SkColor kLinkPressedColor = SkColorSetRGB(200, 0, 0);
// Table:
const SkColor kPositiveTextColor = SkColorSetRGB(0x0b, 0x80, 0x43);
const SkColor kNegativeTextColor = SkColorSetRGB(0xc5, 0x39, 0x29);
+ // Results Tables:
+ const SkColor kResultsTableUrlColor = SkColorSetRGB(0x0b, 0x80, 0x43);
switch (color_id) {
// Windows
@@ -522,20 +539,6 @@ SkColor NativeThemeWin::GetSystemColor(ColorId color_id) const {
case kColorId_LabelBackgroundColor:
return system_colors_[COLOR_WINDOW];
- // Link
- case kColorId_LinkDisabled:
- if (ui::MaterialDesignController::IsModeMaterial())
- break;
- return system_colors_[COLOR_WINDOWTEXT];
- case kColorId_LinkEnabled:
- if (ui::MaterialDesignController::IsModeMaterial())
- break;
- return system_colors_[COLOR_HOTLIGHT];
- case kColorId_LinkPressed:
- if (ui::MaterialDesignController::IsModeMaterial())
- break;
- return kLinkPressedColor;
-
// Textfield
case kColorId_TextfieldDefaultColor:
return system_colors_[COLOR_WINDOWTEXT];
@@ -618,14 +621,14 @@ SkColor NativeThemeWin::GetSystemColor(ColorId color_id) const {
return color_utils::AlphaBlend(system_colors_[COLOR_HIGHLIGHTTEXT],
system_colors_[COLOR_HIGHLIGHT], 0x80);
case kColorId_ResultsTableNormalUrl:
- return color_utils::GetReadableColor(kUrlTextColor,
- system_colors_[COLOR_WINDOW]);
+ return color_utils::GetReadableColor(kResultsTableUrlColor,
+ system_colors_[COLOR_WINDOW]);
case kColorId_ResultsTableHoveredUrl:
return color_utils::GetReadableColor(
- kUrlTextColor,
+ kResultsTableUrlColor,
GetSystemColor(kColorId_ResultsTableHoveredBackground));
case kColorId_ResultsTableSelectedUrl:
- return color_utils::GetReadableColor(kUrlTextColor,
+ return color_utils::GetReadableColor(kResultsTableUrlColor,
system_colors_[COLOR_HIGHLIGHT]);
case kColorId_ResultsTablePositiveText:
return color_utils::GetReadableColor(kPositiveTextColor,
« no previous file with comments | « ui/native_theme/native_theme_dark_aura.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698