Index: ash/common/wm/forwarding_layer_delegate.cc |
diff --git a/ash/common/wm/forwarding_layer_delegate.cc b/ash/common/wm/forwarding_layer_delegate.cc |
index 50d33c413d657566592f57a86a4e53d344b57af4..a6847c34f3e1ba9f4460372d041610f583a7e201 100644 |
--- a/ash/common/wm/forwarding_layer_delegate.cc |
+++ b/ash/common/wm/forwarding_layer_delegate.cc |
@@ -4,7 +4,6 @@ |
#include "ash/common/wm/forwarding_layer_delegate.h" |
-#include "ash/common/wm_window.h" |
#include "ui/compositor/layer.h" |
#include "ui/compositor/layer_owner.h" |
@@ -13,7 +12,7 @@ namespace wm { |
ForwardingLayerDelegate::ForwardingLayerDelegate(ui::Layer* new_layer, |
ui::Layer* original_layer) |
- : client_layer_(new_layer), |
+ : layer_(new_layer), |
original_layer_(original_layer), |
scoped_observer_(this) { |
scoped_observer_.Add(original_layer); |
@@ -37,30 +36,11 @@ void ForwardingLayerDelegate::OnDeviceScaleFactorChanged( |
void ForwardingLayerDelegate::DidPaintLayer(ui::Layer* layer, |
const gfx::Rect& rect) { |
- client_layer_->SchedulePaint(rect); |
-} |
- |
-void ForwardingLayerDelegate::SurfaceChanged(ui::Layer* layer) { |
- // This will delete the old layer and any descendants. |
- ui::LayerOwner old_client; |
- old_client.SetLayer(client_layer_); |
- |
- ui::LayerOwner* owner = layer->owner(); |
- // The layer recreation step isn't recursive, but layers with surfaces don't |
- // tend to have children anyway. We may end up missing some children, but we |
- // can also reach that state if layers are ever added or removed. |
- // TODO(estade): address this if it ever becomes a practical issue. |
- std::unique_ptr<ui::Layer> recreated = owner->RecreateLayer(); |
- client_layer_ = recreated.get(); |
- old_client.layer()->parent()->Add(recreated.release()); |
- old_client.layer()->parent()->Remove(old_client.layer()); |
- |
- scoped_observer_.Remove(original_layer_); |
- original_layer_ = owner->layer(); |
- scoped_observer_.Add(original_layer_); |
+ layer_->SchedulePaint(rect); |
} |
void ForwardingLayerDelegate::LayerDestroyed(ui::Layer* layer) { |
+ DCHECK_EQ(layer, original_layer_); |
original_layer_ = nullptr; |
scoped_observer_.Remove(layer); |
} |