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

Side by Side 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: loc-- 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 unified diff | Download patch
« no previous file with comments | « ash/aura/wm_window_aura.cc ('k') | ash/wm/window_mirror_view.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef ASH_WM_WINDOW_MIRROR_VIEW_H_ 5 #ifndef ASH_WM_WINDOW_MIRROR_VIEW_H_
6 #define ASH_WM_WINDOW_MIRROR_VIEW_H_ 6 #define ASH_WM_WINDOW_MIRROR_VIEW_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 11 matching lines...) Expand all
22 class ForwardingLayerDelegate; 22 class ForwardingLayerDelegate;
23 23
24 // A view that mirrors a single window. Layers are lifted from the underlying 24 // A view that mirrors a single window. Layers are lifted from the underlying
25 // window (which gets new ones in their place). New paint calls, if any, are 25 // window (which gets new ones in their place). New paint calls, if any, are
26 // forwarded to the underlying window. 26 // forwarded to the underlying window.
27 class WindowMirrorView : public views::View, public ::wm::LayerDelegateFactory { 27 class WindowMirrorView : public views::View, public ::wm::LayerDelegateFactory {
28 public: 28 public:
29 explicit WindowMirrorView(WmWindowAura* window); 29 explicit WindowMirrorView(WmWindowAura* window);
30 ~WindowMirrorView() override; 30 ~WindowMirrorView() override;
31 31
32 void Init();
33
34 // views::View: 32 // views::View:
35 gfx::Size GetPreferredSize() const override; 33 gfx::Size GetPreferredSize() const override;
36 void Layout() override; 34 void Layout() override;
35 bool GetNeedsNotificationWhenVisibleBoundsChange() const override;
36 void OnVisibleBoundsChanged() override;
37 37
38 // ::wm::LayerDelegateFactory: 38 // ::wm::LayerDelegateFactory:
39 ui::LayerDelegate* CreateDelegate(ui::LayerDelegate* delegate) override; 39 ui::LayerDelegate* CreateDelegate(ui::LayerDelegate* delegate) override;
40 40
41 private: 41 private:
42 void InitLayerOwner();
43
42 // Gets the root of the layer tree that was lifted from |target_| (and is now 44 // Gets the root of the layer tree that was lifted from |target_| (and is now
43 // a child of |this->layer()|). 45 // a child of |this->layer()|).
44 ui::Layer* GetMirrorLayer(); 46 ui::Layer* GetMirrorLayer();
45 47
46 // The original window that is being represented by |this|. 48 // The original window that is being represented by |this|.
47 WmWindowAura* target_; 49 WmWindowAura* target_;
48 50
49 // Retains ownership of the mirror layer tree. 51 // Retains ownership of the mirror layer tree. This is lazily initialized
52 // the first time the view becomes visible.
50 std::unique_ptr<ui::LayerTreeOwner> layer_owner_; 53 std::unique_ptr<ui::LayerTreeOwner> layer_owner_;
51 54
52 std::vector<std::unique_ptr<ForwardingLayerDelegate>> delegates_; 55 std::vector<std::unique_ptr<ForwardingLayerDelegate>> delegates_;
53 56
54 DISALLOW_COPY_AND_ASSIGN(WindowMirrorView); 57 DISALLOW_COPY_AND_ASSIGN(WindowMirrorView);
55 }; 58 };
56 59
57 } // namespace wm 60 } // namespace wm
58 } // namespace ash 61 } // namespace ash
59 62
60 #endif // ASH_WM_WINDOW_MIRROR_VIEW_H_ 63 #endif // ASH_WM_WINDOW_MIRROR_VIEW_H_
OLDNEW
« no previous file with comments | « ash/aura/wm_window_aura.cc ('k') | ash/wm/window_mirror_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698