OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_COMMON_WM_OVERVIEW_SCOPED_TRANSFORM_OVERVIEW_WINDOW_H_ | 5 #ifndef ASH_COMMON_WM_OVERVIEW_SCOPED_TRANSFORM_OVERVIEW_WINDOW_H_ |
6 #define ASH_COMMON_WM_OVERVIEW_SCOPED_TRANSFORM_OVERVIEW_WINDOW_H_ | 6 #define ASH_COMMON_WM_OVERVIEW_SCOPED_TRANSFORM_OVERVIEW_WINDOW_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
54 int top_view_inset, | 54 int top_view_inset, |
55 int title_height); | 55 int title_height); |
56 | 56 |
57 // Returns the transform turning |src_rect| into |dst_rect|. | 57 // Returns the transform turning |src_rect| into |dst_rect|. |
58 static gfx::Transform GetTransformForRect(const gfx::Rect& src_rect, | 58 static gfx::Transform GetTransformForRect(const gfx::Rect& src_rect, |
59 const gfx::Rect& dst_rect); | 59 const gfx::Rect& dst_rect); |
60 | 60 |
61 explicit ScopedTransformOverviewWindow(WmWindow* window); | 61 explicit ScopedTransformOverviewWindow(WmWindow* window); |
62 ~ScopedTransformOverviewWindow(); | 62 ~ScopedTransformOverviewWindow(); |
63 | 63 |
64 gfx::Transform get_overview_transform() const { return overview_transform_; } | |
65 | |
66 void set_overview_transform(const gfx::Transform& transform) { | |
67 overview_transform_ = transform; | |
68 } | |
69 | |
70 // Starts an animation sequence which will use animation settings specified by | 64 // Starts an animation sequence which will use animation settings specified by |
71 // |animation_type|. The |animation_settings| container is populated with | 65 // |animation_type|. The |animation_settings| container is populated with |
72 // scoped entities and the container should be destroyed at the end of the | 66 // scoped entities and the container should be destroyed at the end of the |
73 // animation sequence. | 67 // animation sequence. |
74 // | 68 // |
75 // Example: | 69 // Example: |
76 // ScopedTransformOverviewWindow overview_window(window); | 70 // ScopedTransformOverviewWindow overview_window(window); |
77 // ScopedTransformOverviewWindow::ScopedAnimationSettings scoped_settings; | 71 // ScopedTransformOverviewWindow::ScopedAnimationSettings scoped_settings; |
78 // overview_window.BeginScopedAnimation( | 72 // overview_window.BeginScopedAnimation( |
79 // OverviewAnimationType::OVERVIEW_ANIMATION_SELECTOR_ITEM_SCROLL_CANCEL, | 73 // OverviewAnimationType::OVERVIEW_ANIMATION_SELECTOR_ITEM_SCROLL_CANCEL, |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
120 // Prepares for overview mode by doing any necessary actions before entering. | 114 // Prepares for overview mode by doing any necessary actions before entering. |
121 void PrepareForOverview(); | 115 void PrepareForOverview(); |
122 | 116 |
123 // Applies the |transform| to the overview window and all of its transient | 117 // Applies the |transform| to the overview window and all of its transient |
124 // children. | 118 // children. |
125 void SetTransform(WmWindow* root_window, const gfx::Transform& transform); | 119 void SetTransform(WmWindow* root_window, const gfx::Transform& transform); |
126 | 120 |
127 // Set's the opacity of the managed windows. | 121 // Set's the opacity of the managed windows. |
128 void SetOpacity(float opacity); | 122 void SetOpacity(float opacity); |
129 | 123 |
130 // Creates a mask layer with the bottom edge using rounded corners of | 124 // Hides the window header whose size is given in |
varkha
2016/10/21 14:17:15
nit: Incomplete sentence?
oshima
2016/10/24 20:45:14
Done.
| |
131 // |radius|. Uses SetAlphaShape to mask the header. | 125 void HideHeader(); |
132 void HideHeaderAndSetShape(int radius); | |
133 | 126 |
134 // Restores original window shape and removes the mask if installed. Safe to | 127 // Shows the window header that is hidden by HideHeader(); |
varkha
2016/10/21 14:17:15
s/;/.
oshima
2016/10/24 20:45:14
Done.
| |
135 // call even if HideHeaderAndSetShape() has not been called. | 128 void ShowHeader(); |
136 void ShowHeaderAndResetShape(); | |
137 | 129 |
138 WmWindow* window() const { return window_; } | 130 WmWindow* window() const { return window_; } |
139 | 131 |
140 // Closes the transient root of the window managed by |this|. | 132 // Closes the transient root of the window managed by |this|. |
141 void Close(); | 133 void Close(); |
142 | 134 |
143 private: | 135 private: |
144 friend class WindowSelectorTest; | 136 friend class WindowSelectorTest; |
145 | 137 |
146 enum OriginalVisibility { | 138 enum OriginalVisibility { |
(...skipping 29 matching lines...) Expand all Loading... | |
176 bool ignored_by_shelf_; | 168 bool ignored_by_shelf_; |
177 | 169 |
178 // True if the window has been transformed for overview mode. | 170 // True if the window has been transformed for overview mode. |
179 bool overview_started_; | 171 bool overview_started_; |
180 | 172 |
181 // The original transform of the window before entering overview mode. | 173 // The original transform of the window before entering overview mode. |
182 gfx::Transform original_transform_; | 174 gfx::Transform original_transform_; |
183 | 175 |
184 // Keeps track of the original transform used when |this| has been positioned | 176 // Keeps track of the original transform used when |this| has been positioned |
185 // during SelectorItem layout. | 177 // during SelectorItem layout. |
186 gfx::Transform overview_transform_; | 178 gfx::Transform overview_transform_; |
varkha
2016/10/21 14:19:55
nit: Did you mean to remove this?
oshima
2016/10/24 20:45:14
Yes. Done.
| |
187 | 179 |
188 // The original opacity of the window before entering overview mode. | 180 // The original opacity of the window before entering overview mode. |
189 float original_opacity_; | 181 float original_opacity_; |
190 | 182 |
191 base::WeakPtrFactory<ScopedTransformOverviewWindow> weak_ptr_factory_; | 183 base::WeakPtrFactory<ScopedTransformOverviewWindow> weak_ptr_factory_; |
192 | 184 |
193 DISALLOW_COPY_AND_ASSIGN(ScopedTransformOverviewWindow); | 185 DISALLOW_COPY_AND_ASSIGN(ScopedTransformOverviewWindow); |
194 }; | 186 }; |
195 | 187 |
196 } // namespace ash | 188 } // namespace ash |
197 | 189 |
198 #endif // ASH_COMMON_WM_OVERVIEW_SCOPED_TRANSFORM_OVERVIEW_WINDOW_H_ | 190 #endif // ASH_COMMON_WM_OVERVIEW_SCOPED_TRANSFORM_OVERVIEW_WINDOW_H_ |
OLD | NEW |