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

Unified Diff: chrome/browser/automation/testing_automation_provider.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/automation/testing_automation_provider.cc
===================================================================
--- chrome/browser/automation/testing_automation_provider.cc (revision 140592)
+++ chrome/browser/automation/testing_automation_provider.cc (working copy)
@@ -177,6 +177,7 @@
using automation::ErrorCode;
using automation_util::SendErrorIfModalDialogActive;
using content::BrowserChildProcessHostIterator;
+using content::BrowserContext;
using content::BrowserThread;
using content::ChildProcessHost;
using content::DownloadItem;
@@ -1148,7 +1149,8 @@
int handle, FilePath* download_directory) {
if (tab_tracker_->ContainsHandle(handle)) {
NavigationController* tab = tab_tracker_->GetResource(handle);
- DownloadManager* dlm = tab->GetBrowserContext()->GetDownloadManager();
+ DownloadManager* dlm =
+ BrowserContext::GetDownloadManager(tab->GetBrowserContext());
*download_directory =
DownloadPrefs::FromDownloadManager(dlm)->download_path();
}
@@ -2628,7 +2630,7 @@
if (download_service->HasCreatedDownloadManager()) {
std::vector<DownloadItem*> downloads;
- download_service->GetDownloadManager()->
+ BrowserContext::GetDownloadManager(browser->profile())->
GetAllDownloads(FilePath(), &downloads);
for (std::vector<DownloadItem*>::iterator it = downloads.begin();
@@ -2663,7 +2665,8 @@
// This observer will delete itself.
new AllDownloadsCompleteObserver(
- this, reply_message, download_service->GetDownloadManager(),
+ this, reply_message,
+ BrowserContext::GetDownloadManager(browser->profile()),
pre_download_ids);
}
@@ -2709,7 +2712,8 @@
return;
}
- DownloadManager* download_manager = download_service->GetDownloadManager();
+ DownloadManager* download_manager =
+ BrowserContext::GetDownloadManager(browser->profile());
DownloadItem* selected_item = GetDownloadItemFromId(id, download_manager);
if (!selected_item) {
AutomationJSONReply(this, reply_message)
@@ -3330,8 +3334,7 @@
}
// The observer will delete itself when done.
new SavePackageNotificationObserver(
- DownloadServiceFactory::GetForProfile(
- browser->profile())->GetDownloadManager(),
+ BrowserContext::GetDownloadManager(browser->profile()),
this, reply_message);
}

Powered by Google App Engine
This is Rietveld 408576698