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

Unified Diff: ui/views/view.h

Issue 15912007: WIP - loop in LayoutManager for preferred size changes (2) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix LabelTest 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
Index: ui/views/view.h
diff --git a/ui/views/view.h b/ui/views/view.h
index 9447364529732256dfdb4f70f68384a7b56785d7..dc7485c9dd4f8c3a0deb9f5a09db137b7ed8b5d6 100644
--- a/ui/views/view.h
+++ b/ui/views/view.h
@@ -15,6 +15,7 @@
#include "base/i18n/rtl.h"
#include "base/logging.h"
#include "base/memory/scoped_ptr.h"
+#include "base/memory/weak_ptr.h"
#include "build/build_config.h"
#include "ui/base/accelerators/accelerator.h"
#include "ui/base/accessibility/accessibility_types.h"
@@ -975,11 +976,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 +1199,7 @@ class VIEWS_EXPORT View : public ui::LayerDelegate,
friend class internal::PostEventDispatchHandler;
friend class internal::RootView;
friend class FocusManager;
+ friend class LayoutManager;
friend class Widget;
// Painting -----------------------------------------------------------------
@@ -1258,6 +1260,9 @@ class VIEWS_EXPORT View : public ui::LayerDelegate,
// Size and disposition ------------------------------------------------------
+ // FIXME
+ void LayoutIfNeeded();
+
// Call VisibilityChanged() recursively for all children.
void PropagateVisibilityNotifications(View* from, bool is_visible);
@@ -1394,6 +1399,7 @@ class VIEWS_EXPORT View : public ui::LayerDelegate,
const gfx::Point& press_pt,
ui::DragDropTypes::DragEventSource source);
+
//////////////////////////////////////////////////////////////////////////////
// Creation and lifetime -----------------------------------------------------
@@ -1402,6 +1408,8 @@ class VIEWS_EXPORT View : public ui::LayerDelegate,
// parent during its parents destruction. False is the default.
bool owned_by_client_;
+ base::WeakPtrFactory<View> weak_ptr_factory_;
+
// Attributes ----------------------------------------------------------------
// The id of this View. Used to find this View.

Powered by Google App Engine
This is Rietveld 408576698