[downloads] Allow download target determination to indicate an error.

Previously, the download target determination logic was only able to
indicate one of two outcomes:

  1. The embeddeer determined a valid target for the download.
  2. The user canceled the operation.

These two outcomes aren't sufficient to indicate the variety of error
conditions that the embedder might be able to detect. For example, the
embedder may choose to block the download instead of allowing it to
proceed or it may need be able to specify a more apt interrupt reason
than "canceled by user".

This change introduces the ability for the embedder to indicate a
specific download interrupt reason during download target determination.
This change is needed for followup changes that perform additional
checks during the download process.

[email protected]
BUG=334474

Change-Id: I141df838e581cd2358f99bbd95c2601bfeb8e491
Reviewed-on: https://chromium-review.googlesource.com/465526
Reviewed-by: John Abd-El-Malek <[email protected]>
Reviewed-by: David Trainor <[email protected]>
Commit-Queue: Asanka Herath <[email protected]>
Cr-Commit-Position: refs/heads/master@{#461779}
diff --git a/content/browser/download/download_manager_impl.cc b/content/browser/download/download_manager_impl.cc
index 4f1aa6a..ff64590 100644
--- a/content/browser/download/download_manager_impl.cc
+++ b/content/browser/download/download_manager_impl.cc
@@ -226,10 +226,9 @@
   if (!delegate_ || !delegate_->DetermineDownloadTarget(item, callback)) {
     base::FilePath target_path = item->GetForcedFilePath();
     // TODO(asanka): Determine a useful path if |target_path| is empty.
-    callback.Run(target_path,
-                 DownloadItem::TARGET_DISPOSITION_OVERWRITE,
-                 DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS,
-                 target_path);
+    callback.Run(target_path, DownloadItem::TARGET_DISPOSITION_OVERWRITE,
+                 DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS, target_path,
+                 DOWNLOAD_INTERRUPT_REASON_NONE);
   }
 }