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

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

Issue 10535026: Move creation and ownership of DownloadManager from the embedder to content. This matches all the o… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: fix cros compile Created 8 years, 6 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 140592)
+++ chrome/browser/extensions/webstore_installer.cc (working copy)
@@ -38,9 +38,11 @@
#include "googleurl/src/gurl.h"
#include "net/base/escape.h"
+using content::BrowserContext;
using content::BrowserThread;
using content::DownloadId;
using content::DownloadItem;
+using content::DownloadManager;
using content::NavigationController;
using content::DownloadUrlParameters;
@@ -191,7 +193,7 @@
}
FilePath download_path = DownloadPrefs::FromDownloadManager(
- profile_->GetDownloadManager())->download_path();
+ BrowserContext::GetDownloadManager(profile_))->download_path();
BrowserThread::PostTask(
BrowserThread::FILE, FROM_HERE,
base::Bind(&GetDownloadFilePath, download_path, id_,
@@ -264,7 +266,8 @@
CHECK(id.IsValid());
- content::DownloadManager* download_manager = profile_->GetDownloadManager();
+ DownloadManager* download_manager =
+ BrowserContext::GetDownloadManager(profile_);
download_item_ = download_manager->GetActiveDownloadItem(id.local());
download_item_->AddObserver(this);
if (approval_.get())
@@ -323,7 +326,7 @@
content::Referrer(controller_->GetActiveEntry()->GetURL(),
WebKit::WebReferrerPolicyDefault));
params->set_callback(base::Bind(&WebstoreInstaller::OnDownloadStarted, this));
- profile_->GetDownloadManager()->DownloadUrl(params.Pass());
+ BrowserContext::GetDownloadManager(profile_)->DownloadUrl(params.Pass());
}
void WebstoreInstaller::ReportFailure(const std::string& error) {

Powered by Google App Engine
This is Rietveld 408576698