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

Unified Diff: chrome/browser/download/download_manager.h

Issue 2877008: Rename the download to its final name only after the download is finished (Closed)
Patch Set: rebase Created 10 years, 5 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
« no previous file with comments | « chrome/browser/download/download_item.cc ('k') | chrome/browser/download/download_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/download/download_manager.h
diff --git a/chrome/browser/download/download_manager.h b/chrome/browser/download/download_manager.h
index 55bc52223a9c49fe6ad260621767d4241f04c6f1..1f23b4fc8f1c7aa05c10bfc261c0439163c9cd88 100644
--- a/chrome/browser/download/download_manager.h
+++ b/chrome/browser/download/download_manager.h
@@ -57,6 +57,7 @@ class DownloadManager : public base::RefCountedThreadSafe<DownloadManager>,
public SelectFileDialog::Listener {
// For testing.
friend class DownloadManagerTest;
+ friend class MockDownloadManager;
public:
// A fake download table ID which representas a download that has started,
@@ -318,7 +319,8 @@ class DownloadManager : public base::RefCountedThreadSafe<DownloadManager>,
const FilePath& target_path);
// Update the history service for a particular download.
- void UpdateHistoryForDownload(DownloadItem* download);
+ // Marked virtual for testing.
+ virtual void UpdateHistoryForDownload(DownloadItem* download);
void RemoveDownloadFromHistory(DownloadItem* download);
void RemoveDownloadsFromHistoryBetween(const base::Time remove_begin,
const base::Time remove_before);
@@ -351,7 +353,8 @@ class DownloadManager : public base::RefCountedThreadSafe<DownloadManager>,
// dangerous downloads are downloaded to temporary files that need to be
// renamed on the file thread first.
// Invoked on the UI thread.
- void ContinueDownloadFinished(DownloadItem* download);
+ // Marked virtual for testing.
+ virtual void ContinueDownloadFinished(DownloadItem* download);
// Renames a finished dangerous download from its temporary file name to its
// real file name.
@@ -370,7 +373,8 @@ class DownloadManager : public base::RefCountedThreadSafe<DownloadManager>,
bool IsDangerous(const FilePath& file_name);
// Updates the app icon about the overall download progress.
- void UpdateAppIcon();
+ // Marked virtual for testing.
+ virtual void UpdateAppIcon();
// Changes the paths and file name of the specified |download|, propagating
// the change to the history system.
« no previous file with comments | « chrome/browser/download/download_item.cc ('k') | chrome/browser/download/download_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698