Index: content/browser/web_contents/web_contents_impl.cc |
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc |
index ca9d608125b98c3a6c70134462624547e992ed24..94ca4d946b43ebc197680542ca28da07df72e34f 100644 |
--- a/content/browser/web_contents/web_contents_impl.cc |
+++ b/content/browser/web_contents/web_contents_impl.cc |
@@ -1714,8 +1714,12 @@ void WebContentsImpl::ShowCreatedWindow(int route_id, |
if (contents) { |
WebContentsDelegate* delegate = GetDelegate(); |
if (delegate) { |
+ if (delegate->ShouldResumeRequestsForCreatedWindow()) |
jam
2015/04/20 16:05:41
nit: instead of calling the line below twice, perh
Maria
2015/04/20 23:40:07
Done.
|
+ ResumeRequestsForCreatedWindow(*contents); |
delegate->AddNewContents( |
this, contents, disposition, initial_rect, user_gesture, NULL); |
+ } else { |
+ ResumeRequestsForCreatedWindow(*contents); |
} |
} |
} |
@@ -1800,14 +1804,16 @@ WebContentsImpl* WebContentsImpl::GetCreatedWindow(int route_id) { |
!new_contents->GetRenderViewHost()->GetView()) |
return NULL; |
- // Resume blocked requests for both the RenderViewHost and RenderFrameHost. |
- // TODO(brettw): It seems bogus to reach into here and initialize the host. |
- static_cast<RenderViewHostImpl*>(new_contents->GetRenderViewHost())->Init(); |
- static_cast<RenderFrameHostImpl*>(new_contents->GetMainFrame())->Init(); |
- |
return new_contents; |
} |
+void WebContentsImpl::ResumeRequestsForCreatedWindow( |
+ WebContentsImpl& new_contents) { |
jam
2015/04/20 16:05:41
nit: not sure why this method is needed? i.e. why
Maria
2015/04/20 23:40:07
The reason it's needed is that it gets called on a
|
+ // TODO(brettw): It seems bogus to reach into here and initialize the host. |
+ static_cast<RenderViewHostImpl*>(new_contents.GetRenderViewHost())->Init(); |
+ static_cast<RenderFrameHostImpl*>(new_contents.GetMainFrame())->Init(); |
+} |
+ |
RenderWidgetHostView* WebContentsImpl::GetCreatedWidget(int route_id) { |
PendingWidgetViews::iterator iter = pending_widget_views_.find(route_id); |
if (iter == pending_widget_views_.end()) { |
@@ -4543,4 +4549,11 @@ void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) { |
view_->SetOverscrollControllerEnabled(CanOverscrollContent()); |
} |
+#if defined(OS_ANDROID) |
+void WebContentsImpl::ResumeLoadingCreatedWebContents() { |
+ ResumeRequestsForCreatedWindow(*this); |
+} |
+#endif |
+ |
+ |
} // namespace content |