Chromium Code Reviews| Index: content/browser/frame_host/cross_process_frame_connector.cc |
| diff --git a/content/browser/frame_host/cross_process_frame_connector.cc b/content/browser/frame_host/cross_process_frame_connector.cc |
| index a09af6478228897801a3c1fdcd20df8cf6a96035..7a2c9d6ce77ca5744b62409236f5ad3b0cc67ade 100644 |
| --- a/content/browser/frame_host/cross_process_frame_connector.cc |
| +++ b/content/browser/frame_host/cross_process_frame_connector.cc |
| @@ -227,12 +227,17 @@ void CrossProcessFrameConnector::SetSize(gfx::Rect frame_rect) { |
| RenderWidgetHostViewBase* |
| CrossProcessFrameConnector::GetRootRenderWidgetHostView() { |
| - return static_cast<RenderWidgetHostViewBase*>( |
| - frame_proxy_in_parent_renderer_->frame_tree_node() |
| - ->frame_tree() |
| - ->root() |
| - ->current_frame_host() |
| - ->GetView()); |
| + RenderFrameHostImpl* top_host = frame_proxy_in_parent_renderer_-> |
| + frame_tree_node()->frame_tree()->root()->current_frame_host(); |
| + |
| + // This method should return the root RWHV from the top-level WebContents, |
| + // in the case of nested WebContents. |
| + if (top_host->frame_tree_node()->render_manager()->ForInnerDelegate()) { |
|
nasko
2015/10/30 21:29:12
This will just go one level up, right? I'm not sur
kenrb
2015/10/30 21:40:40
I guess it might be more intuitive to do this. Ori
|
| + top_host = top_host->frame_tree_node()->render_manager()-> |
| + GetOuterDelegateNode()->frame_tree()->root()->current_frame_host(); |
| + } |
| + |
| + return static_cast<RenderWidgetHostViewBase*>(top_host->GetView()); |
| } |
| } // namespace content |