Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(494)

Unified Diff: chrome/browser/extensions/extension_sync_service.cc

Issue 264763002: Support remote installation of extensions and apps. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add a first test, fix a bug Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/extension_sync_service.cc
diff --git a/chrome/browser/extensions/extension_sync_service.cc b/chrome/browser/extensions/extension_sync_service.cc
index 7dbe61398620e9c4f501402ea160bd4ed24f164f..301f5ba09ae6eccdd7486771c270fe4dd2e41587 100644
--- a/chrome/browser/extensions/extension_sync_service.cc
+++ b/chrome/browser/extensions/extension_sync_service.cc
@@ -254,7 +254,9 @@ extensions::ExtensionSyncData ExtensionSyncService::GetExtensionSyncData(
return extensions::ExtensionSyncData(
extension,
extension_service_->IsExtensionEnabled(extension.id()),
- extensions::util::IsIncognitoEnabled(extension.id(), profile_));
+ extensions::util::IsIncognitoEnabled(extension.id(), profile_),
+ extension_prefs_->GetDisableReasons(extension.id()) &
+ Extension::DISABLE_REMOTE_INSTALL);
}
extensions::AppSyncData ExtensionSyncService::GetAppSyncData(
@@ -263,6 +265,8 @@ extensions::AppSyncData ExtensionSyncService::GetAppSyncData(
extension,
extension_service_->IsExtensionEnabled(extension.id()),
extensions::util::IsIncognitoEnabled(extension.id(), profile_),
+ extension_prefs_->GetDisableReasons(extension.id()) &
+ Extension::DISABLE_REMOTE_INSTALL,
extension_prefs_->app_sorting()->GetAppLaunchOrdinal(extension.id()),
extension_prefs_->app_sorting()->GetPageOrdinal(extension.id()),
extensions::GetLaunchTypePrefValue(extension_prefs_, extension.id()));
@@ -467,9 +471,12 @@ bool ExtensionSyncService::ProcessExtensionSyncDataHelper(
// is called for it.
if (extension_sync_data.enabled())
extension_service_->EnableExtension(id);
- else if (!IsPendingEnable(id))
- extension_service_->DisableExtension(
- id, Extension::DISABLE_UNKNOWN_FROM_SYNC);
+ else if (!IsPendingEnable(id)) {
+ Extension::DisableReason reason = Extension::DISABLE_UNKNOWN_FROM_SYNC;
+ if (extension_sync_data.remote_install())
Yoyo Zhou 2014/05/01 22:53:44 I would prefer that this be written more clearly t
Marijn Kruisselbrink 2014/05/05 20:45:36 Okay, I changed this around a bit.
+ reason = Extension::DISABLE_REMOTE_INSTALL;
+ extension_service_->DisableExtension(id, reason);
+ }
// We need to cache some version information here because setting the
// incognito flag invalidates the |extension| pointer (it reloads the
@@ -501,7 +508,8 @@ bool ExtensionSyncService::ProcessExtensionSyncDataHelper(
id,
extension_sync_data.update_url(),
filter,
- kInstallSilently)) {
+ kInstallSilently,
+ extension_sync_data.remote_install())) {
LOG(WARNING) << "Could not add pending extension for " << id;
// This means that the extension is already pending installation, with a
// non-INTERNAL location. Add to pending_sync_data, even though it will

Powered by Google App Engine
This is Rietveld 408576698