Index: ui/views/view.h |
diff --git a/ui/views/view.h b/ui/views/view.h |
index fcbee85c1bf2155eef7639c5b96e75c6980c1b4f..df4832741677a245b32107d7f837cb87ec4687b8 100644 |
--- a/ui/views/view.h |
+++ b/ui/views/view.h |
@@ -1116,6 +1116,14 @@ class VIEWS_EXPORT View : public ui::LayerDelegate, |
// FocusManager manages this view. |
virtual void NativeViewHierarchyChanged(); |
+ // This method is invoked for a view when it is attached to a hierarchy with |
+ // a widget, i.e. GetWidget() starts returning a non-null result. |
+ virtual void AddedToWidget(); |
+ |
+ // This method is invoked for a view when it is removed from a hierarchy with |
+ // a widget. |
sky
2017/03/01 20:26:51
Clarify this is also invoked if a view is moved to
msimonides
2017/03/02 07:48:56
Done.
|
+ virtual void RemovedFromWidget(); |
+ |
// Painting ------------------------------------------------------------------ |
// Responsible for calling Paint() on child Views. Override to control the |
@@ -1298,10 +1306,16 @@ class VIEWS_EXPORT View : public ui::LayerDelegate, |
// |old_parent| is the original parent of the View that was removed. |
// If |new_parent| is not NULL, the View that was removed will be reparented |
// to |new_parent| after the remove operation. |
- void PropagateRemoveNotifications(View* old_parent, View* new_parent); |
+ // If is_removed_from_widget is true, calls RemovedFromWidget for all |
+ // children. |
+ void PropagateRemoveNotifications(View* old_parent, |
+ View* new_parent, |
+ bool is_removed_from_widget); |
// Call ViewHierarchyChanged() for all children. |
- void PropagateAddNotifications(const ViewHierarchyChangedDetails& details); |
+ // If is_added_to_widget is true, calls AddedToWidget for all children. |
+ void PropagateAddNotifications(const ViewHierarchyChangedDetails& details, |
+ bool is_added_to_widget); |
// Propagates NativeViewHierarchyChanged() notification through all the |
// children. |