New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 624912 link

Starred by 4 users

Issue metadata

Status: Fixed
Owner:
Closed: Aug 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 1
Type: Bug



Sign in to add a comment

Chrome on Android displays download overwrite infobar for all download target errors

Project Member Reported by asanka@chromium.org, Jun 30 2016

Issue description

When DownloadTargetDeterminer runs into problem with the download target (e.g. it can't write to the suggested downloads directory, or it can't uniquify the target filename or the filename is too long etc...)

On Android all these errors result in the user being shown the file overwrite infobar. This is due to the logic in ChromeDownloadManagerDelegate introduced in https://codereview.chromium.org/580043002:

void ChromeDownloadManagerDelegate::PromptUserForDownloadPath(
    DownloadItem* download,
    const base::FilePath& suggested_path,
    const DownloadTargetDeterminerDelegate::FileSelectedCallback& callback) {
  DCHECK_CURRENTLY_ON(BrowserThread::UI);
#if BUILDFLAG(ANDROID_JAVA_UI)
  chrome::android::ChromeDownloadManagerOverwriteInfoBarDelegate::Create(
      InfoBarService::FromWebContents(download->GetWebContents()),
      suggested_path, callback);
#else
  DownloadFilePicker::ShowFilePicker(download, suggested_path, callback);
#endif
}


 
Project Member

Comment 1 by bugdroid1@chromium.org, Jul 15 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/7cf649da41128daf23ce3f631fe19f89b8da6a76

commit 7cf649da41128daf23ce3f631fe19f89b8da6a76
Author: qinmin <qinmin@chromium.org>
Date: Fri Jul 15 19:56:39 2016

Show download error message if sdcard is not available

Currently when downloading a file without sdcard, Chrome shows the overwrite
infobar.
And if user acks that infobar, the file will be downloaded to Chrome's own
dir.
And the downloaded file cannot be opened by other apps, making it
useless.
This CL fixes that behavior by showing a "missing sdcard" message
when sdcard is not available.
Chrome will no longer try to generate a path under its own dir if sdcard
is not available.
If snackbar is available, the error message will be displayed on
snackbar.
Otherwise, a toast will be shown.

BUG= 624912 

Review-Url: https://codereview.chromium.org/2117343007
Cr-Commit-Position: refs/heads/master@{#405833}

[modify] https://crrev.com/7cf649da41128daf23ce3f631fe19f89b8da6a76/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadManagerService.java
[modify] https://crrev.com/7cf649da41128daf23ce3f631fe19f89b8da6a76/chrome/browser/android/download/download_controller.h
[modify] https://crrev.com/7cf649da41128daf23ce3f631fe19f89b8da6a76/chrome/browser/android/download/download_manager_service.cc
[modify] https://crrev.com/7cf649da41128daf23ce3f631fe19f89b8da6a76/chrome/browser/android/download/download_manager_service.h
[modify] https://crrev.com/7cf649da41128daf23ce3f631fe19f89b8da6a76/chrome/browser/download/download_path_reservation_tracker.cc
[modify] https://crrev.com/7cf649da41128daf23ce3f631fe19f89b8da6a76/chrome/browser/download/download_path_reservation_tracker_unittest.cc
[modify] https://crrev.com/7cf649da41128daf23ce3f631fe19f89b8da6a76/chrome/browser/download/download_target_determiner.cc
[modify] https://crrev.com/7cf649da41128daf23ce3f631fe19f89b8da6a76/tools/metrics/histograms/histograms.xml

Status: Fixed (was: Assigned)

Sign in to add a comment