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_WINDOW_SELECTOR_ITEM_H_ | 5 #ifndef ASH_COMMON_WM_OVERVIEW_WINDOW_SELECTOR_ITEM_H_ |
6 #define ASH_COMMON_WM_OVERVIEW_WINDOW_SELECTOR_ITEM_H_ | 6 #define ASH_COMMON_WM_OVERVIEW_WINDOW_SELECTOR_ITEM_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "ash/ash_export.h" | 10 #include "ash/ash_export.h" |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 // by |animation_type|. | 120 // by |animation_type|. |
121 void SetBounds(const gfx::Rect& target_bounds, | 121 void SetBounds(const gfx::Rect& target_bounds, |
122 OverviewAnimationType animation_type); | 122 OverviewAnimationType animation_type); |
123 | 123 |
124 // Activates or deactivates selection depending on |selected|. | 124 // Activates or deactivates selection depending on |selected|. |
125 // Currently does nothing unless Material Design is enabled. With Material | 125 // Currently does nothing unless Material Design is enabled. With Material |
126 // Design the item's caption is shown transparent in selected state and blends | 126 // Design the item's caption is shown transparent in selected state and blends |
127 // with the selection widget. | 127 // with the selection widget. |
128 void SetSelected(bool selected); | 128 void SetSelected(bool selected); |
129 | 129 |
130 // Recomputes the positions for the windows in this selection item. This is | |
131 // dispatched when the bounds of a window change. | |
132 void RecomputeWindowTransforms(); | |
133 | |
134 // Sends an accessibility event indicating that this window became selected | 130 // Sends an accessibility event indicating that this window became selected |
135 // so that it's highlighted and announced if accessibility features are | 131 // so that it's highlighted and announced if accessibility features are |
136 // enabled. | 132 // enabled. |
137 void SendAccessibleSelectionEvent(); | 133 void SendAccessibleSelectionEvent(); |
138 | 134 |
139 // Closes |transform_window_|. | 135 // Closes |transform_window_|. |
140 void CloseWindow(); | 136 void CloseWindow(); |
141 | 137 |
142 // Hides the original window header and sets shape or mask on a window. | 138 // Hides the original window header and sets shape or mask on a window. |
143 // When masks are used, rounded corner |radius| can be specified. | 139 // When masks are used, rounded corner |radius| can be specified. |
144 // TODO(varkha): remove |radius|. | 140 // TODO(varkha): remove |radius|. |
145 void HideHeaderAndSetShape(int radius); | 141 void HideHeaderAndSetShape(int radius); |
146 | 142 |
147 // Sets if the item is dimmed in the overview. Changing the value will also | 143 // Sets if the item is dimmed in the overview. Changing the value will also |
148 // change the visibility of the transform windows. | 144 // change the visibility of the transform windows. |
149 void SetDimmed(bool dimmed); | 145 void SetDimmed(bool dimmed); |
150 bool dimmed() const { return dimmed_; } | 146 bool dimmed() const { return dimmed_; } |
151 | 147 |
152 const gfx::Rect& target_bounds() const { return target_bounds_; } | 148 const gfx::Rect& target_bounds() const { return target_bounds_; } |
153 static void set_use_mask(bool use_mask) { use_mask_ = use_mask; } | |
154 static void set_use_shape(bool use_shape) { use_shape_ = use_shape; } | |
155 | 149 |
156 // views::ButtonListener: | 150 // views::ButtonListener: |
157 void ButtonPressed(views::Button* sender, const ui::Event& event) override; | 151 void ButtonPressed(views::Button* sender, const ui::Event& event) override; |
158 | 152 |
159 // WmWindowObserver: | 153 // WmWindowObserver: |
160 void OnWindowDestroying(WmWindow* window) override; | 154 void OnWindowDestroying(WmWindow* window) override; |
161 void OnWindowTitleChanged(WmWindow* window) override; | 155 void OnWindowTitleChanged(WmWindow* window) override; |
162 | 156 |
163 private: | 157 private: |
164 class CaptionContainerView; | 158 class CaptionContainerView; |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 | 195 |
202 // Updates the close buttons accessibility name. | 196 // Updates the close buttons accessibility name. |
203 void UpdateCloseButtonAccessibilityName(); | 197 void UpdateCloseButtonAccessibilityName(); |
204 | 198 |
205 // Fades out a window caption when exiting overview mode. | 199 // Fades out a window caption when exiting overview mode. |
206 void FadeOut(std::unique_ptr<views::Widget> widget); | 200 void FadeOut(std::unique_ptr<views::Widget> widget); |
207 | 201 |
208 // Allows a test to directly set animation state. | 202 // Allows a test to directly set animation state. |
209 gfx::SlideAnimation* GetBackgroundViewAnimation(); | 203 gfx::SlideAnimation* GetBackgroundViewAnimation(); |
210 | 204 |
211 static bool hide_header() { return use_mask_ || use_shape_; } | |
212 | |
213 // True if the item is being shown in the overview, false if it's being | 205 // True if the item is being shown in the overview, false if it's being |
214 // filtered. | 206 // filtered. |
215 bool dimmed_; | 207 bool dimmed_; |
216 | 208 |
217 // The root window this item is being displayed on. | 209 // The root window this item is being displayed on. |
218 WmWindow* root_window_; | 210 WmWindow* root_window_; |
219 | 211 |
220 // The contained Window's wrapper. | 212 // The contained Window's wrapper. |
221 ScopedTransformOverviewWindow transform_window_; | 213 ScopedTransformOverviewWindow transform_window_; |
222 | 214 |
(...skipping 18 matching lines...) Expand all Loading... |
241 // Shadow around the item in overview. | 233 // Shadow around the item in overview. |
242 std::unique_ptr<::wm::Shadow> shadow_; | 234 std::unique_ptr<::wm::Shadow> shadow_; |
243 | 235 |
244 // Container view that owns |window_label_button_view_| and |close_button_|. | 236 // Container view that owns |window_label_button_view_| and |close_button_|. |
245 // Only used with Material Design. | 237 // Only used with Material Design. |
246 CaptionContainerView* caption_container_view_; | 238 CaptionContainerView* caption_container_view_; |
247 | 239 |
248 // View for the label below the window or (with material design) above it. | 240 // View for the label below the window or (with material design) above it. |
249 OverviewLabelButton* window_label_button_view_; | 241 OverviewLabelButton* window_label_button_view_; |
250 | 242 |
251 // The close buttons widget container. Not used with Material Design. | |
252 std::unique_ptr<views::Widget> close_button_widget_; | |
253 | |
254 // A close button for the window in this item. Owned by the | 243 // A close button for the window in this item. Owned by the |
255 // |caption_container_view_| with Material Design or by |close_button_widget_| | 244 // |caption_container_view_| with Material Design or by |close_button_widget_| |
256 // otherwise. | 245 // otherwise. |
257 OverviewCloseButton* close_button_; | 246 OverviewCloseButton* close_button_; |
258 | 247 |
259 // Pointer to the WindowSelector that owns the WindowGrid containing |this|. | 248 // Pointer to the WindowSelector that owns the WindowGrid containing |this|. |
260 // Guaranteed to be non-null for the lifetime of |this|. | 249 // Guaranteed to be non-null for the lifetime of |this|. |
261 WindowSelector* window_selector_; | 250 WindowSelector* window_selector_; |
262 | 251 |
263 // Pointer to a view that covers the original header and has rounded top | 252 // Pointer to a view that covers the original header and has rounded top |
264 // corners. This view can have its color and opacity animated. | 253 // corners. This view can have its color and opacity animated. |
265 RoundedContainerView* background_view_; | 254 RoundedContainerView* background_view_; |
266 | 255 |
267 // If true, mask the original window header while in overview and make corners | |
268 // rounded using a mask layer. This has performance implications so it can be | |
269 // disabled when there are many windows. | |
270 static bool use_mask_; | |
271 | |
272 // If true, hide the original window header while in overview using alpha | |
273 // shape. This has performance implications so it can be disabled when there | |
274 // are many windows. | |
275 static bool use_shape_; | |
276 | |
277 DISALLOW_COPY_AND_ASSIGN(WindowSelectorItem); | 256 DISALLOW_COPY_AND_ASSIGN(WindowSelectorItem); |
278 }; | 257 }; |
279 | 258 |
280 } // namespace ash | 259 } // namespace ash |
281 | 260 |
282 #endif // ASH_COMMON_WM_OVERVIEW_WINDOW_SELECTOR_ITEM_H_ | 261 #endif // ASH_COMMON_WM_OVERVIEW_WINDOW_SELECTOR_ITEM_H_ |
OLD | NEW |