Index: chrome/browser/download/download_target_determiner.h |
diff --git a/chrome/browser/download/download_target_determiner.h b/chrome/browser/download/download_target_determiner.h |
index dcb0d1e4f0c9bde19d2aa9282d0fc6bad73fc0f8..7fd15d427bbb1a03aaadcde32190ed0aeca7d22e 100644 |
--- a/chrome/browser/download/download_target_determiner.h |
+++ b/chrome/browser/download/download_target_determiner.h |
@@ -52,6 +52,11 @@ class DownloadTargetDeterminer |
public: |
// Start the process of determing the target of |download|. |
// |
+ // |initial_virtual_path| if non-empty, defines the initial virtual path for |
+ // the target determination process. If one isn't specified, one will be |
+ // generated based on the response data specified in |download| and the |
+ // users' downloads directory. If the download has a forced path, then |
+ // initial_virtual_path must be empty or be the forced path. |
// |download_prefs| is required and must outlive |download|. It is used for |
// determining the user's preferences regarding the default downloads |
// directory, prompting and auto-open behavior. |
@@ -65,6 +70,7 @@ class DownloadTargetDeterminer |
// |
// Start() should be called on the UI thread. |
static void Start(content::DownloadItem* download, |
+ const base::FilePath& initial_virtual_path, |
DownloadPrefs* download_prefs, |
const base::FilePath& last_selected_directory, |
DownloadTargetDeterminerDelegate* delegate, |
@@ -119,6 +125,7 @@ class DownloadTargetDeterminer |
// are as per Start() above. |
DownloadTargetDeterminer( |
content::DownloadItem* download, |
+ const base::FilePath& initial_virtual_path, |
DownloadPrefs* download_prefs, |
const base::FilePath& last_selected_directory, |
DownloadTargetDeterminerDelegate* delegate, |
@@ -220,7 +227,13 @@ class DownloadTargetDeterminer |
Profile* GetProfile(); |
- bool ShouldPromptForDownload(const base::FilePath& filename); |
+ bool ShouldPromptForDownload(const base::FilePath& filename) const; |
+ |
+ // Returns true if the user has been prompted for this download at least once. |
+ // Can return true for resumed downloads that have prompted the user |
+ // previously even if no prompting happened during the current run of |
+ // DownloadTargetDeterminer. |
+ bool HasPromptedForPath() const; |
// Returns true if this download should show the "dangerous file" warning. |
// Various factors are considered, such as the type of the file, whether a |
@@ -242,9 +255,10 @@ class DownloadTargetDeterminer |
base::FilePath intermediate_path_; |
content::DownloadItem* download_; |
+ const bool is_resumption_; |
DownloadPrefs* download_prefs_; |
DownloadTargetDeterminerDelegate* delegate_; |
- base::FilePath last_selected_directory_; |
+ const base::FilePath last_selected_directory_; |
content::DownloadTargetCallback completion_callback_; |
CancelableRequestConsumer history_consumer_; |