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

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

Issue 230103002: [Downloads] Ask DownloadHistory if a download was from history. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Move responsibility of determining whether to show a download in the UI to DownloadItemModel Created 6 years, 8 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: chrome/browser/download/download_ui_controller.h
diff --git a/chrome/browser/download/download_ui_controller.h b/chrome/browser/download/download_ui_controller.h
index f4f8de8a7e6a49fac408f70904d7de7fd249db15..422ea8b677ad6d5129c3161ba10e98bcbf87c61a 100644
--- a/chrome/browser/download/download_ui_controller.h
+++ b/chrome/browser/download/download_ui_controller.h
@@ -7,30 +7,31 @@
#include <set>
+#include "base/callback_forward.h"
Randy Smith (Not in Mondays) 2014/04/21 18:21:22 Is this include still needed?
asanka 2014/04/23 05:51:09 Removed.
#include "base/memory/scoped_ptr.h"
#include "chrome/browser/download/all_download_item_notifier.h"
class Profile;
+class DownloadHistory;
Randy Smith (Not in Mondays) 2014/04/21 18:21:22 Is this forward decl still needed?
asanka 2014/04/23 05:51:09 Removed.
namespace content {
class WebContents;
}
-// This class handles the task of observing for download notifications and
+// This class handles the task of observing a single DownloadManager for
// notifying the UI when a new download should be displayed in the UI.
-//
-// This class monitors each IN_PROGRESS download that is created (for which
-// OnDownloadCreated is called) until:
-// - it is assigned a target path or
-// - is interrupted.
-// Then the NotifyDownloadStarting() method of the Delegate is invoked.
+// It invokes the OnNewDownloadReady() method of hte Delegate when the
+// target path is available for a new download.
class DownloadUIController : public AllDownloadItemNotifier::Observer {
public:
// The delegate is responsible for figuring out how to notify the UI.
class Delegate {
public:
virtual ~Delegate();
- virtual void NotifyDownloadStarting(content::DownloadItem* item) = 0;
+
+ // This method is invoked to notify the UI of the new download |item|. Note
+ // that |item| may be in any state by the time this method is invoked.
+ virtual void OnNewDownloadReady(content::DownloadItem* item) = 0;
};
// |manager| is the download manager to observe for new downloads. If

Powered by Google App Engine
This is Rietveld 408576698