| 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 20 matching lines...) Expand all Loading... |
| 31 : content_initiated_(false), | 31 : content_initiated_(false), |
| 32 use_if_range_(true), | 32 use_if_range_(true), |
| 33 method_("GET"), | 33 method_("GET"), |
| 34 post_id_(-1), | 34 post_id_(-1), |
| 35 prefer_cache_(false), | 35 prefer_cache_(false), |
| 36 render_process_host_id_(render_process_host_id), | 36 render_process_host_id_(render_process_host_id), |
| 37 render_view_host_routing_id_(render_view_host_routing_id), | 37 render_view_host_routing_id_(render_view_host_routing_id), |
| 38 render_frame_host_routing_id_(render_frame_host_routing_id), | 38 render_frame_host_routing_id_(render_frame_host_routing_id), |
| 39 url_request_context_getter_(url_request_context_getter), | 39 url_request_context_getter_(url_request_context_getter), |
| 40 url_(url), | 40 url_(url), |
| 41 do_not_prompt_for_login_(false) {} | 41 do_not_prompt_for_login_(false), |
| 42 transient_(false) {} |
| 42 | 43 |
| 43 DownloadUrlParameters::~DownloadUrlParameters() { | 44 DownloadUrlParameters::~DownloadUrlParameters() { |
| 44 } | 45 } |
| 45 | 46 |
| 46 // static | 47 // static |
| 47 std::unique_ptr<DownloadUrlParameters> | 48 std::unique_ptr<DownloadUrlParameters> |
| 48 DownloadUrlParameters::CreateForWebContentsMainFrame( | 49 DownloadUrlParameters::CreateForWebContentsMainFrame( |
| 49 WebContents* web_contents, | 50 WebContents* web_contents, |
| 50 const GURL& url) { | 51 const GURL& url) { |
| 51 RenderFrameHost* render_frame_host = web_contents->GetMainFrame(); | 52 RenderFrameHost* render_frame_host = web_contents->GetMainFrame(); |
| 52 StoragePartition* storage_partition = BrowserContext::GetStoragePartition( | 53 StoragePartition* storage_partition = BrowserContext::GetStoragePartition( |
| 53 web_contents->GetBrowserContext(), render_frame_host->GetSiteInstance()); | 54 web_contents->GetBrowserContext(), render_frame_host->GetSiteInstance()); |
| 54 return std::unique_ptr<DownloadUrlParameters>(new DownloadUrlParameters( | 55 return std::unique_ptr<DownloadUrlParameters>(new DownloadUrlParameters( |
| 55 url, render_frame_host->GetProcess()->GetID(), | 56 url, render_frame_host->GetProcess()->GetID(), |
| 56 render_frame_host->GetRenderViewHost()->GetRoutingID(), | 57 render_frame_host->GetRenderViewHost()->GetRoutingID(), |
| 57 render_frame_host->GetRoutingID(), | 58 render_frame_host->GetRoutingID(), |
| 58 storage_partition->GetURLRequestContext())); | 59 storage_partition->GetURLRequestContext())); |
| 59 } | 60 } |
| 60 | 61 |
| 61 } // namespace content | 62 } // namespace content |
| OLD | NEW |