| 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/tab_contents/tab_contents.h" | 9 #include "content/browser/tab_contents/tab_contents.h" |
| 10 #include "content/common/view_messages.h" | 10 #include "content/common/view_messages.h" |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 // Create the new web contents. This will automatically create the new | 62 // Create the new web contents. This will automatically create the new |
| 63 // WebContentsView. In the future, we may want to create the view separately. | 63 // WebContentsView. In the future, we may want to create the view separately. |
| 64 TabContents* new_contents = | 64 TabContents* new_contents = |
| 65 new TabContents(web_contents->GetBrowserContext(), | 65 new TabContents(web_contents->GetBrowserContext(), |
| 66 web_contents->GetSiteInstance(), | 66 web_contents->GetSiteInstance(), |
| 67 route_id, | 67 route_id, |
| 68 static_cast<TabContents*>(web_contents), | 68 static_cast<TabContents*>(web_contents), |
| 69 NULL); | 69 NULL); |
| 70 new_contents->set_opener_web_ui_type( | 70 new_contents->set_opener_web_ui_type( |
| 71 web_contents->GetWebUITypeForCurrentState()); | 71 web_contents->GetWebUITypeForCurrentState()); |
| 72 new_contents->set_has_opener(!params.opener_url.is_empty()); |
| 72 content::WebContentsView* new_view = new_contents->GetView(); | 73 content::WebContentsView* new_view = new_contents->GetView(); |
| 73 | 74 |
| 74 // 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 |
| 75 // 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. |
| 76 new_view->CreateViewForWidget(new_contents->GetRenderViewHost()); | 77 new_view->CreateViewForWidget(new_contents->GetRenderViewHost()); |
| 77 | 78 |
| 78 // 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. |
| 79 pending_contents_[route_id] = new_contents; | 80 pending_contents_[route_id] = new_contents; |
| 80 | 81 |
| 81 if (web_contents->GetDelegate()) | 82 if (web_contents->GetDelegate()) |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 RenderWidgetHostViewPort::FromRWHV(GetCreatedWidget(route_id)); | 175 RenderWidgetHostViewPort::FromRWHV(GetCreatedWidget(route_id)); |
| 175 if (is_fullscreen) { | 176 if (is_fullscreen) { |
| 176 widget_host_view->InitAsFullscreen(web_contents->GetRenderWidgetHostView()); | 177 widget_host_view->InitAsFullscreen(web_contents->GetRenderWidgetHostView()); |
| 177 } else { | 178 } else { |
| 178 widget_host_view->InitAsPopup(web_contents->GetRenderWidgetHostView(), | 179 widget_host_view->InitAsPopup(web_contents->GetRenderWidgetHostView(), |
| 179 initial_pos); | 180 initial_pos); |
| 180 } | 181 } |
| 181 RenderWidgetHostImpl::From(widget_host_view->GetRenderWidgetHost())->Init(); | 182 RenderWidgetHostImpl::From(widget_host_view->GetRenderWidgetHost())->Init(); |
| 182 return widget_host_view; | 183 return widget_host_view; |
| 183 } | 184 } |
| OLD | NEW |