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

Unified Diff: content/browser/download/download_resource_handler.cc

Issue 2528483003: [Android Downloads] Long-press menu item "Download Link" should delegate job to OfflinePages backen… (Closed)
Patch Set: removed unnecessary #include Created 4 years, 1 month 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: content/browser/download/download_resource_handler.cc
diff --git a/content/browser/download/download_resource_handler.cc b/content/browser/download/download_resource_handler.cc
index a0acc44e3ba78627e536e8aec1d0d887d43fdae1..5dadcaa5e60ffe7f0eaba41721cbbe9593242ed9 100644
--- a/content/browser/download/download_resource_handler.cc
+++ b/content/browser/download/download_resource_handler.cc
@@ -196,8 +196,13 @@ void DownloadResourceHandler::OnStart(
const DownloadUrlParameters::OnStartedCallback& callback) {
// If the user cancels the download, then don't call start. Instead ignore the
// download entirely.
- if (create_info->result == DOWNLOAD_INTERRUPT_REASON_USER_CANCELED &&
- create_info->download_id == DownloadItem::kInvalidId) {
+ bool download_canceled =
+ create_info->result == DOWNLOAD_INTERRUPT_REASON_USER_CANCELED &&
+ create_info->download_id == DownloadItem::kInvalidId;
+ // Also don't start a download if it has to be handed off to OfflinePages.
+ download_canceled = download_canceled ||
+ create_info->result == DOWNLOAD_INTERRUPT_REASON_PAGE_DOWNLOAD_HANDOFF;
+ if (download_canceled) {
if (!callback.is_null())
BrowserThread::PostTask(
BrowserThread::UI, FROM_HERE,

Powered by Google App Engine
This is Rietveld 408576698