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

Unified Diff: ash/wm/window_mirror_view.h

Issue 2190963002: Ash window cycle ui: don't create mirrored layers for previews until (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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
Index: ash/wm/window_mirror_view.h
diff --git a/ash/wm/window_mirror_view.h b/ash/wm/window_mirror_view.h
index 268ea10833bfa23c326e37cc636aad96c6a692cb..86b04ddd98c5e5d448d60234e5cbc56574e72424 100644
--- a/ash/wm/window_mirror_view.h
+++ b/ash/wm/window_mirror_view.h
@@ -29,8 +29,6 @@ class WindowMirrorView : public views::View, public ::wm::LayerDelegateFactory {
explicit WindowMirrorView(WmWindowAura* window);
~WindowMirrorView() override;
- void Init();
-
// views::View:
gfx::Size GetPreferredSize() const override;
void Layout() override;
@@ -39,6 +37,8 @@ class WindowMirrorView : public views::View, public ::wm::LayerDelegateFactory {
ui::LayerDelegate* CreateDelegate(ui::LayerDelegate* delegate) override;
private:
+ void InitLayerOwner();
+
// Gets the root of the layer tree that was lifted from |target_| (and is now
// a child of |this->layer()|).
ui::Layer* GetMirrorLayer();
@@ -46,7 +46,8 @@ class WindowMirrorView : public views::View, public ::wm::LayerDelegateFactory {
// The original window that is being represented by |this|.
WmWindowAura* target_;
- // Retains ownership of the mirror layer tree.
+ // Retains ownership of the mirror layer tree. This is lazily initialized
+ // the first time the view becomes visible.
std::unique_ptr<ui::LayerTreeOwner> layer_owner_;
std::vector<std::unique_ptr<ForwardingLayerDelegate>> delegates_;

Powered by Google App Engine
This is Rietveld 408576698