Chromium Code Reviews| Index: chrome/browser/download/download_manager.h |
| diff --git a/chrome/browser/download/download_manager.h b/chrome/browser/download/download_manager.h |
| index 5cc4e0e3d033b420e6b36fed00e469bceb03d615..b08540107d8a060348cdbc1075cf9696f5d77f78 100644 |
| --- a/chrome/browser/download/download_manager.h |
| +++ b/chrome/browser/download/download_manager.h |
| @@ -41,6 +41,7 @@ |
| #include "base/observer_list.h" |
| #include "base/scoped_ptr.h" |
| #include "base/time.h" |
| +#include "chrome/browser/download/download_item.h" |
| #include "chrome/browser/download/download_status_updater_delegate.h" |
| #include "chrome/browser/download/download_process_handle.h" |
| #include "chrome/browser/ui/shell_dialogs.h" |
| @@ -48,7 +49,6 @@ |
| class DownloadFileManager; |
| class DownloadHistory; |
| -class DownloadItem; |
| class DownloadPrefs; |
| class DownloadStatusUpdater; |
| class GURL; |
| @@ -56,6 +56,7 @@ class Profile; |
| class ResourceDispatcherHost; |
| class TabContents; |
| struct DownloadCreateInfo; |
| +struct DownloadHistoryInfo; |
| struct DownloadSaveInfo; |
| // Browser's download manager: manages all downloads and destination view. |
| @@ -114,7 +115,7 @@ class DownloadManager |
| bool Init(Profile* profile); |
| // Notifications sent from the download thread to the UI thread |
| - void StartDownload(DownloadCreateInfo* info); |
| + void StartDownload(int32 id); |
| void UpdateDownload(int32 download_id, int64 size); |
| // |hash| is sha256 hash for the downloaded file. It is empty when the hash |
| // is not available. |
| @@ -190,13 +191,11 @@ class DownloadManager |
| // Methods called on completion of a query sent to the history system. |
| void OnQueryDownloadEntriesComplete( |
| - std::vector<DownloadCreateInfo>* entries); |
| - void OnCreateDownloadEntryComplete( |
| - DownloadCreateInfo info, int64 db_handle); |
| + std::vector<DownloadHistoryInfo>* entries); |
| + void OnCreateDownloadEntryComplete(int32 download_id, int64 db_handle); |
| // Display a new download in the appropriate browser UI. |
| - void ShowDownloadInBrowser(DownloadProcessHandle* process_handle, |
| - DownloadItem* download); |
| + void ShowDownloadInBrowser(DownloadItem* download); |
| // The number of in progress (including paused) downloads. |
| int in_progress_count() const { |
| @@ -232,7 +231,7 @@ class DownloadManager |
| void DangerousDownloadValidated(DownloadItem* download); |
| // Callback function after url is checked with safebrowsing service. |
| - void CheckDownloadUrlDone(DownloadCreateInfo* info, bool is_dangerous_url); |
| + void CheckDownloadUrlDone(int32 download_id, bool is_dangerous_url); |
| // Callback function after download file hash is checked with safebrowsing |
| // service. |
| @@ -273,17 +272,19 @@ class DownloadManager |
| // Called on the download thread to check whether the suggested file path |
| // exists. We don't check if the file exists on the UI thread to avoid UI |
| // stalls from interacting with the file system. |
| - void CheckIfSuggestedPathExists(DownloadCreateInfo* info, |
| + void CheckIfSuggestedPathExists(int32 download_id, |
| + DownloadItem::DownloadStateInfo state, |
| const FilePath& default_path); |
| // Called on the UI thread once the DownloadManager has determined whether the |
| // suggested file path exists. |
| - void OnPathExistenceAvailable(DownloadCreateInfo* info); |
| + void OnPathExistenceAvailable(int32 download_id, |
| + DownloadItem::DownloadStateInfo new_state); |
| // 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 AttachDownloadItem(DownloadCreateInfo* info); |
| + void ContinueDownloadWithPath(int32 download_id, const FilePath& chosen_file); |
| // Download cancel helper function. |
| // |process_handle| is passed by value because it is ultimately passed to |
| @@ -314,6 +315,7 @@ class DownloadManager |
| void NotifyModelChanged(); |
| DownloadItem* GetDownloadItem(int id); |
| + DownloadItem* GetActiveDownloadItem(int id); |
|
Paweł Hajdan Jr.
2011/05/19 16:18:25
It is definitely worth to document what's the diff
ahendrickson
2011/05/19 20:16:49
Done.
|
| // Debugging routine to confirm relationship between below |
| // containers; no-op if NDEBUG. |