Chromium Code Reviews| Index: ui/views/view.h |
| diff --git a/ui/views/view.h b/ui/views/view.h |
| index bfa107c7eb59451d32fd8c211537fb1c21eda3d0..45f4332194e180373867e7371885a4dd13923c14 100644 |
| --- a/ui/views/view.h |
| +++ b/ui/views/view.h |
| @@ -340,9 +340,8 @@ class VIEWS_EXPORT View : public ui::LayerDelegate, |
| // Compositor. |
| void SetPaintToLayer(ui::LayerType layer_type = ui::LAYER_TEXTURED); |
| - // Destroys the layer associated with this view, and reparents any descendants |
| - // to the destroyed layer's parent. If the view does not currently have a |
| - // layer, this has no effect. |
| + // Please refer to the comments above the DestroyLayerImpl() function for |
| + // details. |
| void DestroyLayer(); |
| // Overridden from ui::LayerOwner: |
| @@ -1189,6 +1188,29 @@ class VIEWS_EXPORT View : public ui::LayerDelegate, |
| // below layers owned by a view. |
| virtual void ReorderChildLayers(ui::Layer* parent_layer); |
| + // Notifies parents about a layer being created or destroyed in a child. An |
| + // example where a subclass may override this method is when it wants to clip |
| + // the child by adding its own layer. |
| + virtual void OnChildLayerChanged(View* child); |
| + |
| + enum class LayerChangeNotifyBehavior { |
|
sky
2017/04/19 00:03:05
Move this and the other functions (except for OnCh
ananta
2017/04/19 00:53:17
Done.
|
| + // Notify the parent chain about the layer change. |
| + NOTIFY, |
| + // Don't notify the parent chain about the layer change. |
| + DONT_NOTIFY |
| + }; |
| + |
| + // Destroys the layer associated with this view, and reparents any descendants |
| + // to the destroyed layer's parent. If the view does not currently have a |
| + // layer, this has no effect. |
| + // The |notify_parents| enum controls whether a notification about the layer |
| + // change is sent to the parents. |
| + void DestroyLayerImpl(LayerChangeNotifyBehavior notify_parents); |
| + |
| + // Notifies parents about layering changes in the view. This includes layer |
| + // creation and destruction. |
| + void NotifyParentsOfLayerChange(); |
| + |
| // Input --------------------------------------------------------------------- |
| virtual DragInfo* GetDragInfo(); |