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

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: 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_service.cc
diff --git a/chrome/browser/extensions/extension_service.cc b/chrome/browser/extensions/extension_service.cc
index ac49c1dfce81fa2e55807059079e5a576445332f..e16fcd08e705704600ba3843d6ff6c481f4d7c33 100644
--- a/chrome/browser/extensions/extension_service.cc
+++ b/chrome/browser/extensions/extension_service.cc
@@ -544,7 +544,10 @@ bool ExtensionService::UpdateExtension(const std::string& id,
if (pending_extension_info) {
installer->set_install_source(pending_extension_info->install_source());
if (pending_extension_info->install_silently())
- installer->set_allow_silent_install(true);
+ installer->set_allow_silent_install(
+ pending_extension_info->remote_install()
+ ? CrxInstaller::SILENTLY_DONT_GRANT
+ : CrxInstaller::GRANT_SILENTLY);
creation_flags = pending_extension_info->creation_flags();
if (pending_extension_info->mark_acknowledged())
AcknowledgeExternalExtension(id);
@@ -1495,10 +1498,11 @@ void ExtensionService::AddExtension(const Extension* extension) {
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);
+ // only reason it was disabled, or if the extensions was remotely installed.
+ int reasons = extension_prefs_->GetDisableReasons(extension->id());
+ if (reasons == Extension::DISABLE_PERMISSIONS_INCREASE ||
+ reasons & Extension::DISABLE_REMOTE_INSTALL) {
+ extensions::AddExtensionDisabledError(this, extension, reasons);
}
} else if (reloading) {
// Replace the old extension with the new version.

Powered by Google App Engine
This is Rietveld 408576698