2020-07-21 19:09:26 +02:00
|
|
|
diff --git chrome/browser/themes/theme_service.cc chrome/browser/themes/theme_service.cc
|
2020-12-02 23:31:49 +01:00
|
|
|
index 08cafea4eb1c..e21eff668695 100644
|
2020-07-21 19:09:26 +02:00
|
|
|
--- chrome/browser/themes/theme_service.cc
|
|
|
|
+++ chrome/browser/themes/theme_service.cc
|
2020-08-29 00:39:23 +02:00
|
|
|
@@ -26,6 +26,7 @@
|
2020-07-21 19:09:26 +02:00
|
|
|
#include "base/task/thread_pool.h"
|
|
|
|
#include "base/threading/thread_task_runner_handle.h"
|
|
|
|
#include "build/build_config.h"
|
|
|
|
+#include "cef/libcef/features/runtime.h"
|
|
|
|
#include "chrome/browser/chrome_notification_types.h"
|
|
|
|
#include "chrome/browser/extensions/extension_service.h"
|
|
|
|
#include "chrome/browser/extensions/theme_installed_infobar_delegate.h"
|
2020-08-29 00:39:23 +02:00
|
|
|
@@ -55,6 +56,10 @@
|
2020-07-21 19:09:26 +02:00
|
|
|
#include "extensions/common/extension_set.h"
|
|
|
|
#include "ui/base/layout.h"
|
|
|
|
|
|
|
|
+#if BUILDFLAG(ENABLE_CEF)
|
|
|
|
+#include "cef/libcef/common/extensions/extensions_util.h"
|
|
|
|
+#endif
|
|
|
|
+
|
|
|
|
#if BUILDFLAG(ENABLE_EXTENSIONS)
|
|
|
|
#include "base/scoped_observer.h"
|
|
|
|
#include "extensions/browser/extension_registry_observer.h"
|
2020-10-08 21:54:42 +02:00
|
|
|
@@ -275,11 +280,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)
|
|
|
|
+#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(
|
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
|
|
|
|
theme_syncable_service_.reset(new 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
|
2021-01-28 00:13:12 +01:00
|
|
|
index 4f82e3d34746..b485befab711 100644
|
2020-01-06 13:20:26 +01:00
|
|
|
--- chrome/browser/themes/theme_service_factory.cc
|
|
|
|
+++ chrome/browser/themes/theme_service_factory.cc
|
2021-01-28 00:13:12 +01:00
|
|
|
@@ -7,6 +7,7 @@
|
2020-03-04 01:29:39 +01:00
|
|
|
#include "base/no_destructor.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/incognito_helpers.h"
|
|
|
|
#include "chrome/browser/profiles/profile.h"
|
2021-01-28 00:13:12 +01:00
|
|
|
@@ -30,6 +31,10 @@
|
2020-07-21 19:09:26 +02:00
|
|
|
#include "ui/views/linux_ui/linux_ui.h"
|
|
|
|
#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() {
|
2021-01-28 00:13:12 +01:00
|
|
|
@@ -73,7 +78,15 @@ ThemeServiceFactory::ThemeServiceFactory()
|
2020-01-06 13:20:26 +01:00
|
|
|
BrowserContextDependencyManager::GetInstance()) {
|
|
|
|
DependsOn(extensions::ExtensionRegistryFactory::GetInstance());
|
|
|
|
DependsOn(extensions::ExtensionPrefsFactory::GetInstance());
|
|
|
|
+#if BUILDFLAG(ENABLE_CEF)
|
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());
|
|
|
|
+ }
|
|
|
|
}
|
|
|
|
|
|
|
|
ThemeServiceFactory::~ThemeServiceFactory() {}
|