Update checks on when to add kColorSetNative in ColorMixer for macOS.
This CL makes the native color set visible if either macOS is running on versions higher than 10.14 or if we are in light mode. This fixes the case when secondary windows in Incognito which are running on macOS versions < 10.14 can result in dark text on dark background. Bug: 1253530 Change-Id: I8e3b61a5751ad285d31c8e136c88701b8ed8f0e5 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3233101 Commit-Queue: Rohit Agarwal <roagarwal@chromium.org> Reviewed-by: Elly Fong-Jones <ellyjones@chromium.org> Reviewed-by: Thomas Lukaszewicz <tluk@chromium.org> Cr-Commit-Position: refs/heads/main@{#939993}
This commit is contained in:

committed by
Chromium LUCI CQ

parent
18c24da7e4
commit
31d821e39f
@@ -51,11 +51,7 @@ void AddNativeCoreColorMixer(ColorProvider* provider,
|
||||
}});
|
||||
}
|
||||
|
||||
void AddNativeUiColorMixer(ColorProvider* provider,
|
||||
bool dark_window,
|
||||
bool high_contrast) {
|
||||
ScopedCurrentNSAppearance scoped_nsappearance(dark_window, high_contrast);
|
||||
ColorMixer& mixer = provider->AddMixer();
|
||||
void AddNativeColorSetInColorMixer(ColorMixer& mixer) {
|
||||
mixer.AddSet(
|
||||
{kColorSetNative,
|
||||
{
|
||||
@@ -65,6 +61,21 @@ void AddNativeUiColorMixer(ColorProvider* provider,
|
||||
{kColorMenuItemForeground,
|
||||
skia::NSSystemColorToSkColor([NSColor controlTextColor])},
|
||||
}});
|
||||
}
|
||||
|
||||
void AddNativeUiColorMixer(ColorProvider* provider,
|
||||
bool dark_window,
|
||||
bool high_contrast) {
|
||||
ScopedCurrentNSAppearance scoped_nsappearance(dark_window, high_contrast);
|
||||
ColorMixer& mixer = provider->AddMixer();
|
||||
|
||||
// TODO(crbug.com/1268521): Investigate native color set behaviour for dark
|
||||
// windows on macOS versions running < 10.14.
|
||||
if (@available(macOS 10.14, *)) {
|
||||
AddNativeColorSetInColorMixer(mixer);
|
||||
} else if (!dark_window) {
|
||||
AddNativeColorSetInColorMixer(mixer);
|
||||
}
|
||||
|
||||
if (@available(macOS 10.14, *)) {
|
||||
mixer[kColorTableBackgroundAlternate] = {skia::NSSystemColorToSkColor(
|
||||
|
Reference in New Issue
Block a user