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

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

Issue 10399069: Reland 137540 - Disable off-store extension installs by default. Also get rid of ExtensionService::… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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/webstore_installer.cc
diff --git a/chrome/browser/extensions/webstore_installer.cc b/chrome/browser/extensions/webstore_installer.cc
index 270a2a66047cc3eacc761d3fcf0886bf85bd1dfa..b43c2c39ce5b38e13165be6f4d43c41c15cbc9fc 100644
--- a/chrome/browser/extensions/webstore_installer.cc
+++ b/chrome/browser/extensions/webstore_installer.cc
@@ -124,7 +124,28 @@ void GetDownloadFilePath(
WebstoreInstaller::Approval::Approval()
: profile(NULL),
use_app_installed_bubble(false),
- skip_post_install_ui(false) {
+ skip_post_install_ui(false),
+ skip_install_dialog(false) {
+}
+
+scoped_ptr<WebstoreInstaller::Approval>
+WebstoreInstaller::Approval::CreateWithInstallPrompt(Profile* profile) {
+ scoped_ptr<Approval> result(new Approval());
+ result->profile = profile;
+ return result.Pass();
+}
+
+scoped_ptr<WebstoreInstaller::Approval>
+WebstoreInstaller::Approval::CreateWithNoInstallPrompt(
+ Profile* profile,
+ const std::string& extension_id,
+ scoped_ptr<base::DictionaryValue> parsed_manifest) {
+ scoped_ptr<Approval> result(new Approval());
+ result->extension_id = extension_id;
+ result->profile = profile;
+ result->parsed_manifest = parsed_manifest.Pass();
+ result->skip_install_dialog = true;
+ return result.Pass();
}
WebstoreInstaller::Approval::~Approval() {}
@@ -285,15 +306,6 @@ void WebstoreInstaller::StartDownload(const FilePath& file) {
return;
}
- // TODO(mihaip): For inline installs, we pretend like the referrer is the
- // gallery, even though this could be an inline install, in order to pass the
- // checks in ExtensionService::IsDownloadFromGallery. We should instead pass
- // the real referrer, track if this is an inline install in the whitelist
- // entry and look that up when checking that this is a valid download.
- GURL referrer = controller_->GetActiveEntry()->GetURL();
- if (flags_ & FLAG_INLINE_INSTALL)
- referrer = GURL(extension_urls::GetWebstoreItemDetailURLPrefix() + id_);
-
content::DownloadSaveInfo save_info;
save_info.file_path = file;
@@ -305,7 +317,7 @@ void WebstoreInstaller::StartDownload(const FilePath& file) {
scoped_ptr<DownloadUrlParameters> params(
DownloadUrlParameters::FromWebContents(
controller_->GetWebContents(), download_url_, save_info));
- params->set_referrer(referrer);
+ params->set_referrer(controller_->GetActiveEntry()->GetURL());
params->set_callback(base::Bind(&WebstoreInstaller::OnDownloadStarted, this));
profile_->GetDownloadManager()->DownloadUrl(params.Pass());
}
« no previous file with comments | « chrome/browser/extensions/webstore_installer.h ('k') | chrome/browser/ui/intents/web_intent_picker_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698