diff options
author | rdsmith@chromium.org <rdsmith@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-12 17:43:35 +0000 |
---|---|---|
committer | rdsmith@chromium.org <rdsmith@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-12 17:43:35 +0000 |
commit | 9bb54ee0d274f9ae59898b6bba050d50b88c0163 (patch) | |
tree | 496b773fc152caba664d031ac0528a896cd98dde /content/browser | |
parent | 6e68de66949a24f7c80d715f492e94a4b69223d8 (diff) | |
download | chromium_src-9bb54ee0d274f9ae59898b6bba050d50b88c0163.zip chromium_src-9bb54ee0d274f9ae59898b6bba050d50b88c0163.tar.gz chromium_src-9bb54ee0d274f9ae59898b6bba050d50b88c0163.tar.bz2 |
Refactor downloads into a ProfileKeyedService.
BUG=94383
TEST=
Review URL: http://codereview.chromium.org/8135017
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@105115 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser')
-rw-r--r-- | content/browser/browser_context.h | 1 | ||||
-rw-r--r-- | content/browser/download/download_manager.cc | 5 | ||||
-rw-r--r-- | content/browser/download/download_manager.h | 8 |
3 files changed, 10 insertions, 4 deletions
diff --git a/content/browser/browser_context.h b/content/browser/browser_context.h index 8a3e39a..2b88d47 100644 --- a/content/browser/browser_context.h +++ b/content/browser/browser_context.h @@ -58,7 +58,6 @@ class BrowserContext { // Returns the DownloadManager associated with this context. virtual DownloadManager* GetDownloadManager() = 0; - virtual bool HasCreatedDownloadManager() const = 0; // Returns the request context information associated with this context. Call // this only on the UI thread, since it can send notifications that should diff --git a/content/browser/download/download_manager.cc b/content/browser/download/download_manager.cc index 99036f4..881beb9 100644 --- a/content/browser/download/download_manager.cc +++ b/content/browser/download/download_manager.cc @@ -613,6 +613,11 @@ void DownloadManager::RemoveFromActiveList(DownloadItem* download) { } } +void DownloadManager::SetDownloadManagerDelegate( + DownloadManagerDelegate* delegate) { + delegate_ = delegate; +} + void DownloadManager::UpdateDownloadProgress() { delegate_->DownloadProgressUpdated(); } diff --git a/content/browser/download/download_manager.h b/content/browser/download/download_manager.h index 822c1f7..d16ad2a 100644 --- a/content/browser/download/download_manager.h +++ b/content/browser/download/download_manager.h @@ -294,22 +294,24 @@ class CONTENT_EXPORT DownloadManager DownloadManagerDelegate* delegate() const { return delegate_; } + // For testing only. May be called from tests indirectly (through + // other for testing only methods). + void SetDownloadManagerDelegate(DownloadManagerDelegate* delegate); + private: typedef std::set<DownloadItem*> DownloadSet; typedef base::hash_map<int64, DownloadItem*> DownloadMap; // For testing. friend class DownloadManagerTest; - friend class MockDownloadManager; friend class DownloadTest; + friend class MockDownloadManager; friend class base::RefCountedThreadSafe<DownloadManager, BrowserThread::DeleteOnUIThread>; friend struct BrowserThread::DeleteOnThread<BrowserThread::UI>; friend class DeleteTask<DownloadManager>; - void set_delegate(DownloadManagerDelegate* delegate) { delegate_ = delegate; } - virtual ~DownloadManager(); // Called on the FILE thread to check the existence of a downloaded file. |