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

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

Issue 264763002: Support remote installation of extensions and apps. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase 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_service.cc
diff --git a/chrome/browser/extensions/extension_service.cc b/chrome/browser/extensions/extension_service.cc
index 037abdbbdbe63e221bd4e4d1888fafcbb310cb18..91c5a00bbc85845858ec75686bbf24af2cdc27ec 100644
--- a/chrome/browser/extensions/extension_service.cc
+++ b/chrome/browser/extensions/extension_service.cc
@@ -544,6 +544,8 @@ bool ExtensionService::UpdateExtension(const std::string& id,
installer->set_install_source(pending_extension_info->install_source());
if (pending_extension_info->install_silently())
installer->set_allow_silent_install(true);
+ if (pending_extension_info->remote_install())
+ installer->set_grant_permissions(false);
creation_flags = pending_extension_info->creation_flags();
if (pending_extension_info->mark_acknowledged())
AcknowledgeExternalExtension(id);
@@ -1492,11 +1494,17 @@ void ExtensionService::AddExtension(const Extension* extension) {
content::Source<Profile>(profile_),
content::Details<const Extension>(extension));
- // Show the extension disabled error if a permissions increase was the
- // only reason it was disabled.
- if (extension_prefs_->GetDisableReasons(extension->id()) ==
- Extension::DISABLE_PERMISSIONS_INCREASE) {
- extensions::AddExtensionDisabledError(this, extension);
+ // Show the extension disabled error if a permissions increase or a remote
+ // installation is the reason it was disabled, and no other reasons exist.
+ int reasons = extension_prefs_->GetDisableReasons(extension->id());
+ const int kReasonMask = Extension::DISABLE_PERMISSIONS_INCREASE |
+ Extension::DISABLE_REMOTE_INSTALL;
+ if (reasons & kReasonMask && !(reasons & ~kReasonMask)) {
+ extensions::AddExtensionDisabledError(
+ this,
+ extension,
+ extension_prefs_->HasDisableReason(
+ extension->id(), Extension::DISABLE_REMOTE_INSTALL));
}
} else if (reloading) {
// Replace the old extension with the new version.

Powered by Google App Engine
This is Rietveld 408576698