OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "chrome/browser/ui/blocked_content/blocked_window_params.h" | 5 #include "chrome/browser/ui/blocked_content/blocked_window_params.h" |
6 | 6 |
7 #include "chrome/browser/profiles/profile.h" | 7 #include "chrome/browser/profiles/profile.h" |
8 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 8 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
9 #include "content/public/browser/render_process_host.h" | 9 #include "content/public/browser/render_process_host.h" |
10 #include "content/public/browser/web_contents.h" | 10 #include "content/public/browser/web_contents.h" |
11 #include "third_party/WebKit/public/web/WebWindowFeatures.h" | 11 #include "third_party/WebKit/public/web/WebWindowFeatures.h" |
12 #include "url/gurl.h" | 12 #include "url/gurl.h" |
13 | 13 |
14 BlockedWindowParams::BlockedWindowParams( | 14 BlockedWindowParams::BlockedWindowParams( |
15 const GURL& target_url, | 15 const GURL& target_url, |
16 const content::Referrer& referrer, | 16 const content::Referrer& referrer, |
17 WindowOpenDisposition disposition, | 17 WindowOpenDisposition disposition, |
18 const blink::WebWindowFeatures& features, | 18 const blink::WebWindowFeatures& features, |
19 bool user_gesture, | 19 bool user_gesture, |
20 bool opener_suppressed, | 20 bool opener_suppressed, |
21 int render_process_id, | 21 int render_process_id, |
22 int opener_id) | 22 int opener_render_frame_id) |
23 : target_url_(target_url), | 23 : target_url_(target_url), |
24 referrer_(referrer), | 24 referrer_(referrer), |
25 disposition_(disposition), | 25 disposition_(disposition), |
26 features_(features), | 26 features_(features), |
27 user_gesture_(user_gesture), | 27 user_gesture_(user_gesture), |
28 opener_suppressed_(opener_suppressed), | 28 opener_suppressed_(opener_suppressed), |
29 render_process_id_(render_process_id), | 29 render_process_id_(render_process_id), |
30 opener_id_(opener_id) { | 30 opener_render_frame_id_(opener_render_frame_id) { |
31 } | 31 } |
32 | 32 |
33 chrome::NavigateParams BlockedWindowParams::CreateNavigateParams( | 33 chrome::NavigateParams BlockedWindowParams::CreateNavigateParams( |
34 content::WebContents* web_contents) const { | 34 content::WebContents* web_contents) const { |
35 GURL popup_url(target_url_); | 35 GURL popup_url(target_url_); |
36 web_contents->GetRenderProcessHost()->FilterURL(false, &popup_url); | 36 web_contents->GetRenderProcessHost()->FilterURL(false, &popup_url); |
37 chrome::NavigateParams nav_params( | 37 chrome::NavigateParams nav_params( |
38 Profile::FromBrowserContext(web_contents->GetBrowserContext()), | 38 Profile::FromBrowserContext(web_contents->GetBrowserContext()), |
39 popup_url, | 39 popup_url, |
40 ui::PAGE_TRANSITION_LINK); | 40 ui::PAGE_TRANSITION_LINK); |
(...skipping 11 matching lines...) Expand all Loading... |
52 nav_params.window_bounds.set_y(features_.y); | 52 nav_params.window_bounds.set_y(features_.y); |
53 if (features_.widthSet) | 53 if (features_.widthSet) |
54 nav_params.window_bounds.set_width(features_.width); | 54 nav_params.window_bounds.set_width(features_.width); |
55 if (features_.heightSet) | 55 if (features_.heightSet) |
56 nav_params.window_bounds.set_height(features_.height); | 56 nav_params.window_bounds.set_height(features_.height); |
57 | 57 |
58 nav_params.disposition = disposition_; | 58 nav_params.disposition = disposition_; |
59 | 59 |
60 return nav_params; | 60 return nav_params; |
61 } | 61 } |
OLD | NEW |