OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 MASH_WM_SHADOW_H_ | 5 #ifndef MASH_WM_SHADOW_H_ |
6 #define MASH_WM_SHADOW_H_ | 6 #define MASH_WM_SHADOW_H_ |
7 | 7 |
| 8 #include <memory> |
| 9 |
8 #include "base/macros.h" | 10 #include "base/macros.h" |
9 #include "base/memory/scoped_ptr.h" | |
10 #include "components/mus/public/cpp/window_observer.h" | 11 #include "components/mus/public/cpp/window_observer.h" |
11 #include "ui/compositor/layer_animation_observer.h" | 12 #include "ui/compositor/layer_animation_observer.h" |
12 #include "ui/gfx/geometry/rect.h" | 13 #include "ui/gfx/geometry/rect.h" |
13 | 14 |
14 namespace ui { | 15 namespace ui { |
15 class Layer; | 16 class Layer; |
16 } // namespace ui | 17 } // namespace ui |
17 | 18 |
18 namespace mash { | 19 namespace mash { |
19 namespace wm { | 20 namespace wm { |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 void UpdateLayerBounds(); | 77 void UpdateLayerBounds(); |
77 | 78 |
78 // WindowObserver: | 79 // WindowObserver: |
79 void OnWindowDestroyed(mus::Window* window) override; | 80 void OnWindowDestroyed(mus::Window* window) override; |
80 | 81 |
81 // The current style, set when the transition animation starts. | 82 // The current style, set when the transition animation starts. |
82 Style style_; | 83 Style style_; |
83 | 84 |
84 // The parent layer of the shadow layer. It serves as a container accessible | 85 // The parent layer of the shadow layer. It serves as a container accessible |
85 // from the outside to control the visibility of the shadow. | 86 // from the outside to control the visibility of the shadow. |
86 scoped_ptr<ui::Layer> layer_; | 87 std::unique_ptr<ui::Layer> layer_; |
87 | 88 |
88 // The actual shadow layer corresponding to a cc::NinePatchLayer. | 89 // The actual shadow layer corresponding to a cc::NinePatchLayer. |
89 scoped_ptr<ui::Layer> shadow_layer_; | 90 std::unique_ptr<ui::Layer> shadow_layer_; |
90 | 91 |
91 // Size of the current shadow image. | 92 // Size of the current shadow image. |
92 gfx::Size image_size_; | 93 gfx::Size image_size_; |
93 | 94 |
94 // Bounds of the content that the shadow encloses. | 95 // Bounds of the content that the shadow encloses. |
95 gfx::Rect content_bounds_; | 96 gfx::Rect content_bounds_; |
96 | 97 |
97 // The interior inset of the shadow images. The content bounds of the image | 98 // The interior inset of the shadow images. The content bounds of the image |
98 // grid should be set to |content_bounds_| inset by this amount. | 99 // grid should be set to |content_bounds_| inset by this amount. |
99 int interior_inset_; | 100 int interior_inset_; |
100 | 101 |
101 mus::Window* window_; | 102 mus::Window* window_; |
102 | 103 |
103 DISALLOW_COPY_AND_ASSIGN(Shadow); | 104 DISALLOW_COPY_AND_ASSIGN(Shadow); |
104 }; | 105 }; |
105 | 106 |
106 } // namespace wm | 107 } // namespace wm |
107 } // namespace mash | 108 } // namespace mash |
108 | 109 |
109 #endif // MASH_WM_SHADOW_H_ | 110 #endif // MASH_WM_SHADOW_H_ |
OLD | NEW |