From fde72b57a87090e71e05a2b00d17aa9bf9182258 Mon Sep 17 00:00:00 2001 From: Marshall Greenblatt Date: Wed, 22 Feb 2023 17:10:25 -0500 Subject: [PATCH] alloy: Fix theme configuration on startup (fixes issue #3449) --- libcef/browser/alloy/alloy_browser_main.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libcef/browser/alloy/alloy_browser_main.cc b/libcef/browser/alloy/alloy_browser_main.cc index 0d4a3c86c..446e18d31 100644 --- a/libcef/browser/alloy/alloy_browser_main.cc +++ b/libcef/browser/alloy/alloy_browser_main.cc @@ -41,6 +41,7 @@ #include "net/base/net_module.h" #include "third_party/widevine/cdm/buildflags.h" #include "ui/base/resource/resource_bundle.h" +#include "ui/native_theme/native_theme.h" #if BUILDFLAG(IS_LINUX) #include "ui/ozone/buildflags.h" @@ -308,6 +309,9 @@ int AlloyBrowserMainParts::PreMainMessageLoopRun() { file_dialog_runner::RegisterFactory(); permission_prompt::RegisterCreateCallback(); + // Initialize theme configuration (high contrast, dark mode, etc). + ui::NativeTheme::GetInstanceForNativeUi(); + #if BUILDFLAG(ENABLE_MEDIA_FOUNDATION_WIDEVINE_CDM) || \ BUILDFLAG(ENABLE_WIDEVINE_CDM_COMPONENT) const base::CommandLine* command_line =