mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2024-12-12 01:26:03 +01:00
695ee2a041
- Mac: 13.3 SDK (Xcode 14.3) is now required
83 lines
3.1 KiB
Diff
83 lines
3.1 KiB
Diff
diff --git chrome/browser/themes/theme_service.cc chrome/browser/themes/theme_service.cc
|
|
index 67dc4a2e0695e..16f819e133886 100644
|
|
--- chrome/browser/themes/theme_service.cc
|
|
+++ chrome/browser/themes/theme_service.cc
|
|
@@ -30,6 +30,7 @@
|
|
#include "base/task/thread_pool.h"
|
|
#include "base/trace_event/trace_event.h"
|
|
#include "build/build_config.h"
|
|
+#include "cef/libcef/features/runtime.h"
|
|
#include "chrome/browser/browser_features.h"
|
|
#include "chrome/browser/extensions/extension_service.h"
|
|
#include "chrome/browser/extensions/theme_installed_infobar_delegate.h"
|
|
@@ -68,6 +69,10 @@
|
|
#include "ui/color/color_provider.h"
|
|
#include "ui/native_theme/native_theme.h"
|
|
|
|
+#if BUILDFLAG(ENABLE_CEF)
|
|
+#include "cef/libcef/common/extensions/extensions_util.h"
|
|
+#endif
|
|
+
|
|
#if BUILDFLAG(ENABLE_EXTENSIONS)
|
|
#include "base/scoped_observation.h"
|
|
#include "extensions/browser/extension_registry_observer.h"
|
|
@@ -270,11 +275,19 @@ void ThemeService::Init() {
|
|
// OnExtensionServiceReady. Otherwise, the ThemeObserver won't be
|
|
// constructed in time to observe the corresponding events.
|
|
#if BUILDFLAG(ENABLE_EXTENSIONS)
|
|
+#if BUILDFLAG(ENABLE_CEF)
|
|
+ const bool extensions_disabled = cef::IsAlloyRuntimeEnabled() &&
|
|
+ !extensions::ExtensionsEnabled();
|
|
+#else
|
|
+ const bool extensions_disabled = false;
|
|
+#endif
|
|
+ if (!extensions_disabled) {
|
|
theme_observer_ = std::make_unique<ThemeObserver>(this);
|
|
|
|
extensions::ExtensionSystem::Get(profile_)->ready().Post(
|
|
FROM_HERE, base::BindOnce(&ThemeService::OnExtensionServiceReady,
|
|
weak_ptr_factory_.GetWeakPtr()));
|
|
+ }
|
|
#endif
|
|
theme_syncable_service_ =
|
|
std::make_unique<ThemeSyncableService>(profile_, this);
|
|
diff --git chrome/browser/themes/theme_service_factory.cc chrome/browser/themes/theme_service_factory.cc
|
|
index c8382bbee253b..a48c7b52252db 100644
|
|
--- chrome/browser/themes/theme_service_factory.cc
|
|
+++ chrome/browser/themes/theme_service_factory.cc
|
|
@@ -7,6 +7,7 @@
|
|
#include "base/no_destructor.h"
|
|
#include "build/build_config.h"
|
|
#include "build/chromeos_buildflags.h"
|
|
+#include "cef/libcef/features/runtime.h"
|
|
#include "chrome/browser/extensions/extension_system_factory.h"
|
|
#include "chrome/browser/profiles/profile.h"
|
|
#include "chrome/browser/themes/theme_service.h"
|
|
@@ -31,6 +32,10 @@
|
|
#include "ui/linux/linux_ui_factory.h"
|
|
#endif
|
|
|
|
+#if BUILDFLAG(ENABLE_CEF)
|
|
+#include "cef/libcef/common/extensions/extensions_util.h"
|
|
+#endif
|
|
+
|
|
namespace {
|
|
|
|
const ThemeHelper& GetThemeHelper() {
|
|
@@ -79,7 +84,15 @@ ThemeServiceFactory::ThemeServiceFactory()
|
|
.Build()) {
|
|
DependsOn(extensions::ExtensionRegistryFactory::GetInstance());
|
|
DependsOn(extensions::ExtensionPrefsFactory::GetInstance());
|
|
+#if BUILDFLAG(ENABLE_CEF)
|
|
+ const bool extensions_disabled = cef::IsAlloyRuntimeEnabled() &&
|
|
+ !extensions::ExtensionsEnabled();
|
|
+#else
|
|
+ const bool extensions_disabled = false;
|
|
+#endif
|
|
+ if (!extensions_disabled) {
|
|
DependsOn(extensions::ExtensionSystemFactory::GetInstance());
|
|
+ }
|
|
}
|
|
|
|
ThemeServiceFactory::~ThemeServiceFactory() = default;
|