diff options
author | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-01-05 22:36:56 +0000 |
---|---|---|
committer | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-01-05 22:36:56 +0000 |
commit | 970399b3aaa0a7d76dd1743654d8e1f7aed41cec (patch) | |
tree | a28d79a6023270c5c5c46c9d651e892f5d313fae /chrome/browser/download/download_file.h | |
parent | 749eea04dd5fd17761046e19c177735a8b9fa209 (diff) | |
download | chromium_src-970399b3aaa0a7d76dd1743654d8e1f7aed41cec.zip chromium_src-970399b3aaa0a7d76dd1743654d8e1f7aed41cec.tar.gz chromium_src-970399b3aaa0a7d76dd1743654d8e1f7aed41cec.tar.bz2 |
* switch download manager to using FilePath
* add empty() function to FilePath
* implement file_util::GetFileExtensionFromPath
Review URL: http://codereview.chromium.org/17032
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@7564 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/download/download_file.h')
-rw-r--r-- | chrome/browser/download/download_file.h | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/chrome/browser/download/download_file.h b/chrome/browser/download/download_file.h index cce6398..ea74318 100644 --- a/chrome/browser/download/download_file.h +++ b/chrome/browser/download/download_file.h @@ -53,6 +53,7 @@ #include "chrome/browser/history/download_types.h" class DownloadManager; +class FilePath; class GURL; class MessageLoop; class ResourceDispatcherHost; @@ -93,12 +94,12 @@ class DownloadFile { void Cancel(); // Rename the download file. Returns 'true' if the rename was successful. - bool Rename(const std::wstring& full_path); + bool Rename(const FilePath& full_path); // Accessors. int64 bytes_so_far() const { return bytes_so_far_; } int id() const { return id_; } - std::wstring full_path() const { return full_path_; } + FilePath full_path() const { return full_path_; } int render_process_id() const { return render_process_id_; } int render_view_id() const { return render_view_id_; } int request_id() const { return request_id_; } @@ -132,7 +133,7 @@ class DownloadFile { int64 bytes_so_far_; // Full path to the downloaded file. - std::wstring full_path_; + FilePath full_path_; // Whether the download is still using its initial temporary path. bool path_renamed_; @@ -192,26 +193,22 @@ class DownloadFileManager void RemoveDownload(int id, DownloadManager* manager); // Handler for shell operations sent from the UI to the download thread. - void OnShowDownloadInShell(const std::wstring full_path); + void OnShowDownloadInShell(const FilePath& full_path); // Handler to open or execute a downloaded file. - void OnOpenDownloadInShell(const std::wstring full_path, + void OnOpenDownloadInShell(const FilePath& full_path, const std::wstring& url, HWND parent_window); // The download manager has provided a final name for a download. Sent from // the UI thread and run on the download thread. - void OnFinalDownloadName(int id, const std::wstring& full_path); + void OnFinalDownloadName(int id, const FilePath& full_path); // Timer notifications. void UpdateInProgressDownloads(); MessageLoop* file_loop() const { return file_loop_; } - // Called by the download manager at initialization to ensure the default - // download directory exists. - void CreateDirectory(const std::wstring& directory); - - // Called by the donwload manager to delete non validated dangerous downloads. - void DeleteFile(const std::wstring& path); + // Called by the download manager to delete non validated dangerous downloads. + static void DeleteFile(const FilePath& path); private: // Timer helpers for updating the UI about the current progress of a download. |