Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(694)

Unified Diff: content/browser/frame_host/cross_process_frame_connector.cc

Issue 1420203007: Correctly find root RWHV from a nested WebContents (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: s/if/while Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | content/browser/frame_host/render_frame_host_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..32128e767c1a9d7b062acc17753bd487e36f340b 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.
+ while (top_host->frame_tree_node()->render_manager()->ForInnerDelegate()) {
+ 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
« no previous file with comments | « no previous file | content/browser/frame_host/render_frame_host_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698