| Index: chrome/browser/download/download_file.cc
|
| diff --git a/chrome/browser/download/download_file.cc b/chrome/browser/download/download_file.cc
|
| index 81d80b4c89cab028d419c3c9b1c48964b63f82e4..837d37eca445776355a6105f803100641e9e0bbd 100644
|
| --- a/chrome/browser/download/download_file.cc
|
| +++ b/chrome/browser/download/download_file.cc
|
| @@ -62,11 +62,11 @@ void DownloadFile::Cancel() {
|
| }
|
|
|
| // The UI has provided us with our finalized name.
|
| -bool DownloadFile::Rename(const FilePath& new_path) {
|
| +bool DownloadFile::Rename(const FilePath& new_path, bool is_final_rename) {
|
| // If the new path is same as the old one, there is no need to perform the
|
| // following renaming logic.
|
| if (new_path == full_path_) {
|
| - path_renamed_ = true;
|
| + path_renamed_ = is_final_rename;
|
|
|
| // Don't close the file if we're not done (finished or canceled).
|
| if (!in_progress_)
|
| @@ -77,6 +77,8 @@ bool DownloadFile::Rename(const FilePath& new_path) {
|
|
|
| Close();
|
|
|
| + file_util::CreateDirectory(new_path.DirName());
|
| +
|
| #if defined(OS_WIN)
|
| // We cannot rename because rename will keep the same security descriptor
|
| // on the destination file. We want to recreate the security descriptor
|
| @@ -106,7 +108,7 @@ bool DownloadFile::Rename(const FilePath& new_path) {
|
| #endif
|
|
|
| full_path_ = new_path;
|
| - path_renamed_ = true;
|
| + path_renamed_ = is_final_rename;
|
|
|
| // We don't need to re-open the file if we're done (finished or canceled).
|
| if (!in_progress_)
|
| @@ -122,6 +124,11 @@ bool DownloadFile::Rename(const FilePath& new_path) {
|
| return true;
|
| }
|
|
|
| +void DownloadFile::DeleteCrDownload() {
|
| + FilePath crdownload = download_util::GetCrDownloadPath(full_path_);
|
| + file_util::Delete(crdownload, false);
|
| +}
|
| +
|
| void DownloadFile::Close() {
|
| if (file_stream_.get()) {
|
| #if defined(OS_CHROMEOS)
|
|
|