| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/public/browser/download_url_parameters.h" | 5 #include "content/public/browser/download_url_parameters.h" |
| 6 | 6 |
| 7 #include "base/callback.h" | 7 #include "base/callback.h" |
| 8 #include "content/public/browser/browser_context.h" | 8 #include "content/public/browser/browser_context.h" |
| 9 #include "content/public/browser/download_save_info.h" | 9 #include "content/public/browser/download_save_info.h" |
| 10 #include "content/public/browser/render_frame_host.h" | 10 #include "content/public/browser/render_frame_host.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 : DownloadUrlParameters(url, -1, -1, -1, url_request_context_getter) { | 22 : DownloadUrlParameters(url, -1, -1, -1, url_request_context_getter) { |
| 23 } | 23 } |
| 24 | 24 |
| 25 DownloadUrlParameters::DownloadUrlParameters( | 25 DownloadUrlParameters::DownloadUrlParameters( |
| 26 const GURL& url, | 26 const GURL& url, |
| 27 int render_process_host_id, | 27 int render_process_host_id, |
| 28 int render_view_host_routing_id, | 28 int render_view_host_routing_id, |
| 29 int render_frame_host_routing_id, | 29 int render_frame_host_routing_id, |
| 30 net::URLRequestContextGetter* url_request_context_getter) | 30 net::URLRequestContextGetter* url_request_context_getter) |
| 31 : content_initiated_(false), | 31 : content_initiated_(false), |
| 32 use_if_range_(true), |
| 32 method_("GET"), | 33 method_("GET"), |
| 33 post_id_(-1), | 34 post_id_(-1), |
| 34 prefer_cache_(false), | 35 prefer_cache_(false), |
| 35 render_process_host_id_(render_process_host_id), | 36 render_process_host_id_(render_process_host_id), |
| 36 render_view_host_routing_id_(render_view_host_routing_id), | 37 render_view_host_routing_id_(render_view_host_routing_id), |
| 37 render_frame_host_routing_id_(render_frame_host_routing_id), | 38 render_frame_host_routing_id_(render_frame_host_routing_id), |
| 38 url_request_context_getter_(url_request_context_getter), | 39 url_request_context_getter_(url_request_context_getter), |
| 39 url_(url), | 40 url_(url), |
| 40 do_not_prompt_for_login_(false) {} | 41 do_not_prompt_for_login_(false) {} |
| 41 | 42 |
| 42 DownloadUrlParameters::~DownloadUrlParameters() { | 43 DownloadUrlParameters::~DownloadUrlParameters() { |
| 43 } | 44 } |
| 44 | 45 |
| 45 // static | 46 // static |
| 46 std::unique_ptr<DownloadUrlParameters> | 47 std::unique_ptr<DownloadUrlParameters> |
| 47 DownloadUrlParameters::CreateForWebContentsMainFrame( | 48 DownloadUrlParameters::CreateForWebContentsMainFrame( |
| 48 WebContents* web_contents, | 49 WebContents* web_contents, |
| 49 const GURL& url) { | 50 const GURL& url) { |
| 50 RenderFrameHost* render_frame_host = web_contents->GetMainFrame(); | 51 RenderFrameHost* render_frame_host = web_contents->GetMainFrame(); |
| 51 StoragePartition* storage_partition = BrowserContext::GetStoragePartition( | 52 StoragePartition* storage_partition = BrowserContext::GetStoragePartition( |
| 52 web_contents->GetBrowserContext(), render_frame_host->GetSiteInstance()); | 53 web_contents->GetBrowserContext(), render_frame_host->GetSiteInstance()); |
| 53 return std::unique_ptr<DownloadUrlParameters>(new DownloadUrlParameters( | 54 return std::unique_ptr<DownloadUrlParameters>(new DownloadUrlParameters( |
| 54 url, render_frame_host->GetProcess()->GetID(), | 55 url, render_frame_host->GetProcess()->GetID(), |
| 55 render_frame_host->GetRenderViewHost()->GetRoutingID(), | 56 render_frame_host->GetRenderViewHost()->GetRoutingID(), |
| 56 render_frame_host->GetRoutingID(), | 57 render_frame_host->GetRoutingID(), |
| 57 storage_partition->GetURLRequestContext())); | 58 storage_partition->GetURLRequestContext())); |
| 58 } | 59 } |
| 59 | 60 |
| 60 } // namespace content | 61 } // namespace content |
| OLD | NEW |