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

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

Issue 10232010: DownloadUrlParameters (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: fixes Created 8 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/webstore_installer.cc
diff --git a/chrome/browser/extensions/webstore_installer.cc b/chrome/browser/extensions/webstore_installer.cc
index da62be7ff9a38a980393b2f54d2892208f42ad5d..f86eba436c49c6ae3372c36950f69f4eb8eda5c3 100644
--- a/chrome/browser/extensions/webstore_installer.cc
+++ b/chrome/browser/extensions/webstore_installer.cc
@@ -9,9 +9,9 @@
#include "base/command_line.h"
#include "base/file_util.h"
#include "base/rand_util.h"
-#include "base/stringprintf.h"
-#include "base/string_util.h"
#include "base/string_number_conversions.h"
+#include "base/string_util.h"
+#include "base/stringprintf.h"
#include "base/utf_string_conversions.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/download/chrome_download_manager_delegate.h"
@@ -29,6 +29,7 @@
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/download_manager.h"
#include "content/public/browser/download_save_info.h"
+#include "content/public/browser/download_url_parameters.h"
#include "content/public/browser/navigation_controller.h"
#include "content/public/browser/navigation_entry.h"
#include "content/public/browser/notification_details.h"
@@ -41,6 +42,7 @@ using content::BrowserThread;
using content::DownloadId;
using content::DownloadItem;
using content::NavigationController;
+using content::DownloadUrlParameters;
namespace {
@@ -299,11 +301,13 @@ void WebstoreInstaller::StartDownload(const FilePath& file) {
// We will navigate the current tab to this url to start the download. The
// download system will then pass the crx to the CrxInstaller.
download_util::RecordDownloadSource(
- download_util::INITIATED_BY_WEBSTORE_INSTALLER);
- profile_->GetDownloadManager()->DownloadUrl(
- download_url_, referrer, "",
- false, -1, save_info, controller_->GetWebContents(),
- base::Bind(&WebstoreInstaller::OnDownloadStarted, this));
+ download_util::INITIATED_BY_WEBSTORE_INSTALLER);
+ scoped_ptr<DownloadUrlParameters> params(
+ DownloadUrlParameters::FromWebContents(
+ controller_->GetWebContents(), download_url_, save_info));
+ params->set_referrer(referrer);
+ params->set_callback(base::Bind(&WebstoreInstaller::OnDownloadStarted, this));
+ profile_->GetDownloadManager()->DownloadUrl(params.Pass());
}
void WebstoreInstaller::ReportFailure(const std::string& error) {
« no previous file with comments | « chrome/browser/download/download_test_observer.cc ('k') | chrome/browser/tab_contents/render_view_context_menu.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698