summaryrefslogtreecommitdiff
path: root/content/browser/download/download_item_impl_delegate.h
diff options
context:
space:
mode:
authorTorne (Richard Coles) <torne@google.com>2013-03-28 15:31:22 +0000
committerTorne (Richard Coles) <torne@google.com>2013-03-28 15:31:22 +0000
commit2a99a7e74a7f215066514fe81d2bfa6639d9eddd (patch)
tree7c2d04841fcd599fd83b0f0bb1100e1c89a35bae /content/browser/download/download_item_impl_delegate.h
parent61c449bbbb53310a8c041d8cefdd6b01a126cc7e (diff)
downloadchromium_org-2a99a7e74a7f215066514fe81d2bfa6639d9eddd.tar.gz
Merge from Chromium at DEPS revision r190564
This commit was generated by merge_to_master.py. Change-Id: Icadecbce29854b8fa25fd335b2c1949b5ca5d170
Diffstat (limited to 'content/browser/download/download_item_impl_delegate.h')
-rw-r--r--content/browser/download/download_item_impl_delegate.h35
1 files changed, 20 insertions, 15 deletions
diff --git a/content/browser/download/download_item_impl_delegate.h b/content/browser/download/download_item_impl_delegate.h
index 323aa6b453..c0bec3e4c9 100644
--- a/content/browser/download/download_item_impl_delegate.h
+++ b/content/browser/download/download_item_impl_delegate.h
@@ -6,10 +6,11 @@
#define CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_IMPL_DELEGATE_H_
#include "base/callback.h"
-#include "base/file_path.h"
+#include "base/files/file_path.h"
#include "content/common/content_export.h"
#include "content/public/browser/download_danger_type.h"
#include "content/public/browser/download_item.h"
+#include "content/public/browser/download_url_parameters.h"
namespace content {
class DownloadItemImpl;
@@ -22,10 +23,10 @@ class BrowserContext;
class CONTENT_EXPORT DownloadItemImplDelegate {
public:
typedef base::Callback<void(
- const FilePath&, // Target path
+ const base::FilePath&, // Target path
DownloadItem::TargetDisposition, // overwrite/uniquify target
DownloadDangerType,
- const FilePath& // Intermediate file path
+ const base::FilePath& // Intermediate file path
)> DownloadTargetCallback;
// The boolean argument indicates whether or not the download was
@@ -44,11 +45,10 @@ class CONTENT_EXPORT DownloadItemImplDelegate {
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
- // may be delayed.
- // This routine should only be called once per download.
- virtual void ReadyForDownloadCompletion(
+ // will either return true (if the download may complete now) or will return
+ // false and call the provided callback at some future point. This function
+ // may be called repeatedly.
+ virtual bool ShouldCompleteDownload(
DownloadItemImpl* download,
const base::Closure& complete_callback);
@@ -58,7 +58,7 @@ class CONTENT_EXPORT DownloadItemImplDelegate {
DownloadItemImpl* download, const ShouldOpenDownloadCallback& callback);
// Tests if a file type should be opened automatically.
- virtual bool ShouldOpenFileBasedOnExtension(const FilePath& path);
+ virtual bool ShouldOpenFileBasedOnExtension(const base::FilePath& path);
// Checks whether a downloaded file still exists and updates the
// file's state if the file is already removed.
@@ -66,21 +66,26 @@ class CONTENT_EXPORT DownloadItemImplDelegate {
// to OnDownloadedFileRemoved().
virtual void CheckForFileRemoval(DownloadItemImpl* download_item);
+ // Called when an interrupted download is resumed.
+ virtual void ResumeInterruptedDownload(
+ scoped_ptr<content::DownloadUrlParameters> params,
+ content::DownloadId id);
+
// For contextual issues like language and prefs.
virtual BrowserContext* GetBrowserContext() const;
// Update the persistent store with our information.
virtual void UpdatePersistence(DownloadItemImpl* download);
+ // Opens the file associated with this download.
+ virtual void OpenDownload(DownloadItemImpl* download);
+
+ // Shows the download via the OS shell.
+ virtual void ShowDownloadInShell(DownloadItemImpl* download);
+
// Handle any delegate portions of a state change operation on the
// DownloadItem.
- virtual void DownloadStopped(DownloadItemImpl* download);
- virtual void DownloadCompleted(DownloadItemImpl* download);
- virtual void DownloadOpened(DownloadItemImpl* download);
virtual void DownloadRemoved(DownloadItemImpl* download);
- virtual void DownloadRenamedToIntermediateName(
- DownloadItemImpl* download);
- virtual void DownloadRenamedToFinalName(DownloadItemImpl* download);
// Assert consistent state for delgate object at various transitions.
virtual void AssertStateConsistent(DownloadItemImpl* download) const;