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

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: 'queued' renamed to 'pending' 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
Index: content/browser/tab_contents/render_view_host_manager.cc
===================================================================
--- content/browser/tab_contents/render_view_host_manager.cc (revision 82104)
+++ content/browser/tab_contents/render_view_host_manager.cc (working copy)
@@ -691,15 +691,19 @@
// Swap in the new view and make it active.
render_view_host_ = rvh;
render_view_host_->set_delegate(render_view_delegate_);
+ // Remove old RenderWidgetHostView before creating a new one.
sky 2011/04/19 17:08:37 Please document why you need to remove the old.
mmenke 2011/04/19 17:29:38 Done.
+ 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.
cbentzel 2011/04/19 17:42:41 You inherited this, but please add http://crbug.co
mmenke 2011/04/19 20:00:01 Done.
render_view_host_->view()->Hide();
render_view_host_->view()->Show();
}

Powered by Google App Engine
This is Rietveld 408576698