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

Unified Diff: views/widget/root_view.cc

Issue 160474: Status bubble limping in TOOLKIT_VIEWS.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 years, 5 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/root_view.h ('k') | views/widget/widget.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/widget/root_view.cc
===================================================================
--- views/widget/root_view.cc (revision 22173)
+++ views/widget/root_view.cc (working copy)
@@ -8,17 +8,17 @@
#include "app/drag_drop_types.h"
#include "app/gfx/canvas.h"
-#if defined(OS_WIN)
-#include "base/base_drag_source.h"
-#endif
#include "base/logging.h"
#include "base/message_loop.h"
+#include "views/fill_layout.h"
#include "views/focus/view_storage.h"
+#include "views/widget/widget.h"
+#include "views/window/window.h"
+
#if defined(OS_WIN)
+#include "base/base_drag_source.h"
#include "views/widget/root_view_drop_target.h"
#endif
-#include "views/widget/widget.h"
-#include "views/window/window.h"
namespace views {
@@ -92,6 +92,23 @@
pending_paint_task_->Cancel(); // Ensure we're not called any more.
}
+void RootView::SetContentsView(View* contents_view) {
+ DCHECK(contents_view && GetWidget()->GetNativeView()) <<
+ "Can't be called until after the native view is created!";
+ // The ContentsView must be set up _after_ the window is created so that its
+ // Widget pointer is valid.
+ SetLayoutManager(new FillLayout);
+ if (GetChildViewCount() != 0)
+ RemoveAllChildViews(true);
+ AddChildView(contents_view);
+
+ // 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 the widget's size changed handler, since the RootView's bounds may
+ // not have changed, which will cause the Layout not to be done otherwise.
+ Layout();
+}
+
/////////////////////////////////////////////////////////////////////////////
//
// RootView - layout, painting
« no previous file with comments | « views/widget/root_view.h ('k') | views/widget/widget.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698