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

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: histogram owner Created 6 years, 7 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..8ac5c07749b531019bc1881f77d81c42355d5ca1 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_->HasDisableReason(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_->HasDisableReason(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()));
@@ -465,11 +469,21 @@ bool ExtensionSyncService::ProcessExtensionSyncDataHelper(
// been installed yet, so we don't know if the disable reason was a
// permissions increase. That will be updated once CheckPermissionsIncrease
// is called for it.
+ // However if the extension is marked as a remote install in sync, we know
+ // what the disable reason is, so set it to that directly. Note that when
+ // CheckPermissionsIncrease runs, it might still add permissions increase
+ // as a disable reason for the extension.
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)) {
+ if (extension_sync_data.remote_install()) {
+ extension_service_->DisableExtension(id,
+ Extension::DISABLE_REMOTE_INSTALL);
+ } else {
+ extension_service_->DisableExtension(
+ id, Extension::DISABLE_UNKNOWN_FROM_SYNC);
+ }
+ }
// We need to cache some version information here because setting the
// incognito flag invalidates the |extension| pointer (it reloads the
@@ -501,7 +515,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
« no previous file with comments | « chrome/browser/extensions/extension_sync_data.cc ('k') | chrome/browser/extensions/pending_extension_info.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698