2020-07-21 19:09:26 +02:00
|
|
|
diff --git chrome/browser/themes/theme_service.cc chrome/browser/themes/theme_service.cc
|
2024-05-23 03:52:35 +02:00
|
|
|
index dd41ca3cb8f35..6123e27acffa8 100644
|
2020-07-21 19:09:26 +02:00
|
|
|
--- chrome/browser/themes/theme_service.cc
|
|
|
|
+++ chrome/browser/themes/theme_service.cc
|
2024-01-26 03:12:43 +01:00
|
|
|
@@ -30,6 +30,7 @@
|
2023-01-03 00:34:43 +01:00
|
|
|
#include "base/task/thread_pool.h"
|
2022-02-21 23:23:40 +01:00
|
|
|
#include "base/trace_event/trace_event.h"
|
2020-07-21 19:09:26 +02:00
|
|
|
#include "build/build_config.h"
|
|
|
|
+#include "cef/libcef/features/runtime.h"
|
|
|
|
#include "chrome/browser/extensions/extension_service.h"
|
|
|
|
#include "chrome/browser/extensions/theme_installed_infobar_delegate.h"
|
2024-05-23 03:52:35 +02:00
|
|
|
#include "chrome/browser/new_tab_page/chrome_colors/chrome_colors_service.h"
|
|
|
|
@@ -68,6 +69,10 @@
|
2023-06-26 12:13:38 +02:00
|
|
|
#include "ui/color/color_provider_manager.h"
|
2022-07-25 19:49:32 +02:00
|
|
|
#include "ui/native_theme/native_theme.h"
|
2020-07-21 19:09:26 +02:00
|
|
|
|
|
|
|
+#if BUILDFLAG(ENABLE_CEF)
|
|
|
|
+#include "cef/libcef/common/extensions/extensions_util.h"
|
|
|
|
+#endif
|
|
|
|
+
|
|
|
|
#if BUILDFLAG(ENABLE_EXTENSIONS)
|
2021-06-04 03:34:56 +02:00
|
|
|
#include "base/scoped_observation.h"
|
2020-07-21 19:09:26 +02:00
|
|
|
#include "extensions/browser/extension_registry_observer.h"
|
2024-05-23 03:52:35 +02:00
|
|
|
@@ -269,11 +274,19 @@ void ThemeService::Init() {
|
2020-07-21 19:09:26 +02:00
|
|
|
// OnExtensionServiceReady. Otherwise, the ThemeObserver won't be
|
|
|
|
// constructed in time to observe the corresponding events.
|
|
|
|
#if BUILDFLAG(ENABLE_EXTENSIONS)
|
2024-04-30 03:09:17 +02:00
|
|
|
+#if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
|
2020-07-21 19:09:26 +02:00
|
|
|
+ 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(
|
2020-12-02 23:31:49 +01:00
|
|
|
FROM_HERE, base::BindOnce(&ThemeService::OnExtensionServiceReady,
|
|
|
|
weak_ptr_factory_.GetWeakPtr()));
|
2020-07-21 19:09:26 +02:00
|
|
|
+ }
|
|
|
|
#endif
|
2021-04-21 00:52:34 +02:00
|
|
|
theme_syncable_service_ =
|
|
|
|
std::make_unique<ThemeSyncableService>(profile_, this);
|
2020-01-06 13:20:26 +01:00
|
|
|
diff --git chrome/browser/themes/theme_service_factory.cc chrome/browser/themes/theme_service_factory.cc
|
2024-05-23 03:52:35 +02:00
|
|
|
index 49fd0b0f7a21c..dc4258f7143d1 100644
|
2020-01-06 13:20:26 +01:00
|
|
|
--- chrome/browser/themes/theme_service_factory.cc
|
|
|
|
+++ chrome/browser/themes/theme_service_factory.cc
|
2023-06-26 12:13:38 +02:00
|
|
|
@@ -9,6 +9,7 @@
|
|
|
|
#include "base/trace_event/trace_event.h"
|
2020-01-06 13:20:26 +01:00
|
|
|
#include "build/build_config.h"
|
2021-01-28 00:13:12 +01:00
|
|
|
#include "build/chromeos_buildflags.h"
|
2020-07-21 19:09:26 +02:00
|
|
|
+#include "cef/libcef/features/runtime.h"
|
2020-01-06 13:20:26 +01:00
|
|
|
#include "chrome/browser/extensions/extension_system_factory.h"
|
|
|
|
#include "chrome/browser/profiles/profile.h"
|
2022-09-26 21:30:45 +02:00
|
|
|
#include "chrome/browser/themes/theme_service.h"
|
2023-08-09 23:17:17 +02:00
|
|
|
@@ -35,6 +36,10 @@
|
2022-09-26 21:30:45 +02:00
|
|
|
#include "ui/linux/linux_ui_factory.h"
|
2020-07-21 19:09:26 +02:00
|
|
|
#endif
|
2020-01-06 13:20:26 +01:00
|
|
|
|
|
|
|
+#if BUILDFLAG(ENABLE_CEF)
|
|
|
|
+#include "cef/libcef/common/extensions/extensions_util.h"
|
|
|
|
+#endif
|
|
|
|
+
|
2020-07-21 19:09:26 +02:00
|
|
|
namespace {
|
|
|
|
|
|
|
|
const ThemeHelper& GetThemeHelper() {
|
2023-08-09 23:17:17 +02:00
|
|
|
@@ -96,7 +101,15 @@ ThemeServiceFactory::ThemeServiceFactory()
|
2023-05-30 10:55:32 +02:00
|
|
|
.Build()) {
|
2020-01-06 13:20:26 +01:00
|
|
|
DependsOn(extensions::ExtensionRegistryFactory::GetInstance());
|
|
|
|
DependsOn(extensions::ExtensionPrefsFactory::GetInstance());
|
2024-04-30 03:09:17 +02:00
|
|
|
+#if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
|
2020-07-21 19:09:26 +02:00
|
|
|
+ const bool extensions_disabled = cef::IsAlloyRuntimeEnabled() &&
|
|
|
|
+ !extensions::ExtensionsEnabled();
|
|
|
|
+#else
|
|
|
|
+ const bool extensions_disabled = false;
|
2020-01-06 13:20:26 +01:00
|
|
|
+#endif
|
2020-07-21 19:09:26 +02:00
|
|
|
+ if (!extensions_disabled) {
|
2020-01-06 13:20:26 +01:00
|
|
|
DependsOn(extensions::ExtensionSystemFactory::GetInstance());
|
|
|
|
+ }
|
|
|
|
}
|
|
|
|
|
2022-07-25 19:49:32 +02:00
|
|
|
ThemeServiceFactory::~ThemeServiceFactory() = default;
|