diff options
author | kinuko@chromium.org <kinuko@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-09 04:01:36 +0000 |
---|---|---|
committer | kinuko@chromium.org <kinuko@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-09 04:01:36 +0000 |
commit | 290c970f0d8d0322c175cb9f6bef4e653a9862b1 (patch) | |
tree | b98e161fc521596f00b83407435df059e9001b24 /chrome/browser/download/download_file.cc | |
parent | 50515598543ee038584a9d6f19518842b480a911 (diff) | |
download | chromium_src-290c970f0d8d0322c175cb9f6bef4e653a9862b1.zip chromium_src-290c970f0d8d0322c175cb9f6bef4e653a9862b1.tar.gz chromium_src-290c970f0d8d0322c175cb9f6bef4e653a9862b1.tar.bz2 |
Start a download in the user's download directory to lower rename failure possibilities
BUG=8737
TEST=Check 'Ask where to save each file before downloading' true in the 'Under the Hood' preference and start a download. A temporary file org.chromium.XXXXXX or com.google.chrome.XXXXXX should appear in the user's download directory (e.g. ~/Downloads). After selecting the final destination file the temporary file should go away (and be renamed to the final name).
Review URL: http://codereview.chromium.org/672020
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@40996 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/download/download_file.cc')
-rw-r--r-- | chrome/browser/download/download_file.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/chrome/browser/download/download_file.cc b/chrome/browser/download/download_file.cc index 50af0f5..269d108 100644 --- a/chrome/browser/download/download_file.cc +++ b/chrome/browser/download/download_file.cc @@ -13,6 +13,7 @@ #include "build/build_config.h" #include "chrome/browser/chrome_thread.h" #include "chrome/browser/download/download_manager.h" +#include "chrome/browser/download/download_util.h" #include "chrome/browser/net/chrome_url_request_context.h" #include "chrome/browser/profile.h" #include "chrome/browser/renderer_host/resource_dispatcher_host.h" @@ -77,7 +78,8 @@ DownloadFile::~DownloadFile() { } bool DownloadFile::Initialize() { - if (!full_path_.empty() || file_util::CreateTemporaryFile(&full_path_)) + if (!full_path_.empty() || + download_util::CreateTemporaryFileForDownload(&full_path_)) return Open(); return false; } |