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

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

Issue 8414007: Rearrange Should*Download delegate calls to be more useful and intuitive. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merged to TOT. Created 9 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/public/browser/download_manager_delegate.h
diff --git a/content/public/browser/download_manager_delegate.h b/content/public/browser/download_manager_delegate.h
index fbc9bd3ea56b8ea659a8be5949f2cecb73a8e1bf..46d6d7880cdfebeb95bf6bbf3c1d3eef0618d4de 100644
--- a/content/public/browser/download_manager_delegate.h
+++ b/content/public/browser/download_manager_delegate.h
@@ -51,15 +51,22 @@ class DownloadManagerDelegate {
// Tests if a file type should be opened automatically.
virtual bool ShouldOpenFileBasedOnExtension(const FilePath& path) = 0;
- // 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(DownloadItem* item) = 0;
-
- // Allows the delegate to override completing the download. The delegate needs
- // to call DownloadItem::CompleteDelayedDownload when it's done with the item,
- // and is responsible for opening it.
+ // Allows the delegate to override completion of the download. If this
+ // function returns false, the download completion is delayed and the
+ // delegate is responsible for making sure that
+ // DownloadManager::MaybeCompleteDownload is called at some point in the
+ // future. Note that at that point this function will be called again,
+ // and is responsible for returning true when it really is ok for the
+ // download to complete.
virtual bool ShouldCompleteDownload(DownloadItem* item) = 0;
+ // Allows the delegate to override opening the download. If this function
+ // returns false, the delegate needs to call
+ // DownloadItem::DelayedDownloadOpened when it's done with the item,
+ // and is responsible for opening it. This function is called
+ // after the final rename, but before the download state is set to COMPLETED.
+ virtual bool ShouldOpenDownload(DownloadItem* item) = 0;
+
// Returns true if we need to generate a binary hash for downloads.
virtual bool GenerateFileHash() = 0;
« no previous file with comments | « content/browser/download/mock_download_manager_delegate.cc ('k') | content/shell/shell_download_manager_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698