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

Unified Diff: chrome/browser/download/download_browsertest.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/download/download_browsertest.cc
===================================================================
--- chrome/browser/download/download_browsertest.cc (revision 140592)
+++ chrome/browser/download/download_browsertest.cc (working copy)
@@ -64,6 +64,7 @@
#include "net/test/test_server.h"
#include "testing/gtest/include/gtest/gtest.h"
+using content::BrowserContext;
using content::BrowserThread;
using content::DownloadItem;
using content::DownloadManager;
@@ -85,8 +86,6 @@
public:
explicit PickSuggestedFileDelegate(Profile* profile)
: ChromeDownloadManagerDelegate(profile) {
- SetDownloadManager(
- DownloadServiceFactory::GetForProfile(profile)->GetDownloadManager());
}
virtual void ChooseDownloadPath(WebContents* web_contents,
@@ -186,8 +185,7 @@
};
static DownloadManager* DownloadManagerForBrowser(Browser* browser) {
- return DownloadServiceFactory::GetForProfile(browser->profile())
- ->GetDownloadManager();
+ return BrowserContext::GetDownloadManager(browser->profile());
}
class TestRenderViewContextMenu : public RenderViewContextMenu {
@@ -1401,7 +1399,7 @@
observer1->WaitForFinished();
std::vector<DownloadItem*> downloads;
- browser()->profile()->GetDownloadManager()->SearchDownloads(
+ DownloadManagerForBrowser(browser())->SearchDownloads(
string16(), &downloads);
ASSERT_EQ(1u, downloads.size());
ASSERT_EQ(DownloadItem::IN_PROGRESS, downloads[0]->GetState());
@@ -1416,7 +1414,7 @@
// Should now have 2 items on the download shelf.
downloads.clear();
- browser()->profile()->GetDownloadManager()->SearchDownloads(
+ DownloadManagerForBrowser(browser())->SearchDownloads(
string16(), &downloads);
ASSERT_EQ(2u, downloads.size());
// We don't know the order of the downloads.

Powered by Google App Engine
This is Rietveld 408576698