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

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

Issue 10387167: Revert 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
===================================================================
--- chrome/browser/extensions/webstore_installer.cc (revision 137574)
+++ chrome/browser/extensions/webstore_installer.cc (working copy)
@@ -124,30 +124,9 @@
WebstoreInstaller::Approval::Approval()
: profile(NULL),
use_app_installed_bubble(false),
- skip_post_install_ui(false),
- skip_install_dialog(false) {
+ skip_post_install_ui(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() {}
const WebstoreInstaller::Approval* WebstoreInstaller::GetAssociatedApproval(
@@ -306,6 +285,15 @@
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;
@@ -317,7 +305,7 @@
scoped_ptr<DownloadUrlParameters> params(
DownloadUrlParameters::FromWebContents(
controller_->GetWebContents(), download_url_, save_info));
- params->set_referrer(controller_->GetActiveEntry()->GetURL());
+ params->set_referrer(referrer);
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