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 e3e4d22e9410f74252978b45e15f60671fe259d2..4a9b469cdb19b890a3f8c870d7151e4b218c26ec 100644 |
| --- a/content/public/browser/download_item.h |
| +++ b/content/public/browser/download_item.h |
| @@ -21,6 +21,7 @@ |
| #include <string> |
| #include <vector> |
| +#include "base/callback_forward.h" |
| #include "base/files/file_path.h" |
| #include "base/string16.h" |
| #include "base/supports_user_data.h" |
| @@ -81,6 +82,9 @@ class CONTENT_EXPORT DownloadItem : public base::SupportsUserData { |
| // TARGET_DISPOSITION_OVERWRITE. |
| }; |
| + // Callback used with AcquireFileAndDeleteDownload(). |
| + typedef base::Callback<void(const base::FilePath&)> AcquireFileCallback; |
| + |
| static const char kEmptyFileHash[]; |
| // Interface that observers of a particular download must implement in order |
| @@ -140,6 +144,13 @@ class CONTENT_EXPORT DownloadItem : public base::SupportsUserData { |
| // history. |
| virtual void Delete(DeleteReason reason) = 0; |
| + // Acquires the download file and deletes the download. Equivalent to calling |
| + // |Delete(DELETE_DUE_TO_USER_DISCARD)| with the exception that the download |
| + // file isn't deleted. The path to the file is passed to the |callback|. If |
| + // the downloaded file is not available, then returned path will be empty. |
| + virtual void AcquireFileAndDeleteDownload( |
|
benjhayden
2013/05/14 20:48:05
Method names containing "And" generally signal to
asanka
2013/05/14 21:14:34
The intention is for this operation to be atomic.
|
| + const AcquireFileCallback& callback) = 0; |
| + |
| // Removes the download from the views and history. |
| virtual void Remove() = 0; |