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

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

Issue 10704052: Download filename determination refactor (3/3) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Use a callback with DetermineDownloadTarget(). Created 8 years, 5 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_manager_impl.h
diff --git a/content/browser/download/download_manager_impl.h b/content/browser/download/download_manager_impl.h
index dd54fc2b096f44232e8ddd5a5e75a98610408c3b..cf73943d2929e9572f6a0c276caf81c5a1b67a5a 100644
--- a/content/browser/download/download_manager_impl.h
+++ b/content/browser/download/download_manager_impl.h
@@ -76,7 +76,6 @@ class CONTENT_EXPORT DownloadManagerImpl
int64 db_handle) OVERRIDE;
virtual int InProgressCount() const OVERRIDE;
virtual content::BrowserContext* GetBrowserContext() const OVERRIDE;
- virtual FilePath LastDownloadPath() OVERRIDE;
virtual net::BoundNetLog CreateDownloadItem(
DownloadCreateInfo* info) OVERRIDE;
virtual content::DownloadItem* CreateSavePackageDownloadItem(
@@ -85,10 +84,7 @@ class CONTENT_EXPORT DownloadManagerImpl
bool is_otr,
const std::string& mime_type,
content::DownloadItem::Observer* observer) OVERRIDE;
- virtual void ClearLastDownloadPath() OVERRIDE;
- virtual void FileSelected(const FilePath& path, int32 download_id) OVERRIDE;
- virtual void FileSelectionCanceled(int32 download_id) OVERRIDE;
- virtual void RestartDownload(int32 download_id) OVERRIDE;
+ virtual void ClearTransientState() OVERRIDE;
virtual void CheckForHistoryFilesRemoval() OVERRIDE;
virtual content::DownloadItem* GetDownloadItem(int id) OVERRIDE;
virtual content::DownloadItem* GetDownload(int id) OVERRIDE;
@@ -99,6 +95,7 @@ class CONTENT_EXPORT DownloadManagerImpl
// Overridden from DownloadItemImpl::Delegate
// (Note that |GetBrowserContext| are present in both interfaces.)
+ virtual DownloadFileManager* GetDownloadFileManager() OVERRIDE;
virtual bool ShouldOpenDownload(content::DownloadItem* item) OVERRIDE;
virtual bool ShouldOpenFileBasedOnExtension(
const FilePath& path) OVERRIDE;
@@ -154,11 +151,6 @@ class CONTENT_EXPORT DownloadManagerImpl
// and then notifies this update to the file's observer.
void OnFileRemovalDetected(int32 download_id);
- // Called back after a target path for the file to be downloaded to has been
- // determined, either automatically based on the suggested file name, or by
- // the user in a Save As dialog box.
- void OnTargetPathAvailable(content::DownloadItem* download);
-
// Retrieves the download from the |download_id|.
// Returns NULL if the download is not active.
content::DownloadItem* GetActiveDownload(int32 download_id);
@@ -187,6 +179,13 @@ class CONTENT_EXPORT DownloadManagerImpl
void OnDownloadFileCreated(
int32 download_id, content::DownloadInterruptReason reason);
+ void OnDownloadTargetDetermined(
+ int32 download_id,
+ const FilePath& target_path,
+ content::DownloadItem::TargetDisposition disposition,
+ content::DownloadDangerType danger_type,
+ const FilePath& intermediate_path);
+
// Called when a download entry is committed to the persistent store.
void OnDownloadItemAddedToPersistentStore(int32 download_id, int64 db_handle);
@@ -241,10 +240,6 @@ class CONTENT_EXPORT DownloadManagerImpl
// Non-owning pointer for handling file writing on the download_thread_.
DownloadFileManager* file_manager_;
- // The user's last choice for download directory. This is only used when the
- // user wants us to prompt for a save location for each download.
- FilePath last_download_path_;
-
// Allows an embedder to control behavior. Guaranteed to outlive this object.
content::DownloadManagerDelegate* delegate_;

Powered by Google App Engine
This is Rietveld 408576698