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

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

Issue 10735089: DownloadManager::Observer::OnDownloadCreated (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
« no previous file with comments | « content/browser/download/download_manager_impl_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/browser/download_manager.h
diff --git a/content/public/browser/download_manager.h b/content/public/browser/download_manager.h
index 09628b0268a217e273cd1e564cbe5d1a03d1422e..eea06be21037444a15af21a0bbce6a43ecd3f1c4 100644
--- a/content/public/browser/download_manager.h
+++ b/content/public/browser/download_manager.h
@@ -79,9 +79,20 @@ class CONTENT_EXPORT DownloadManager
// to the DownloadManager's collection of downloads.
class CONTENT_EXPORT Observer {
public:
+ // A DownloadItem was created. Unlike ModelChanged, this item may be
+ // visible before the filename is determined; in this case the return value
+ // of GetTargetFileName() will be null. This method may be called an
+ // arbitrary number of times, e.g. when loading history on startup. As a
+ // result, consumers should avoid doing large amounts of work in
+ // OnDownloadCreated(). TODO(<whoever>): When we've fully specified the
+ // possible states of the DownloadItem in download_item.h and removed
+ // ModelChanged, we should remove the caveat above.
+ virtual void OnDownloadCreated(
+ DownloadManager* manager, DownloadItem* item) {}
+
// New or deleted download, observers should query us for the current set
// of downloads.
- virtual void ModelChanged(DownloadManager* manager) = 0;
+ virtual void ModelChanged(DownloadManager* manager) {}
// Called when the DownloadManager is being destroyed to prevent Observers
// from calling back to a stale pointer.
« no previous file with comments | « content/browser/download/download_manager_impl_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698