Skip to content

Commit d585879

Browse files
committed
1 parent 1e86b6d commit d585879

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

shell/browser/electron_browser_client.cc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,8 @@ void ElectronBrowserClient::OverrideWebPreferences(
427427
renderer_prefs->can_accept_load_drops = false;
428428

429429
ui::NativeTheme* native_theme = ui::NativeTheme::GetInstanceForNativeUi();
430-
prefs->in_forced_colors = native_theme->forced_colors();
430+
prefs->in_forced_colors = native_theme->forced_colors() !=
431+
ui::ColorProviderKey::ForcedColors::kNone;
431432
prefs->preferred_color_scheme =
432433
native_theme->preferred_color_scheme() ==
433434
ui::NativeTheme::PreferredColorScheme::kDark
@@ -447,7 +448,8 @@ bool ElectronBrowserClient::WebPreferencesNeedUpdateForColorRelatedStateChanges(
447448
const content::SiteInstance& main_frame_site) const {
448449
const auto& prefs = web_contents.GetOrCreateWebPreferences();
449450
ui::NativeTheme* native_theme = ui::NativeTheme::GetInstanceForNativeUi();
450-
bool in_forced_colors = native_theme->forced_colors();
451+
bool in_forced_colors = native_theme->forced_colors() !=
452+
ui::ColorProviderKey::ForcedColors::kNone;
451453
blink::mojom::PreferredColorScheme preferred_color_scheme =
452454
native_theme->preferred_color_scheme() ==
453455
ui::NativeTheme::PreferredColorScheme::kDark

0 commit comments

Comments
 (0)