Commit 17f876a0 authored by Xing Liu's avatar Xing Liu Committed by Commit Bot

Dowload location: show duplicate infobar when disable location dialog.

When user disabled the download location dialog, we need to show the
duplicate infobar.

Bug: 849876
Change-Id: I2efad87e670291dd453b12fa157ea10e7cb77011
Reviewed-on: https://chromium-review.googlesource.com/1088236Reviewed-by: default avatarDavid Trainor <dtrainor@chromium.org>
Commit-Queue: Xing Liu <xingliu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#565110}
parent 81fd1e57
...@@ -855,6 +855,14 @@ void ChromeDownloadManagerDelegate::RequestConfirmation( ...@@ -855,6 +855,14 @@ void ChromeDownloadManagerDelegate::RequestConfirmation(
callback.Run(DownloadConfirmationResult::CANCELED, base::FilePath()); callback.Run(DownloadConfirmationResult::CANCELED, base::FilePath());
return; return;
} }
if (!download_prefs_->PromptForDownload() && web_contents) {
android::ChromeDuplicateDownloadInfoBarDelegate::Create(
InfoBarService::FromWebContents(web_contents), download,
suggested_path, callback);
return;
}
gfx::NativeWindow native_window = web_contents->GetTopLevelNativeWindow(); gfx::NativeWindow native_window = web_contents->GetTopLevelNativeWindow();
DownloadPathReservationTracker::GetReservedPath( DownloadPathReservationTracker::GetReservedPath(
download, suggested_path, download_dir, true, download, suggested_path, download_dir, true,
...@@ -957,7 +965,7 @@ void ChromeDownloadManagerDelegate::GenerateUniqueFileNameDone( ...@@ -957,7 +965,7 @@ void ChromeDownloadManagerDelegate::GenerateUniqueFileNameDone(
// with the filename automatically set to be the unique filename. // with the filename automatically set to be the unique filename.
DCHECK_CURRENTLY_ON(content::BrowserThread::UI); DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
if (result == PathValidationResult::SUCCESS) { if (result == PathValidationResult::SUCCESS) {
if (download_prefs_ && download_prefs_->PromptForDownload()) { if (download_prefs_->PromptForDownload()) {
ChooseDownloadLocation( ChooseDownloadLocation(
native_window, DownloadLocationDialogType::NAME_CONFLICT, target_path, native_window, DownloadLocationDialogType::NAME_CONFLICT, target_path,
base::BindOnce(&OnDownloadLocationDetermined, callback)); base::BindOnce(&OnDownloadLocationDetermined, callback));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment