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/browser/tab_contents/tab_contents_view_helper.h" | 5 #include "content/browser/tab_contents/tab_contents_view_helper.h" |
6 | 6 |
7 #include "content/browser/renderer_host/render_view_host.h" | 7 #include "content/browser/renderer_host/render_view_host.h" |
8 #include "content/browser/renderer_host/render_widget_host.h" | 8 #include "content/browser/renderer_host/render_widget_host.h" |
9 #include "content/browser/renderer_host/render_widget_host_view.h" | 9 #include "content/browser/renderer_host/render_widget_host_view.h" |
10 #include "content/browser/tab_contents/tab_contents.h" | 10 #include "content/browser/tab_contents/tab_contents.h" |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
58 return NULL; | 58 return NULL; |
59 | 59 |
60 // Create the new web contents. This will automatically create the new | 60 // Create the new web contents. This will automatically create the new |
61 // WebContentsView. In the future, we may want to create the view separately. | 61 // WebContentsView. In the future, we may want to create the view separately. |
62 TabContents* new_contents = | 62 TabContents* new_contents = |
63 new TabContents(web_contents->GetBrowserContext(), | 63 new TabContents(web_contents->GetBrowserContext(), |
64 web_contents->GetSiteInstance(), | 64 web_contents->GetSiteInstance(), |
65 route_id, | 65 route_id, |
66 static_cast<TabContents*>(web_contents), | 66 static_cast<TabContents*>(web_contents), |
67 NULL); | 67 NULL); |
68 // We could potentially add an opener here. That way we would know not to open . We also | |
dominich
2012/02/28 16:21:00
nit: line length
cbentzel
2012/02/29 18:16:13
Actually - I don't need this comment anymore.
| |
69 // wouldn't need the other stuff. | |
68 new_contents->set_opener_web_ui_type( | 70 new_contents->set_opener_web_ui_type( |
69 web_contents->GetWebUITypeForCurrentState()); | 71 web_contents->GetWebUITypeForCurrentState()); |
72 new_contents->set_opener_origin(GURL(params.opener_security_origin)); | |
70 content::WebContentsView* new_view = new_contents->GetView(); | 73 content::WebContentsView* new_view = new_contents->GetView(); |
71 | 74 |
72 // TODO(brettw): It seems bogus that we have to call this function on the | 75 // TODO(brettw): It seems bogus that we have to call this function on the |
73 // newly created object and give it one of its own member variables. | 76 // newly created object and give it one of its own member variables. |
74 new_view->CreateViewForWidget(new_contents->GetRenderViewHost()); | 77 new_view->CreateViewForWidget(new_contents->GetRenderViewHost()); |
75 | 78 |
76 // Save the created window associated with the route so we can show it later. | 79 // Save the created window associated with the route so we can show it later. |
77 pending_contents_[route_id] = new_contents; | 80 pending_contents_[route_id] = new_contents; |
78 | 81 |
79 if (web_contents->GetDelegate()) | 82 if (web_contents->GetDelegate()) |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
170 RenderWidgetHostView* widget_host_view = GetCreatedWidget(route_id); | 173 RenderWidgetHostView* widget_host_view = GetCreatedWidget(route_id); |
171 if (is_fullscreen) { | 174 if (is_fullscreen) { |
172 widget_host_view->InitAsFullscreen(web_contents->GetRenderWidgetHostView()); | 175 widget_host_view->InitAsFullscreen(web_contents->GetRenderWidgetHostView()); |
173 } else { | 176 } else { |
174 widget_host_view->InitAsPopup(web_contents->GetRenderWidgetHostView(), | 177 widget_host_view->InitAsPopup(web_contents->GetRenderWidgetHostView(), |
175 initial_pos); | 178 initial_pos); |
176 } | 179 } |
177 widget_host_view->GetRenderWidgetHost()->Init(); | 180 widget_host_view->GetRenderWidgetHost()->Init(); |
178 return widget_host_view; | 181 return widget_host_view; |
179 } | 182 } |
OLD | NEW |