| Index: chrome/browser/download/download_target_determiner.cc
|
| diff --git a/chrome/browser/download/download_target_determiner.cc b/chrome/browser/download/download_target_determiner.cc
|
| index fbc35cfeef8854132e5eca8142f25ca88397ccbe..9c10009263a51127cc0fbdac5a0de63cab5fd294 100644
|
| --- a/chrome/browser/download/download_target_determiner.cc
|
| +++ b/chrome/browser/download/download_target_determiner.cc
|
| @@ -191,16 +191,19 @@ DownloadTargetDeterminer::Result
|
| DCHECK(!should_prompt_);
|
| DCHECK(!should_notify_extensions_);
|
| DCHECK_EQ(DownloadPathReservationTracker::OVERWRITE, conflict_action_);
|
| - bool is_forced_path = !download_->GetForcedFilePath().empty();
|
| + // If the download already has a forced path or a target path, use it.
|
| + base::FilePath last_target_path = download_->GetForcedFilePath().empty() ?
|
| + download_->GetTargetFilePath() : download_->GetForcedFilePath();
|
|
|
| next_state_ = STATE_NOTIFY_EXTENSIONS;
|
|
|
| - if (!virtual_path_.empty() && HasPromptedForPath() && !is_forced_path) {
|
| + if (!virtual_path_.empty() && HasPromptedForPath() &&
|
| + last_target_path.empty()) {
|
| // The download is being resumed and the user has already been prompted for
|
| // a path. Assume that it's okay to overwrite the file if there's a conflict
|
| // and reuse the selection.
|
| should_prompt_ = ShouldPromptForDownload(virtual_path_);
|
| - } else if (!is_forced_path) {
|
| + } else if (last_target_path.empty()) {
|
| // If we don't have a forced path, we should construct a path for the
|
| // download. Forced paths are only specified for programmatic downloads
|
| // (WebStore, Drag&Drop). Treat the path as a virtual path. We will
|
| @@ -240,7 +243,7 @@ DownloadTargetDeterminer::Result
|
| #endif
|
| should_notify_extensions_ = true;
|
| } else {
|
| - virtual_path_ = download_->GetForcedFilePath();
|
| + virtual_path_ = last_target_path;
|
| // If this is a resumed download which was previously interrupted due to an
|
| // issue with the forced path, the user is still not prompted. If the path
|
| // supplied to a programmatic download is invalid, then the caller needs to
|
|
|