diff --git a/atom/browser/api/atom_api_web_contents.cc b/atom/browser/api/atom_api_web_contents.cc index c4e96e42b4ab..535413717f2f 100644 --- a/atom/browser/api/atom_api_web_contents.cc +++ b/atom/browser/api/atom_api_web_contents.cc @@ -71,6 +71,7 @@ #include "content/browser/renderer_host/render_widget_host_view_base.h" #include "content/common/view_messages.h" #include "content/public/browser/child_process_security_policy.h" +#include "content/public/browser/download_request_utils.h" #include "content/public/browser/favicon_status.h" #include "content/public/browser/native_web_keyboard_event.h" #include "content/public/browser/navigation_details.h" @@ -1191,10 +1192,10 @@ void WebContents::DownloadURL(const GURL& url) { auto* browser_context = web_contents()->GetBrowserContext(); auto* download_manager = content::BrowserContext::GetDownloadManager(browser_context); - - download_manager->DownloadUrl( - download::DownloadUrlParameters::CreateForWebContentsMainFrame( + std::unique_ptr download_params( + content::DownloadRequestUtils::CreateDownloadForWebContentsMainFrame( web_contents(), url, NO_TRAFFIC_ANNOTATION_YET)); + download_manager->DownloadUrl(std::move(download_params)); } GURL WebContents::GetURL() const {