Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(632)

Unified Diff: ash/wm/window_mirror_view.h

Issue 2254733003: Add ui::LayerObserver and use it to update Alt+Tab previews as needed. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: appease compiler Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ash/wm/window_mirror_view.cc » ('j') | ui/compositor/layer.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « no previous file | ash/wm/window_mirror_view.cc » ('j') | ui/compositor/layer.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698