Commit f28c4bdc authored by Alison Maher's avatar Alison Maher Committed by Chromium LUCI CQ

Remove Windows dependency in NativeThemeBase::GetControlColor()

With CL:2587618, we no longer need to check for a Windows dependency
in NativeThemeBase::GetControlColor(). Instead, we can call
InForcedColorsMode(), which in practice is only ever true on
Windows.

There is work underway to add a devtools emulation feature for Windows
high contrast to allow developers to test their webpages in forced
colors mode without a Windows device. This change will likely allow
for controls to be rendered correctly in this case.

This CL should not result in any functional changes.

Bug: 1107431
Change-Id: I268e73ea574dd55c535ae3bb031c1d06b84d1d48
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2590589
Commit-Queue: Alison Maher <almaher@microsoft.com>
Reviewed-by: default avatarPeter Kasting <pkasting@chromium.org>
Reviewed-by: default avatarIonel Popescu <iopopesc@microsoft.com>
Cr-Commit-Position: refs/heads/master@{#840200}
parent cbea2125
...@@ -1607,10 +1607,8 @@ SkColor NativeThemeBase::ControlsBackgroundColorForState( ...@@ -1607,10 +1607,8 @@ SkColor NativeThemeBase::ControlsBackgroundColorForState(
SkColor NativeThemeBase::GetControlColor(ControlColorId color_id, SkColor NativeThemeBase::GetControlColor(ControlColorId color_id,
ColorScheme color_scheme) const { ColorScheme color_scheme) const {
#if defined(OS_WIN) if (InForcedColorsMode() && features::IsForcedColorsEnabled())
if (UserHasContrastPreference() && features::IsForcedColorsEnabled())
return GetHighContrastControlColor(color_id, color_scheme); return GetHighContrastControlColor(color_id, color_scheme);
#endif
if(color_scheme == ColorScheme::kDark) if(color_scheme == ColorScheme::kDark)
return GetDarkModeControlColor(color_id); return GetDarkModeControlColor(color_id);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment