OLD | NEW |
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 | 9 |
10 #include "ash/ash_export.h" | 10 #include "ash/ash_export.h" |
(...skipping 12 matching lines...) Expand all Loading... |
23 | 23 |
24 namespace wm { | 24 namespace wm { |
25 | 25 |
26 // A view that mirrors the client area of a single window. | 26 // A view that mirrors the client area of a single window. |
27 class WindowMirrorView : public views::View { | 27 class WindowMirrorView : public views::View { |
28 public: | 28 public: |
29 explicit WindowMirrorView(aura::Window* window); | 29 explicit WindowMirrorView(aura::Window* window); |
30 ~WindowMirrorView() override; | 30 ~WindowMirrorView() override; |
31 | 31 |
32 // views::View: | 32 // views::View: |
33 gfx::Size GetPreferredSize() const override; | 33 gfx::Size CalculatePreferredSize() const override; |
34 void Layout() override; | 34 void Layout() override; |
35 bool GetNeedsNotificationWhenVisibleBoundsChange() const override; | 35 bool GetNeedsNotificationWhenVisibleBoundsChange() const override; |
36 void OnVisibleBoundsChanged() override; | 36 void OnVisibleBoundsChanged() override; |
37 | 37 |
38 private: | 38 private: |
39 void InitLayerOwner(); | 39 void InitLayerOwner(); |
40 | 40 |
41 // Gets the root of the layer tree that was lifted from |target_| (and is now | 41 // Gets the root of the layer tree that was lifted from |target_| (and is now |
42 // a child of |this->layer()|). | 42 // a child of |this->layer()|). |
43 ui::Layer* GetMirrorLayer(); | 43 ui::Layer* GetMirrorLayer(); |
44 | 44 |
45 // Calculates the bounds of the client area of the Window in the widget | 45 // Calculates the bounds of the client area of the Window in the widget |
46 // coordinate space. | 46 // coordinate space. |
47 gfx::Rect GetClientAreaBounds() const; | 47 gfx::Rect GetClientAreaBounds() const; |
48 | 48 |
49 // The original window that is being represented by |this|. | 49 // The original window that is being represented by |this|. |
50 aura::Window* target_; | 50 aura::Window* target_; |
51 | 51 |
52 // Retains ownership of the mirror layer tree. This is lazily initialized | 52 // Retains ownership of the mirror layer tree. This is lazily initialized |
53 // the first time the view becomes visible. | 53 // the first time the view becomes visible. |
54 std::unique_ptr<ui::LayerTreeOwner> layer_owner_; | 54 std::unique_ptr<ui::LayerTreeOwner> layer_owner_; |
55 | 55 |
56 DISALLOW_COPY_AND_ASSIGN(WindowMirrorView); | 56 DISALLOW_COPY_AND_ASSIGN(WindowMirrorView); |
57 }; | 57 }; |
58 | 58 |
59 } // namespace wm | 59 } // namespace wm |
60 } // namespace ash | 60 } // namespace ash |
61 | 61 |
62 #endif // ASH_WM_WINDOW_MIRROR_VIEW_H_ | 62 #endif // ASH_WM_WINDOW_MIRROR_VIEW_H_ |
OLD | NEW |