diff options
author | asanka@chromium.org <asanka@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-12-21 01:07:25 +0000 |
---|---|---|
committer | asanka@chromium.org <asanka@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-12-21 01:07:25 +0000 |
commit | f02eccc2da58dcb4035cc4fbfa33a4c24f13b981 (patch) | |
tree | 99ffd5193677ac1b4c2e9c324d0f266a7ae86c2b | |
parent | 69657d364ace8c5c26017fee2c3f915cd31408a2 (diff) | |
download | chromium_src-f02eccc2da58dcb4035cc4fbfa33a4c24f13b981.zip chromium_src-f02eccc2da58dcb4035cc4fbfa33a4c24f13b981.tar.gz chromium_src-f02eccc2da58dcb4035cc4fbfa33a4c24f13b981.tar.bz2 |
[Mac] Avoid indicating progress for downloads past the final rename.
The progress indicator for downloads on the Dock is sticky. Setting
it for the download past the final rename results in the file being
permanently stuck in the in-prgress state.
BUG=166683
Review URL: https://chromiumcodereview.appspot.com/11633049
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@174300 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/download/download_status_updater_mac.mm | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/chrome/browser/download/download_status_updater_mac.mm b/chrome/browser/download/download_status_updater_mac.mm index 0b84b2e..61d07fb 100644 --- a/chrome/browser/download/download_status_updater_mac.mm +++ b/chrome/browser/download/download_status_updater_mac.mm @@ -272,12 +272,21 @@ void DownloadStatusUpdater::UpdateAppIconDownloadProgress( if (NSProgressSupported()) { CrNSProgressUserData* progress_data = static_cast<CrNSProgressUserData*>( download->GetUserData(&kCrNSProgressUserDataKey)); - if (!progress_data) - CreateNSProgress(download); - else if (download->GetState() != content::DownloadItem::IN_PROGRESS) + + // Only show progress if the download is IN_PROGRESS and it hasn't been + // renamed to its final name. Setting the progress after the final rename + // results in the file being stuck in an in-progress state on the dock. See + // http://crbug.com/166683. + if (download->GetState() == content::DownloadItem::IN_PROGRESS && + !download->GetFullPath().empty() && + download->GetFullPath() != download->GetTargetFilePath()) { + if (!progress_data) + CreateNSProgress(download); + else + UpdateNSProgress(download, progress_data); + } else { DestroyNSProgress(download, progress_data); - else - UpdateNSProgress(download, progress_data); + } } // Handle downloads that ended. |