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

Unified Diff: content/browser/download/download_manager_impl.h

Issue 722953002: downloads: add the ability to undo download removal. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: dcheck Created 6 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_impl.h
diff --git a/content/browser/download/download_manager_impl.h b/content/browser/download/download_manager_impl.h
index 0c9c33bbbad5a3b078c1b33363e610cdf1f8c908..5381edcbd4c622f25d31a9cd4b3bb8efc188646b 100644
--- a/content/browser/download/download_manager_impl.h
+++ b/content/browser/download/download_manager_impl.h
@@ -70,6 +70,8 @@ class CONTENT_EXPORT DownloadManagerImpl : public DownloadManager,
base::Time remove_end) override;
int RemoveDownloads(base::Time remove_begin) override;
int RemoveAllDownloads() override;
+ void ReviveDownload(uint32 id) override;
+ void FinalizeRemoval(uint32 id) override;
void DownloadUrl(scoped_ptr<DownloadUrlParameters> params) override;
void AddObserver(Observer* observer) override;
void RemoveObserver(Observer* observer) override;
@@ -187,6 +189,9 @@ class CONTENT_EXPORT DownloadManagerImpl : public DownloadManager,
net::NetLog* net_log_;
+ // Removed downloads; kept alive so users can undo the removal.
+ DownloadMap removed_downloads_;
+
base::WeakPtrFactory<DownloadManagerImpl> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(DownloadManagerImpl);

Powered by Google App Engine
This is Rietveld 408576698