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/browser_navigator_params.h" | 8 #include "chrome/browser/ui/browser_navigator_params.h" |
9 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 9 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
10 #include "content/public/browser/render_process_host.h" | 10 #include "content/public/browser/render_process_host.h" |
11 #include "content/public/browser/web_contents.h" | 11 #include "content/public/browser/web_contents.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 const std::string& frame_name, | 17 const std::string& frame_name, |
18 WindowOpenDisposition disposition, | 18 WindowOpenDisposition disposition, |
19 const blink::mojom::WindowFeatures& features, | 19 const blink::mojom::WindowFeatures& features, |
20 bool user_gesture, | 20 bool user_gesture, |
21 bool opener_suppressed, | 21 bool opener_suppressed) |
22 int render_process_id, | |
23 int opener_render_frame_id) | |
24 : target_url_(target_url), | 22 : target_url_(target_url), |
25 referrer_(referrer), | 23 referrer_(referrer), |
26 frame_name_(frame_name), | 24 frame_name_(frame_name), |
27 disposition_(disposition), | 25 disposition_(disposition), |
28 features_(features), | 26 features_(features), |
29 user_gesture_(user_gesture), | 27 user_gesture_(user_gesture), |
30 opener_suppressed_(opener_suppressed), | 28 opener_suppressed_(opener_suppressed) {} |
31 render_process_id_(render_process_id), | |
32 opener_render_frame_id_(opener_render_frame_id) {} | |
33 | 29 |
34 BlockedWindowParams::BlockedWindowParams(const BlockedWindowParams& other) = | 30 BlockedWindowParams::BlockedWindowParams(const BlockedWindowParams& other) = |
35 default; | 31 default; |
36 | 32 |
37 BlockedWindowParams::~BlockedWindowParams() = default; | 33 BlockedWindowParams::~BlockedWindowParams() = default; |
38 | 34 |
39 chrome::NavigateParams BlockedWindowParams::CreateNavigateParams( | 35 chrome::NavigateParams BlockedWindowParams::CreateNavigateParams( |
40 content::WebContents* web_contents) const { | 36 content::WebContents* web_contents) const { |
41 GURL popup_url(target_url_); | 37 GURL popup_url(target_url_); |
42 web_contents->GetRenderProcessHost()->FilterURL(false, &popup_url); | 38 web_contents->GetRenderProcessHost()->FilterURL(false, &popup_url); |
(...skipping 16 matching lines...) Expand all Loading... |
59 nav_params.window_bounds.set_y(features_.y); | 55 nav_params.window_bounds.set_y(features_.y); |
60 if (features_.has_width) | 56 if (features_.has_width) |
61 nav_params.window_bounds.set_width(features_.width); | 57 nav_params.window_bounds.set_width(features_.width); |
62 if (features_.has_height) | 58 if (features_.has_height) |
63 nav_params.window_bounds.set_height(features_.height); | 59 nav_params.window_bounds.set_height(features_.height); |
64 | 60 |
65 nav_params.disposition = disposition_; | 61 nav_params.disposition = disposition_; |
66 | 62 |
67 return nav_params; | 63 return nav_params; |
68 } | 64 } |
OLD | NEW |