Fix crash when running with --disable-extensions (fixes issue #2852)

This commit is contained in:
Marshall Greenblatt 2020-01-06 14:20:26 +02:00
parent 875b202cbb
commit 440dbfb6df
2 changed files with 42 additions and 0 deletions

View File

@ -202,6 +202,11 @@ patches = [
# https://bitbucket.org/chromiumembedded/cef/issues/2359
'name': 'chrome_browser_content_settings',
},
{
# Don't initialize ExtensionSystemFactory when extensions are disabled.
# https://bitbucket.org/chromiumembedded/cef/issues/2852
'name': 'chrome_browser_themes',
},
{
# Make some methods of ProfileManager virtual.
#

View File

@ -0,0 +1,37 @@
diff --git chrome/browser/themes/theme_service_factory.cc chrome/browser/themes/theme_service_factory.cc
index 3f065778092c..3661a9ece2a6 100644
--- chrome/browser/themes/theme_service_factory.cc
+++ chrome/browser/themes/theme_service_factory.cc
@@ -6,6 +6,7 @@
#include "base/logging.h"
#include "build/build_config.h"
+#include "cef/libcef/features/features.h"
#include "chrome/browser/extensions/extension_system_factory.h"
#include "chrome/browser/profiles/incognito_helpers.h"
#include "chrome/browser/profiles/profile.h"
@@ -25,6 +26,10 @@
#include "ui/views/linux_ui/linux_ui.h"
#endif
+#if BUILDFLAG(ENABLE_CEF)
+#include "cef/libcef/common/extensions/extensions_util.h"
+#endif
+
// static
ThemeService* ThemeServiceFactory::GetForProfile(Profile* profile) {
return static_cast<ThemeService*>(
@@ -54,7 +59,13 @@ ThemeServiceFactory::ThemeServiceFactory()
BrowserContextDependencyManager::GetInstance()) {
DependsOn(extensions::ExtensionRegistryFactory::GetInstance());
DependsOn(extensions::ExtensionPrefsFactory::GetInstance());
+#if BUILDFLAG(ENABLE_CEF)
+ if (extensions::ExtensionsEnabled()) {
+#endif
DependsOn(extensions::ExtensionSystemFactory::GetInstance());
+#if BUILDFLAG(ENABLE_CEF)
+ }
+#endif
}
ThemeServiceFactory::~ThemeServiceFactory() {}