From 42f351a40d8fe179683a674c0f9b17353dc2caf4 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 876c203cb..ea51ed452 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 =