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 b3003ef9e8aa3997c6a4e7691bca6d192dec0f63..b32929be3501d8e9c6aceda63d3500b2e0bde8b6 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 |
| @@ -136,6 +140,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( |
|
Randy Smith (Not in Mondays)
2013/05/23 13:56:43
What do you think of naming this in some fashion t
asanka
2013/05/23 15:53:31
How about this?:
- ValidateDangerousDownload()
- S
|
| + const AcquireFileCallback& callback) = 0; |
| + |
| // Removes the download from the views and history. |
| virtual void Remove() = 0; |