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

Unified Diff: content/browser/download/download_item_impl_delegate.h

Issue 10912173: Replace the DownloadFileManager with direct ownership of DownloadFileImpl (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Incorporated comments and sync'd to r158560 Created 8 years, 3 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
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 00924542af695f38979e9cc883a9ed51519d9130..065c46b8165b685431b522de9f1a42d9371edcc9 100644
--- a/content/browser/download/download_item_impl_delegate.h
+++ b/content/browser/download/download_item_impl_delegate.h
@@ -5,8 +5,11 @@
#ifndef CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_IMPL_DELEGATE_H_
#define CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_IMPL_DELEGATE_H_
+#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;
@@ -21,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();
@@ -28,13 +38,17 @@ class CONTENT_EXPORT DownloadItemImplDelegate {
void Attach();
void Detach();
- // Tests if a file type should be opened automatically.
- virtual bool ShouldOpenFileBasedOnExtension(const FilePath& path);
+ // Request determination of the download target from the delegate.
+ virtual void DetermineDownloadTarget(
+ DownloadItemImpl* download, DownloadTargetCallback callback);
// 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

Powered by Google App Engine
This is Rietveld 408576698