Chromium Code Reviews| Index: content/public/browser/download_item.h |
| diff --git a/content/public/browser/download_item.h b/content/public/browser/download_item.h |
| index 67b4172cf99dbea0784163bdde24e478fee5b844..13dde7a57b66a97622cae2e25f27b7d3075fa644 100644 |
| --- a/content/public/browser/download_item.h |
| +++ b/content/public/browser/download_item.h |
| @@ -27,6 +27,7 @@ |
| #include "content/public/browser/download_danger_type.h" |
| #include "content/public/browser/download_interrupt_reasons.h" |
| #include "content/public/common/page_transition_types.h" |
| +#include "net/base/net_log.h" |
| class FilePath; |
| class GURL; |
| @@ -89,6 +90,14 @@ class CONTENT_EXPORT DownloadItem : public base::SupportsUserData { |
| // TARGET_DISPOSITION_OVERWRITE. |
| }; |
| + enum ResumeMode { |
| + RESUME_MODE_INVALID = 0, |
| + RESUME_MODE_IMMEDIATE_CONTINUE, |
| + RESUME_MODE_IMMEDIATE_RESTART, |
| + RESUME_MODE_USER_CONTINUE, |
| + RESUME_MODE_USER_RESTART |
| + }; |
|
Randy Smith (Not in Mondays)
2012/10/15 00:36:08
I'm uncomfortable about exposing this at the Downl
|
| + |
| // A fake download table ID which represents a download that has started, |
| // but is not yet in the table. |
| static const int kUninitializedHandle; |
| @@ -164,6 +173,7 @@ class CONTENT_EXPORT DownloadItem : public base::SupportsUserData { |
| virtual DownloadInterruptReason GetLastReason() const = 0; |
| virtual bool IsPaused() const = 0; |
| + virtual ResumeMode CanResumeInterrupted() const = 0; |
| virtual bool IsTemporary() const = 0; |
| virtual bool IsPersisted() const = 0; |
| @@ -285,6 +295,9 @@ class CONTENT_EXPORT DownloadItem : public base::SupportsUserData { |
| // Returns true if it is OK to open the download. |
| virtual bool CanOpenDownload() = 0; |
| + // Returns true if the download is paused or interrupted, and can be resumed. |
| + virtual bool CanResumeDownload() const = 0; |
| + |
| // Tests if a file type should be opened automatically. |
| virtual bool ShouldOpenFileBasedOnExtension() = 0; |
| @@ -332,6 +345,9 @@ class CONTENT_EXPORT DownloadItem : public base::SupportsUserData { |
| virtual void SetDisplayName(const FilePath& name) = 0; |
| // Debug/testing ------------------------------------------------------------- |
| + // Gets the BoundNetLog associated with this download. |
| + virtual const net::BoundNetLog& GetBoundNetLog() const = 0; |
| + |
| virtual std::string DebugString(bool verbose) const = 0; |
| virtual void MockDownloadOpenForTesting() = 0; |
| }; |