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

Unified Diff: content/public/browser/download_item.h

Issue 14947007: [Downloads] Allow acquiring dangerous download file. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 7 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
« no previous file with comments | « content/browser/download/download_item_impl_unittest.cc ('k') | content/public/test/mock_download_item.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « content/browser/download/download_item_impl_unittest.cc ('k') | content/public/test/mock_download_item.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698