diff --git a/shell/browser/atom_browser_client.cc b/shell/browser/atom_browser_client.cc index 11dea7624dfa..bf0f60491da8 100644 --- a/shell/browser/atom_browser_client.cc +++ b/shell/browser/atom_browser_client.cc @@ -79,6 +79,7 @@ #include "shell/common/platform_util.h" #include "ui/base/l10n/l10n_util.h" #include "ui/base/resource/resource_bundle.h" +#include "ui/native_theme/native_theme.h" #include "v8/include/v8.h" #if defined(OS_WIN) @@ -408,6 +409,11 @@ void AtomBrowserClient::OverrideWebkitPrefs(content::RenderViewHost* host, prefs->default_maximum_page_scale_factor = 1.f; prefs->navigate_on_drag_drop = false; + ui::NativeTheme* native_theme = ui::NativeTheme::GetInstanceForNativeUi(); + prefs->preferred_color_scheme = native_theme->SystemDarkModeEnabled() + ? blink::PreferredColorScheme::kDark + : blink::PreferredColorScheme::kLight; + SetFontDefaults(prefs); // Custom preferences of guest page.