diff options
Diffstat (limited to 'chrome/browser/sync/glue/theme_util.cc')
-rw-r--r-- | chrome/browser/sync/glue/theme_util.cc | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/chrome/browser/sync/glue/theme_util.cc b/chrome/browser/sync/glue/theme_util.cc index 0f2a16b..c2d70ca 100644 --- a/chrome/browser/sync/glue/theme_util.cc +++ b/chrome/browser/sync/glue/theme_util.cc @@ -10,12 +10,12 @@ #include "base/scoped_ptr.h" #include "chrome/browser/extensions/extension_install_ui.h" #include "chrome/browser/extensions/extension_updater.h" -#include "chrome/browser/extensions/extensions_service.h" +#include "chrome/browser/extensions/extension_service.h" #if defined(TOOLKIT_USES_GTK) #include "chrome/browser/gtk/gtk_theme_provider.h" #endif #include "chrome/browser/prefs/pref_service.h" -#include "chrome/browser/profile.h" +#include "chrome/browser/profiles/profile.h" #include "chrome/browser/sync/protocol/theme_specifics.pb.h" #include "chrome/common/extensions/extension.h" #include "chrome/common/extensions/extension_constants.h" @@ -75,6 +75,14 @@ bool AreThemeSpecificsEqualHelper( } } +namespace { + +bool IsTheme(const Extension& extension) { + return extension.is_theme(); +} + +} // namespace + void SetCurrentThemeFromThemeSpecifics( const sync_pb::ThemeSpecifics& theme_specifics, Profile* profile) { @@ -85,7 +93,7 @@ void SetCurrentThemeFromThemeSpecifics( std::string id(theme_specifics.custom_theme_id()); GURL update_url(theme_specifics.custom_theme_update_url()); VLOG(1) << "Applying theme " << id << " with update_url " << update_url; - ExtensionsService* extensions_service = profile->GetExtensionsService(); + ExtensionService* extensions_service = profile->GetExtensionService(); CHECK(extensions_service); const Extension* extension = extensions_service->GetExtensionById(id, true); if (extension) { @@ -125,8 +133,6 @@ void SetCurrentThemeFromThemeSpecifics( // No extension with this id exists -- we must install it; we do // so by adding it as a pending extension and then triggering an // auto-update cycle. - const PendingExtensionInfo::ExpectedCrxType kExpectedCrxType = - PendingExtensionInfo::THEME; // Themes don't need to install silently as they just pop up an // informational dialog after installation instead of a // confirmation dialog. @@ -134,11 +140,11 @@ void SetCurrentThemeFromThemeSpecifics( const bool kEnableOnInstall = true; const bool kEnableIncognitoOnInstall = false; extensions_service->AddPendingExtensionFromSync( - id, update_url, kExpectedCrxType, + id, update_url, &IsTheme, kInstallSilently, kEnableOnInstall, kEnableIncognitoOnInstall); ExtensionUpdater* extension_updater = extensions_service->updater(); // Auto-updates should now be on always (see the construction of - // the ExtensionsService in ProfileImpl::InitExtensions()). + // the ExtensionService in ProfileImpl::InitExtensions()). if (!extension_updater) { LOG(DFATAL) << "Extension updater unexpectedly NULL; " << "auto-updates may be turned off"; |