Index: content/browser/download/download_item_impl_delegate.h |
diff --git a/content/browser/download/download_item_impl_delegate.h b/content/browser/download/download_item_impl_delegate.h |
index 9e5e2aa4e82b9be1f01401d7cd84b6e816b6d0ca..d06aad445752c6798424201dd118eb80b2737884 100644 |
--- a/content/browser/download/download_item_impl_delegate.h |
+++ b/content/browser/download/download_item_impl_delegate.h |
@@ -8,6 +8,8 @@ |
#include "base/callback.h" |
#include "base/file_path.h" |
#include "content/common/content_export.h" |
+#include "content/public/browser/download_danger_type.h" |
+#include "content/public/browser/download_item.h" |
class DownloadFileManager; |
class DownloadItemImpl; |
@@ -22,6 +24,13 @@ class BrowserContext; |
// be left unimplemented. |
class CONTENT_EXPORT DownloadItemImplDelegate { |
public: |
+ typedef base::Callback<void( |
+ const FilePath&, // Target path |
+ content::DownloadItem::TargetDisposition, // overwrite/uniquify target |
+ content::DownloadDangerType, |
+ const FilePath& // Intermediate file path |
+ )> DownloadTargetCallback; |
+ |
DownloadItemImplDelegate(); |
virtual ~DownloadItemImplDelegate(); |
@@ -29,6 +38,10 @@ class CONTENT_EXPORT DownloadItemImplDelegate { |
void Attach(); |
void Detach(); |
+ // Request determination of the download target from the delegate. |
+ virtual void DetermineDownloadTarget( |
+ DownloadItemImpl* download, const DownloadTargetCallback& callback); |
+ |
// Allows the delegate to delay completion of the download. This function |
// will call the callback passed when the download is ready for completion. |
// This may be done immediately, from within the routine itself, or it |
@@ -38,13 +51,13 @@ class CONTENT_EXPORT DownloadItemImplDelegate { |
DownloadItemImpl* download, |
const base::Closure& complete_callback); |
- // Tests if a file type should be opened automatically. |
- virtual bool ShouldOpenFileBasedOnExtension(const FilePath& path); |
- |
// Allows the delegate to override the opening of a download. If it returns |
// true then it's reponsible for opening the item. |
virtual bool ShouldOpenDownload(DownloadItemImpl* download); |
+ // Tests if a file type should be opened automatically. |
+ virtual bool ShouldOpenFileBasedOnExtension(const FilePath& path); |
+ |
// Checks whether a downloaded file still exists and updates the |
// file's state if the file is already removed. |
// The check may or may not result in a later asynchronous call |