diff options
author | asanka@chromium.org <asanka@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-05-08 19:17:14 +0000 |
---|---|---|
committer | asanka@chromium.org <asanka@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-05-08 19:17:14 +0000 |
commit | 2f9045826f8a81e88f21fc235fa34905051f483d (patch) | |
tree | 472aacdd56f5b9477e2dde62139c8182514a1805 | |
parent | 1fa45d0021580083ff7f47c63fedf010c2d7253e (diff) | |
download | chromium_src-2f9045826f8a81e88f21fc235fa34905051f483d.zip chromium_src-2f9045826f8a81e88f21fc235fa34905051f483d.tar.gz chromium_src-2f9045826f8a81e88f21fc235fa34905051f483d.tar.bz2 |
[Mac] Deal with empty GetFullPath() in download status updater.
Previously downloads with empty GetFullPath() were ignored since those
were downloads that didn't have a target path yet. With downloads
resumption, if a download is interrupted and the intermediate file is
removed, DownloadItem::GetFullPath() will return an empty path.
BUG=7648
Review URL: https://chromiumcodereview.appspot.com/14874007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@198960 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/download/download_status_updater_mac.mm | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/chrome/browser/download/download_status_updater_mac.mm b/chrome/browser/download/download_status_updater_mac.mm index ff89e5eb..fbf010e 100644 --- a/chrome/browser/download/download_status_updater_mac.mm +++ b/chrome/browser/download/download_status_updater_mac.mm @@ -264,9 +264,6 @@ void DownloadStatusUpdater::UpdateAppIconDownloadProgress( bool progress_known = GetProgress(&progress, &download_count); UpdateAppIcon(download_count, progress_known, progress); - if (download->GetFullPath().empty()) - return; - // Update NSProgress-based indicators. if (NSProgressSupported()) { @@ -290,9 +287,10 @@ void DownloadStatusUpdater::UpdateAppIconDownloadProgress( } // Handle downloads that ended. - if (download->GetState() != content::DownloadItem::IN_PROGRESS) { + if (download->GetState() != content::DownloadItem::IN_PROGRESS && + !download->GetTargetFilePath().empty()) { NSString* download_path = - base::mac::FilePathToNSString(download->GetFullPath()); + base::mac::FilePathToNSString(download->GetTargetFilePath()); if (download->GetState() == content::DownloadItem::COMPLETE) { // Bounce the dock icon. [[NSDistributedNotificationCenter defaultCenter] |