Index: ash/wm/window_mirror_view.h |
diff --git a/ash/wm/window_mirror_view.h b/ash/wm/window_mirror_view.h |
index c91db5e09f11b7ef08cd363df57c8f31be5fdd41..1f9cd65416a4b0682670662d8eef4d735f626a97 100644 |
--- a/ash/wm/window_mirror_view.h |
+++ b/ash/wm/window_mirror_view.h |
@@ -10,6 +10,8 @@ |
#include "ash/ash_export.h" |
#include "base/macros.h" |
+#include "base/scoped_observer.h" |
+#include "ui/compositor/layer_observer.h" |
#include "ui/views/view.h" |
#include "ui/wm/core/window_util.h" |
@@ -24,7 +26,9 @@ class ForwardingLayerDelegate; |
// A view that mirrors the client area of a single window. Layers are lifted |
// from the underlying window (which gets new ones in their place). New paint |
// calls, if any, are forwarded to the underlying window. |
-class WindowMirrorView : public views::View, public ::wm::LayerDelegateFactory { |
+class WindowMirrorView : public views::View, |
+ public ::wm::LayerDelegateFactory, |
+ public ui::LayerObserver { |
public: |
explicit WindowMirrorView(WmWindowAura* window); |
~WindowMirrorView() override; |
@@ -38,6 +42,10 @@ class WindowMirrorView : public views::View, public ::wm::LayerDelegateFactory { |
// ::wm::LayerDelegateFactory: |
ui::LayerDelegate* CreateDelegate(ui::LayerDelegate* delegate) override; |
+ // ui::LayerObserver: |
+ void OnDelegatedFrameDamageInTree() override; |
+ void OnLayerDestroyed(ui::Layer* layer) override; |
+ |
private: |
void InitLayerOwner(); |
@@ -56,6 +64,8 @@ class WindowMirrorView : public views::View, public ::wm::LayerDelegateFactory { |
// the first time the view becomes visible. |
std::unique_ptr<ui::LayerTreeOwner> layer_owner_; |
+ ScopedObserver<ui::Layer, ui::LayerObserver> scoped_observer_; |
+ |
std::vector<std::unique_ptr<ForwardingLayerDelegate>> delegates_; |
DISALLOW_COPY_AND_ASSIGN(WindowMirrorView); |