| Index: ui/views/view.cc
|
| diff --git a/ui/views/view.cc b/ui/views/view.cc
|
| index 83192d8c93df41d122c633fa68f89130182ba0cb..a7e65a8390840e6e443a7e0e19561989dca82abf 100644
|
| --- a/ui/views/view.cc
|
| +++ b/ui/views/view.cc
|
| @@ -296,6 +296,8 @@ void View::ReorderChildView(View* view, int index) {
|
| ReorderLayers();
|
| }
|
|
|
| +void View::OnChildLayerChanged(View* child) {}
|
| +
|
| void View::RemoveChildView(View* view) {
|
| DoRemoveChildView(view, true, true, false, NULL);
|
| }
|
| @@ -537,12 +539,19 @@ void View::SetPaintToLayer(ui::LayerType layer_type) {
|
| if (paint_to_layer_ && (layer()->type() == layer_type))
|
| return;
|
|
|
| - DestroyLayer();
|
| + DestroyLayerImpl(DONT_NOTIFY);
|
| CreateLayer(layer_type);
|
| paint_to_layer_ = true;
|
| +
|
| + // Notify the parent chain about the layer change.
|
| + NotifyParentsOfLayerChange();
|
| }
|
|
|
| void View::DestroyLayer() {
|
| + DestroyLayerImpl(NOTIFY);
|
| +}
|
| +
|
| +void View::DestroyLayerImpl(LayerChangeNotifyBehavior notify_parents) {
|
| if (!paint_to_layer_)
|
| return;
|
|
|
| @@ -567,6 +576,10 @@ void View::DestroyLayer() {
|
|
|
| SchedulePaint();
|
|
|
| + // Notify the parent chain about the layer change.
|
| + if (notify_parents == NOTIFY)
|
| + NotifyParentsOfLayerChange();
|
| +
|
| Widget* widget = GetWidget();
|
| if (widget)
|
| widget->LayerTreeChanged();
|
| @@ -2650,4 +2663,13 @@ bool View::DoDrag(const ui::LocatedEvent& event,
|
| return true;
|
| }
|
|
|
| +void View::NotifyParentsOfLayerChange() {
|
| + // Notify the parent chain about the layer change.
|
| + View* view_parent = parent();
|
| + while (view_parent) {
|
| + view_parent->OnChildLayerChanged(this);
|
| + view_parent = view_parent->parent();
|
| + }
|
| +}
|
| +
|
| } // namespace views
|
|
|