Index: chrome/browser/download/download_util.h |
diff --git a/chrome/browser/download/download_util.h b/chrome/browser/download/download_util.h |
index 6ee8f8984bdc8f1830523e37500571d2e85bc3b9..dee36003be20b127f7efef7d43e90f37b349a6bb 100644 |
--- a/chrome/browser/download/download_util.h |
+++ b/chrome/browser/download/download_util.h |
@@ -11,6 +11,7 @@ |
#include <string> |
#include "base/basictypes.h" |
+#include "base/task.h" |
#include "gfx/native_widget_types.h" |
#if defined(TOOLKIT_VIEWS) |
@@ -29,6 +30,23 @@ class SkBitmap; |
namespace download_util { |
+// DownloadProgressTask -------------------------------------------------------- |
+ |
+// A class for managing the timed progress animations for a download view. The |
+// view must implement an UpdateDownloadProgress() method. |
+template<class DownloadView> |
+class DownloadProgressTask : public Task { |
+ public: |
+ explicit DownloadProgressTask(DownloadView* view) : view_(view) {} |
+ virtual ~DownloadProgressTask() {} |
+ virtual void Run() { |
+ view_->UpdateDownloadProgress(); |
+ } |
+ private: |
+ DownloadView* view_; |
+ DISALLOW_COPY_AND_ASSIGN(DownloadProgressTask); |
+}; |
+ |
// Download opening ------------------------------------------------------------ |
// Whether it is OK to open this download. |