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

Unified Diff: content/browser/tab_contents/render_view_host_manager.cc

Issue 6685012: Give prerendering RVH's RenderWidgetHostViews. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Sync to trunk Created 9 years, 8 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 | « chrome/test/data/prerender/prerender_size.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/tab_contents/render_view_host_manager.cc
===================================================================
--- content/browser/tab_contents/render_view_host_manager.cc (revision 82482)
+++ content/browser/tab_contents/render_view_host_manager.cc (working copy)
@@ -691,15 +691,21 @@
// Swap in the new view and make it active.
render_view_host_ = rvh;
render_view_host_->set_delegate(render_view_delegate_);
+ // Remove old RenderWidgetHostView with mocked out methods so it can be
+ // replaced with a new one that's a child of |delegate_|'s view.
+ scoped_ptr<RenderWidgetHostView> old_view(render_view_host_->view());
+ render_view_host_->set_view(NULL);
delegate_->CreateViewAndSetSizeForRVH(render_view_host_);
render_view_host_->ActivateDeferredPluginHandles();
// If the view is gone, then this RenderViewHost died while it was hidden.
// We ignored the RenderViewGone call at the time, so we should send it now
// to make sure the sad tab shows up, etc.
if (render_view_host_->view()) {
- // TODO(tburkard,cbentzel): Figure out why this hack is needed and/or
- // if it can be removed. On Windows, prerendering will not work without
- // doing a Hide before the Show.
+ // The Hide() is needed to sync the state of |render_view_host_|, which is
+ // hidden, with the newly created view, which does not know the
+ // RenderViewHost is hidden.
+ // TODO(tburkard,cbentzel): Figure out if this hack can be removed
+ // (http://crbug.com/79891).
render_view_host_->view()->Hide();
render_view_host_->view()->Show();
}
« no previous file with comments | « chrome/test/data/prerender/prerender_size.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698