| Index: chrome/browser/loader/chrome_resource_dispatcher_host_delegate.cc
|
| diff --git a/chrome/browser/loader/chrome_resource_dispatcher_host_delegate.cc b/chrome/browser/loader/chrome_resource_dispatcher_host_delegate.cc
|
| index 0ddcbdb3c45b0666edd2a90a5135fac4c72cf7b5..ecc07c0b3e8ccbf793657a32b8fcb8e336906570 100644
|
| --- a/chrome/browser/loader/chrome_resource_dispatcher_host_delegate.cc
|
| +++ b/chrome/browser/loader/chrome_resource_dispatcher_host_delegate.cc
|
| @@ -562,14 +562,21 @@ void ChromeResourceDispatcherHostDelegate::DownloadStarting(
|
| content::RESOURCE_TYPE_MAIN_FRAME,
|
| throttles);
|
| #if defined(OS_ANDROID)
|
| - throttles->push_back(
|
| - base::MakeUnique<InterceptDownloadResourceThrottle>(
|
| - request, info->GetWebContentsGetterForRequest()));
|
| // On Android, forward text/html downloads to OfflinePages backend.
|
| throttles->push_back(
|
| base::MakeUnique<offline_pages::downloads::ResourceThrottle>(request));
|
| #endif
|
| }
|
| +
|
| +#if defined(OS_ANDROID)
|
| + // Add the InterceptDownloadResourceThrottle after calling
|
| + // AppendStandardResourceThrottles so the download will not bypass
|
| + // safebrowsing checks.
|
| + if (is_content_initiated) {
|
| + throttles->push_back(base::MakeUnique<InterceptDownloadResourceThrottle>(
|
| + request, info->GetWebContentsGetterForRequest()));
|
| + }
|
| +#endif
|
| }
|
|
|
| ResourceDispatcherHostLoginDelegate*
|
|
|