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

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: Sync'd to LKGR (r162700) Created 8 years, 2 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 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
« no previous file with comments | « content/browser/download/download_item_impl.cc ('k') | content/browser/download/download_item_impl_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698