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

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

Issue 8697006: DownloadManager intereface refactoring to allow cleaner DownloadItem unit tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added CONTENT_EXPORT to delegate. Created 9 years 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.h
diff --git a/content/browser/download/download_item.h b/content/browser/download/download_item.h
index 21794cb8d086c0633e3b08c895564c7a4914c329..c51f35e22e2499d236f6f980219704aa881a18c9 100644
--- a/content/browser/download/download_item.h
+++ b/content/browser/download/download_item.h
@@ -24,8 +24,8 @@
#include "content/browser/download/download_state_info.h"
#include "content/browser/download/interrupt_reasons.h"
-class DownloadFileManager;
class DownloadId;
+class DownloadFileManager;
class DownloadManager;
class FilePath;
class GURL;
@@ -37,6 +37,10 @@ class Time;
class TimeDelta;
}
+namespace content {
+class BrowserContext;
+}
+
// One DownloadItem per download. This is the model class that stores all the
// state for a download. Multiple views, such as a tab's download shelf and the
// Destination tab's download view, may refer to a given DownloadItem.
@@ -153,6 +157,12 @@ class CONTENT_EXPORT DownloadItem {
// Called when the downloaded file is removed.
virtual void OnDownloadedFileRemoved() = 0;
+ // If all pre-requisites have been met, complete download processing, i.e.
+ // do internal cleanup, file rename, and potentially auto-open.
+ // (Dangerous downloads still may block on user acceptance after this
+ // point.)
+ virtual void MaybeCompleteDownload() = 0;
+
// Download operation had an error.
// |size| is the amount of data received at interruption.
// |reason| is the download interrupt reason code that the operation received.
@@ -248,7 +258,6 @@ class CONTENT_EXPORT DownloadItem {
virtual base::Time GetEndTime() const = 0;
virtual void SetDbHandle(int64 handle) = 0;
virtual int64 GetDbHandle() const = 0;
- virtual DownloadManager* GetDownloadManager() = 0;
virtual bool IsPaused() const = 0;
virtual bool GetOpenWhenComplete() const = 0;
virtual void SetOpenWhenComplete(bool open) = 0;
@@ -273,6 +282,7 @@ class CONTENT_EXPORT DownloadItem {
virtual InterruptReason GetLastReason() const = 0;
virtual DownloadPersistentStoreInfo GetPersistentStoreInfo() const = 0;
virtual DownloadStateInfo GetStateInfo() const = 0;
+ virtual content::BrowserContext* BrowserContext() const = 0;
virtual TabContents* GetTabContents() const = 0;
// Returns the final target file path for the download.
« no previous file with comments | « chrome/browser/download/download_shelf_context_menu.cc ('k') | content/browser/download/download_item_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698