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

Unified Diff: content/browser/download/download_manager.cc

Issue 8351052: Created a DownloadManager interface, for use in unit tests.. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed Mac & Clang issues. Created 9 years, 1 month 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: content/browser/download/download_manager.cc
diff --git a/content/browser/download/download_manager.cc b/content/browser/download/download_manager.cc
index 5cdf0065083262566f8ca7e91ae9278dbcc77af0..dffa8e04877a762816d3f6e01e313fa321f31018 100644
--- a/content/browser/download/download_manager.cc
+++ b/content/browser/download/download_manager.cc
@@ -313,6 +313,14 @@ void DownloadManager::RestartDownload(
}
}
+content::BrowserContext* DownloadManager::BrowserContext() {
+ return browser_context_;
+}
+
+FilePath DownloadManager::LastDownloadPath() {
+ return last_download_path_;
+}
+
void DownloadManager::CreateDownloadItem(
DownloadCreateInfo* info, const DownloadRequestHandle& request_handle) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
@@ -605,6 +613,10 @@ void DownloadManager::RemoveFromActiveList(DownloadItem* download) {
}
}
+content::DownloadManagerDelegate* DownloadManager::delegate() const {
+ return delegate_;
+}
+
void DownloadManager::SetDownloadManagerDelegate(
content::DownloadManagerDelegate* delegate) {
delegate_ = delegate;
@@ -928,6 +940,10 @@ void DownloadManager::ShowDownloadInBrowser(DownloadItem* download) {
content->OnStartDownload(download);
}
+int DownloadManager::InProgressCount() const {
+ return static_cast<int>(in_progress_.size());
+}
+
// Clears the last download path, used to initialize "save as" dialogs.
void DownloadManager::ClearLastDownloadPath() {
last_download_path_ = FilePath();
@@ -1077,3 +1093,7 @@ void DownloadManager::MarkDownloadOpened(DownloadItem* download) {
}
download_stats::RecordOpensOutstanding(num_unopened);
}
+
+void DownloadManager::SetFileManager(DownloadFileManager* file_manager) {
+ file_manager_ = file_manager;
+}

Powered by Google App Engine
This is Rietveld 408576698