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

Unified Diff: ui/views/view.h

Issue 15071002: WIP - loop in LayoutManager for preferred size changes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: scoped layouter Created 7 years, 7 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 | « ui/views/layout/layout_manager.cc ('k') | ui/views/view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/view.h
diff --git a/ui/views/view.h b/ui/views/view.h
index 9447364529732256dfdb4f70f68384a7b56785d7..816f1e8b9826fad53cfd8d74a7d67bd8095c6bd0 100644
--- a/ui/views/view.h
+++ b/ui/views/view.h
@@ -74,6 +74,15 @@ class PostEventDispatchHandler;
class RootView;
}
+class VIEWS_EXPORT ScopedMaybeLayout {
+ public:
+ ScopedMaybeLayout(views::View* view);
+ ~ScopedMaybeLayout();
+
+ private:
+ views::View* view_;
+};
+
/////////////////////////////////////////////////////////////////////////////
//
// View class
@@ -975,11 +984,11 @@ class VIEWS_EXPORT View : public ui::LayerDelegate,
// Size and disposition ------------------------------------------------------
// Override to be notified when the bounds of the view have changed.
- virtual void OnBoundsChanged(const gfx::Rect& previous_bounds);
+ virtual void OnBoundsChanged(const gfx::Rect& previous_bounds) {}
// Called when the preferred size of a child view changed. This gives the
// parent an opportunity to do a fresh layout if that makes sense.
- virtual void ChildPreferredSizeChanged(View* child) {}
+ virtual void ChildPreferredSizeChanged(View* child);
// Called when the visibility of a child view changed. This gives the parent
// an opportunity to do a fresh layout if that makes sense.
@@ -1198,6 +1207,8 @@ class VIEWS_EXPORT View : public ui::LayerDelegate,
friend class internal::PostEventDispatchHandler;
friend class internal::RootView;
friend class FocusManager;
+ friend class LayoutManager;
+ friend class ScopedMaybeLayout;
friend class Widget;
// Painting -----------------------------------------------------------------
« no previous file with comments | « ui/views/layout/layout_manager.cc ('k') | ui/views/view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698