Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(710)

Unified Diff: chrome/browser/cocoa/download_item_controller.mm

Issue 3127008: Preliminary work on resuming downloads whose connections have expired.
Patch Set: Waiting to send download automation error message until after other downloads are canceled. Created 10 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/cocoa/download_item_controller.mm
diff --git a/chrome/browser/cocoa/download_item_controller.mm b/chrome/browser/cocoa/download_item_controller.mm
index e13fc74eaaf8cc523511969320b68b900486eb5b..3c96766282afee066ca525f68d0df3c6a6e1d7f3 100644
--- a/chrome/browser/cocoa/download_item_controller.mm
+++ b/chrome/browser/cocoa/download_item_controller.mm
@@ -322,10 +322,10 @@ class DownloadShelfContextMenuMac : public DownloadShelfContextMenu {
- (IBAction)discardDownload:(id)sender {
UMA_HISTOGRAM_LONG_TIMES("clickjacking.discard_download",
base::Time::Now() - creationTime_);
- if (bridge_->download_model()->download()->state() ==
- DownloadItem::IN_PROGRESS)
- bridge_->download_model()->download()->Cancel(true);
- bridge_->download_model()->download()->Remove(true);
+ DownloadItem* download = bridge_->download_model()->download();
+ if (download->IsPartialDownload())
+ download->Cancel(true);
+ download->Remove(true);
// WARNING: we are deleted at this point. Don't access 'this'.
}

Powered by Google App Engine
This is Rietveld 408576698