diff options
Diffstat (limited to 'chrome/browser/sync/glue/theme_util.cc')
-rw-r--r-- | chrome/browser/sync/glue/theme_util.cc | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/chrome/browser/sync/glue/theme_util.cc b/chrome/browser/sync/glue/theme_util.cc index f4d0181..3d700da 100644 --- a/chrome/browser/sync/glue/theme_util.cc +++ b/chrome/browser/sync/glue/theme_util.cc @@ -102,7 +102,14 @@ void SetCurrentThemeFromThemeSpecifics( VLOG(1) << "Extension " << id << " is not a theme; aborting"; return; } - if (!extensions_service->IsExtensionEnabled(id)) { + ExtensionPrefs* extension_prefs = extensions_service->extension_prefs(); + CHECK(extension_prefs); + // TODO(akalin): GetExtensionState() isn't very safe as it + // returns Extension::ENABLED by default; either change it to + // return something else by default or create a separate + // function that does so. + if (extension_prefs->GetExtensionState(extension->id()) != + Extension::ENABLED) { VLOG(1) << "Theme " << id << " is not enabled; aborting"; return; } @@ -137,7 +144,15 @@ void SetCurrentThemeFromThemeSpecifics( extensions_service->pending_extension_manager()->AddFromSync( id, update_url, &IsTheme, kInstallSilently, kEnableOnInstall, kEnableIncognitoOnInstall); - extensions_service->CheckForUpdates(); + ExtensionUpdater* extension_updater = extensions_service->updater(); + // Auto-updates should now be on always (see the construction of + // the ExtensionService in ProfileImpl::InitExtensions()). + if (!extension_updater) { + LOG(DFATAL) << "Extension updater unexpectedly NULL; " + << "auto-updates may be turned off"; + return; + } + extension_updater->CheckNow(); } } else if (theme_specifics.use_system_theme_by_default()) { ThemeServiceFactory::GetForProfile(profile)->SetNativeTheme(); |