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

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

Issue 1303773002: Give the main frame a RenderWidget. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: plumb through surface ID *and* widget surface ID for window.open Created 5 years, 3 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
Index: content/browser/frame_host/render_frame_host_impl.cc
diff --git a/content/browser/frame_host/render_frame_host_impl.cc b/content/browser/frame_host/render_frame_host_impl.cc
index a04779a089a83550d8d2f3cd01fdcd001130680a..f4df87df854ee574f87fdcde0a39fafbe2142fb9 100644
--- a/content/browser/frame_host/render_frame_host_impl.cc
+++ b/content/browser/frame_host/render_frame_host_impl.cc
@@ -932,24 +932,26 @@ void RenderFrameHostImpl::OnDidDropNavigation() {
}
RenderWidgetHostImpl* RenderFrameHostImpl::GetRenderWidgetHost() {
- if (render_widget_host_)
- return render_widget_host_;
-
// TODO(kenrb): When RenderViewHost no longer inherits RenderWidgetHost,
// we can remove this fallback. Currently it is only used for the main
// frame.
if (!GetParent())
return static_cast<RenderWidgetHostImpl*>(render_view_host_);
+ if (render_widget_host_)
+ return render_widget_host_;
+
return nullptr;
}
RenderWidgetHostView* RenderFrameHostImpl::GetView() {
- RenderFrameHostImpl* frame = this;
- while (frame) {
+ // TODO(dcheng): Similar to above, though the main RenderFrameHost now has a
ncarter (slow) 2015/09/03 20:24:37 It's not clear what "similar to above" refers to i
dcheng 2015/09/03 21:29:24 Done.
+ // RenderWidgetHost, a lot of the plumbing is still missing. Thus, for now,
+ // the main frame always uses the RVH's view. https://crbug.com/526958
+ for (RenderFrameHostImpl* frame = this; frame->GetParent();
+ frame = static_cast<RenderFrameHostImpl*>(frame->GetParent())) {
if (frame->render_widget_host_)
return frame->render_widget_host_->GetView();
- frame = static_cast<RenderFrameHostImpl*>(frame->GetParent());
}
return render_view_host_->GetView();

Powered by Google App Engine
This is Rietveld 408576698