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

Unified Diff: content/public/browser/download_item.h

Issue 10704026: Reland DownloadItem::Observer::OnDownloadDestroyed() replaces DownloadItem::REMOVING (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 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
Index: content/public/browser/download_item.h
diff --git a/content/public/browser/download_item.h b/content/public/browser/download_item.h
index f1f420bc87481197d5a03a3bdb08d7328e3a02fa..cf9247898369f93441de9b922137f44ea65e1d2e 100644
--- a/content/public/browser/download_item.h
+++ b/content/public/browser/download_item.h
@@ -62,10 +62,6 @@ class CONTENT_EXPORT DownloadItem {
// Download has been cancelled.
CANCELLED,
- // This state indicates that the download item is about to be destroyed,
- // and observers seeing this state should release all references.
- REMOVING,
-
// This state indicates that the download has been interrupted.
INTERRUPTED,
@@ -103,10 +99,18 @@ class CONTENT_EXPORT DownloadItem {
// to receive updates to the download's status.
class CONTENT_EXPORT Observer {
public:
- virtual void OnDownloadUpdated(DownloadItem* download) = 0;
+ virtual void OnDownloadUpdated(DownloadItem* download) {}
// Called when a downloaded file has been opened.
- virtual void OnDownloadOpened(DownloadItem* download) = 0;
+ virtual void OnDownloadOpened(DownloadItem* download) {}
+
+ // Called when the user removes a download.
+ virtual void OnDownloadRemoved(DownloadItem* download) {}
+
+ // Called when the download is being destroyed. This happens after
+ // every OnDownloadRemoved() as well as when the DownloadManager is going
+ // down.
+ virtual void OnDownloadDestroyed(DownloadItem* download) {}
protected:
virtual ~Observer() {}
« chrome/browser/ui/webui/downloads_dom_handler.cc ('K') | « content/browser/download/save_package.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698