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_process_host.h" | 10 #include "content/public/browser/render_process_host.h" |
11 #include "content/public/browser/render_view_host.h" | 11 #include "content/public/browser/render_view_host.h" |
12 #include "content/public/browser/resource_dispatcher_host.h" | 12 #include "content/public/browser/resource_dispatcher_host.h" |
| 13 #include "content/public/browser/storage_partition.h" |
13 #include "content/public/browser/web_contents.h" | 14 #include "content/public/browser/web_contents.h" |
14 #include "googleurl/src/gurl.h" | 15 #include "googleurl/src/gurl.h" |
15 | 16 |
16 namespace content { | 17 namespace content { |
17 | 18 |
18 DownloadUrlParameters::DownloadUrlParameters( | 19 DownloadUrlParameters::DownloadUrlParameters( |
19 const GURL& url, | 20 const GURL& url, |
20 int render_process_host_id, | 21 int render_process_host_id, |
21 int render_view_host_routing_id, | 22 int render_view_host_routing_id, |
22 ResourceContext* resource_context, | 23 ResourceContext* resource_context, |
(...skipping 17 matching lines...) Expand all Loading... |
40 | 41 |
41 // static | 42 // static |
42 DownloadUrlParameters* DownloadUrlParameters::FromWebContents( | 43 DownloadUrlParameters* DownloadUrlParameters::FromWebContents( |
43 WebContents* web_contents, | 44 WebContents* web_contents, |
44 const GURL& url, | 45 const GURL& url, |
45 const DownloadSaveInfo& save_info) { | 46 const DownloadSaveInfo& save_info) { |
46 return new DownloadUrlParameters( | 47 return new DownloadUrlParameters( |
47 url, | 48 url, |
48 web_contents->GetRenderProcessHost()->GetID(), | 49 web_contents->GetRenderProcessHost()->GetID(), |
49 web_contents->GetRenderViewHost()->GetRoutingID(), | 50 web_contents->GetRenderViewHost()->GetRoutingID(), |
50 web_contents->GetBrowserContext()->GetResourceContext(), | 51 content::BrowserContext::GetDefaultStoragePartition(web_contents->GetBrows
erContext())-> |
| 52 GetResourceContext(), |
51 save_info); | 53 save_info); |
52 } | 54 } |
53 | 55 |
54 } // namespace content | 56 } // namespace content |
OLD | NEW |