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" |
(...skipping 19 matching lines...) Expand all Loading... |
30 opener_id_(opener_id) { | 30 opener_id_(opener_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 content::PAGE_TRANSITION_LINK); | 40 ui::PAGE_TRANSITION_LINK); |
41 nav_params.referrer = referrer_; | 41 nav_params.referrer = referrer_; |
42 nav_params.source_contents = web_contents; | 42 nav_params.source_contents = web_contents; |
43 nav_params.is_renderer_initiated = true; | 43 nav_params.is_renderer_initiated = true; |
44 nav_params.tabstrip_add_types = TabStripModel::ADD_ACTIVE; | 44 nav_params.tabstrip_add_types = TabStripModel::ADD_ACTIVE; |
45 nav_params.window_action = chrome::NavigateParams::SHOW_WINDOW; | 45 nav_params.window_action = chrome::NavigateParams::SHOW_WINDOW; |
46 nav_params.user_gesture = user_gesture_; | 46 nav_params.user_gesture = user_gesture_; |
47 nav_params.should_set_opener = !opener_suppressed_; | 47 nav_params.should_set_opener = !opener_suppressed_; |
48 nav_params.window_bounds = web_contents->GetContainerBounds(); | 48 nav_params.window_bounds = web_contents->GetContainerBounds(); |
49 if (features_.xSet) | 49 if (features_.xSet) |
50 nav_params.window_bounds.set_x(features_.x); | 50 nav_params.window_bounds.set_x(features_.x); |
51 if (features_.ySet) | 51 if (features_.ySet) |
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 // Compare RenderViewImpl::show(). | 58 // Compare RenderViewImpl::show(). |
59 if (!user_gesture_ && disposition_ != NEW_BACKGROUND_TAB) | 59 if (!user_gesture_ && disposition_ != NEW_BACKGROUND_TAB) |
60 nav_params.disposition = NEW_POPUP; | 60 nav_params.disposition = NEW_POPUP; |
61 else | 61 else |
62 nav_params.disposition = disposition_; | 62 nav_params.disposition = disposition_; |
63 | 63 |
64 return nav_params; | 64 return nav_params; |
65 } | 65 } |
OLD | NEW |