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

Unified Diff: views/widget/widget_win.cc

Issue 132029: Call Layout directly from SetContentsView. In the case where the Widget is cr... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 years, 6 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 | « views/widget/widget_gtk.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/widget/widget_win.cc
===================================================================
--- views/widget/widget_win.cc (revision 18717)
+++ views/widget/widget_win.cc (working copy)
@@ -226,10 +226,11 @@
root_view_->RemoveAllChildViews(true);
root_view_->AddChildView(view);
- // Manually size the window here to ensure the root view is laid out.
- RECT wr;
- GetWindowRect(&wr);
- ChangeSize(0, CSize(wr.right - wr.left, wr.bottom - wr.top));
+ // Force a layout now, since the attached hierarchy won't be ready for the
+ // containing window's bounds. Note that we call Layout directly rather than
+ // calling ChangeSize, since the RootView's bounds may not have changed, which
+ // will cause the Layout not to be done otherwise.
+ root_view_->Layout();
}
///////////////////////////////////////////////////////////////////////////////
« no previous file with comments | « views/widget/widget_gtk.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698