Chromium Code Reviews| Index: content/browser/frame_host/render_frame_host_manager.cc |
| diff --git a/content/browser/frame_host/render_frame_host_manager.cc b/content/browser/frame_host/render_frame_host_manager.cc |
| index 4588e078817987e52eacf623bf3c61fc82ef3238..cdb6b90c56cf87ed56521c4bbc2037f2174bce4b 100644 |
| --- a/content/browser/frame_host/render_frame_host_manager.cc |
| +++ b/content/browser/frame_host/render_frame_host_manager.cc |
| @@ -160,6 +160,23 @@ RenderFrameProxyHost* RenderFrameHostManager::GetProxyToParent() { |
| return iter->second; |
| } |
| +RenderFrameProxyHost* RenderFrameHostManager::GetProxyToOuterContents() { |
| + int outer_contents_frame_tree_node_id = |
| + delegate_->GetOuterWebContentsFrameTreeNodeID(); |
| + FrameTreeNode* outer_contents_frame_tree_node = |
| + FrameTreeNode::GloballyFindByID(outer_contents_frame_tree_node_id); |
| + if (!outer_contents_frame_tree_node) |
| + return nullptr; |
| + |
| + return GetRenderFrameProxyHost( |
| + outer_contents_frame_tree_node->current_frame_host()->GetSiteInstance()); |
| +} |
| + |
| +bool RenderFrameHostManager::IsGuest() { |
| + return frame_tree_node_->IsMainFrame() && |
|
Charlie Reis
2015/05/22 23:44:30
Thanks for the TODO in the .h file. Can you also
lazyboy
2015/05/26 16:32:54
Done.
|
| + delegate_->GetOuterWebContentsFrameTreeNodeID() != -1; |
| +} |
| + |
| void RenderFrameHostManager::SetPendingWebUI(const GURL& url, int bindings) { |
| pending_web_ui_ = CreateWebUI(url, bindings); |
| pending_and_current_web_ui_.reset(); |
| @@ -1599,6 +1616,37 @@ void RenderFrameHostManager::EnsureRenderViewInitialized( |
| proxy->set_render_frame_proxy_created(true); |
| } |
| +int RenderFrameHostManager::CreateOuterContentsProxy( |
| + SiteInstance* outer_contents_site_instance) { |
| + CHECK(base::CommandLine::ForCurrentProcess()->HasSwitch( |
| + switches::kSitePerProcess)); |
| + int outer_contents_proxy_flags = CREATE_RF_HIDDEN | CREATE_RF_SWAPPED_OUT | |
| + CREATE_RF_FOR_MAIN_FRAME_NAVIGATION; |
| + int swapped_out_render_view_routing_id; // Unused. |
| + scoped_ptr<RenderFrameHostImpl> swapped_out_rfh_in_outer_contents = |
| + CreateRenderFrame(outer_contents_site_instance, nullptr, |
|
nasko
2015/05/22 16:32:27
Ah, this is unfortunate : (. I'm working on a CL t
lazyboy
2015/05/26 16:32:54
Bug#?
|
| + MSG_ROUTING_NONE, // opener_route_id |
| + outer_contents_proxy_flags, |
| + &swapped_out_render_view_routing_id); |
| + |
| + RenderFrameProxyHost* rfph_in_outer_contents = |
| + GetRenderFrameProxyHost(outer_contents_site_instance); |
| + DCHECK(rfph_in_outer_contents); |
| + return rfph_in_outer_contents->GetRoutingID(); |
| +} |
| + |
| +void RenderFrameHostManager::ReplaceWithInnerContentsProxy( |
| + int proxy_to_outer_contents_routing_id) { |
| + current_frame_host()->Send(new FrameMsg_SwapOut( |
|
Charlie Reis
2015/05/22 23:44:30
Is it correct to pass false for is_loading? I was
lazyboy
2015/05/29 00:02:23
We are in the outer WebContents's FTN and this FTN
|
| + current_frame_host()->GetRoutingID(), proxy_to_outer_contents_routing_id, |
| + false /* is_loading */, content::FrameReplicationState())); |
|
nasko
2015/05/22 16:32:27
nit: No need to use "content::" prefix, this code
lazyboy
2015/05/26 16:32:54
Done, thanks.
|
| +} |
| + |
| +void RenderFrameHostManager::SetRWHViewForInnerContents( |
| + RenderWidgetHostView* child_rwhv) { |
| + GetProxyToOuterContents()->SetChildRWHView(child_rwhv); |
| +} |
| + |
| bool RenderFrameHostManager::InitRenderView( |
| RenderViewHostImpl* render_view_host, |
| int opener_route_id, |