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

Unified Diff: chrome/browser/extensions/crx_installer.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/crx_installer.cc
diff --git a/chrome/browser/extensions/crx_installer.cc b/chrome/browser/extensions/crx_installer.cc
index f419eab38665ea39cbda5627996314b25a058d76..ad0278fbed481ee7766f7b13705a00d9f4d23d2c 100644
--- a/chrome/browser/extensions/crx_installer.cc
+++ b/chrome/browser/extensions/crx_installer.cc
@@ -105,10 +105,9 @@ scoped_refptr<CrxInstaller> CrxInstaller::Create(
return new CrxInstaller(service->AsWeakPtr(), client.Pass(), approval);
}
-CrxInstaller::CrxInstaller(
- base::WeakPtr<ExtensionService> service_weak,
- scoped_ptr<ExtensionInstallPrompt> client,
- const WebstoreInstaller::Approval* approval)
+CrxInstaller::CrxInstaller(base::WeakPtr<ExtensionService> service_weak,
+ scoped_ptr<ExtensionInstallPrompt> client,
+ const WebstoreInstaller::Approval* approval)
: install_directory_(service_weak->install_directory()),
install_source_(Manifest::INTERNAL),
approved_(false),
@@ -122,7 +121,7 @@ CrxInstaller::CrxInstaller(
// See header file comment on |client_| for why we use a raw pointer here.
client_(client.release()),
apps_require_extension_mime_type_(false),
- allow_silent_install_(false),
+ allow_silent_install_(GRANT_AFTER_PROMPT),
install_cause_(extension_misc::INSTALL_CAUSE_UNSET),
creation_flags_(Extension::NO_FLAGS),
off_store_install_allow_reason_(OffStoreInstallDisallowed),
@@ -538,7 +537,7 @@ void CrxInstaller::OnBlacklistChecked(
if ((blacklist_state_ == extensions::BLACKLISTED_MALWARE ||
blacklist_state_ == extensions::BLACKLISTED_UNKNOWN) &&
- !allow_silent_install_) {
+ allow_silent_install_ == GRANT_AFTER_PROMPT) {
// User tried to install a blacklisted extension. Show an error and
// refuse to install it.
ReportFailureFromUIThread(extensions::CrxInstallerError(
@@ -608,8 +607,7 @@ void CrxInstaller::ConfirmInstall() {
current_version_ = ExtensionPrefs::Get(service->profile())
->GetVersionString(extension()->id());
- if (client_ &&
- (!allow_silent_install_ || !approved_) &&
+ if (client_ && (allow_silent_install_ == GRANT_AFTER_PROMPT || !approved_) &&
!update_from_settings_page_) {
AddRef(); // Balanced in InstallUIProceed() and InstallUIAbort().
client_->ConfirmInstall(this, extension(), show_dialog_callback_);
@@ -795,7 +793,7 @@ void CrxInstaller::ReportSuccessFromUIThread() {
// We update the extension's granted permissions if the user already
// approved the install (client_ is non NULL), or we are allowed to install
// this silently.
- if (client_ || allow_silent_install_) {
+ if (client_ || allow_silent_install_ == GRANT_SILENTLY) {
PermissionsUpdater perms_updater(profile());
perms_updater.GrantActivePermissions(extension());
}

Powered by Google App Engine
This is Rietveld 408576698