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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 | 107 |
108 // Closes |transform_window_|. | 108 // Closes |transform_window_|. |
109 void CloseWindow(); | 109 void CloseWindow(); |
110 | 110 |
111 // Sets if the item is dimmed in the overview. Changing the value will also | 111 // Sets if the item is dimmed in the overview. Changing the value will also |
112 // change the visibility of the transform windows. | 112 // change the visibility of the transform windows. |
113 void SetDimmed(bool dimmed); | 113 void SetDimmed(bool dimmed); |
114 bool dimmed() const { return dimmed_; } | 114 bool dimmed() const { return dimmed_; } |
115 | 115 |
116 const gfx::Rect& target_bounds() const { return target_bounds_; } | 116 const gfx::Rect& target_bounds() const { return target_bounds_; } |
| 117 static void set_use_mask(bool use_mask) { use_mask_ = use_mask; } |
| 118 static void set_use_shape(bool use_shape) { use_shape_ = use_shape; } |
117 | 119 |
118 // views::ButtonListener: | 120 // views::ButtonListener: |
119 void ButtonPressed(views::Button* sender, const ui::Event& event) override; | 121 void ButtonPressed(views::Button* sender, const ui::Event& event) override; |
120 | 122 |
121 // WmWindowObserver: | 123 // WmWindowObserver: |
122 void OnWindowDestroying(WmWindow* window) override; | 124 void OnWindowDestroying(WmWindow* window) override; |
123 void OnWindowTitleChanged(WmWindow* window) override; | 125 void OnWindowTitleChanged(WmWindow* window) override; |
124 | 126 |
125 private: | 127 private: |
126 class CaptionContainerView; | 128 class CaptionContainerView; |
(...skipping 20 matching lines...) Expand all Loading... |
147 // |animation_type|. | 149 // |animation_type|. |
148 void UpdateHeaderLayout(OverviewAnimationType animation_type); | 150 void UpdateHeaderLayout(OverviewAnimationType animation_type); |
149 | 151 |
150 // Animates opacity of the |transform_window_| and its caption to |opacity| | 152 // Animates opacity of the |transform_window_| and its caption to |opacity| |
151 // using |animation_type|. | 153 // using |animation_type|. |
152 void AnimateOpacity(float opacity, OverviewAnimationType animation_type); | 154 void AnimateOpacity(float opacity, OverviewAnimationType animation_type); |
153 | 155 |
154 // Updates the close buttons accessibility name. | 156 // Updates the close buttons accessibility name. |
155 void UpdateCloseButtonAccessibilityName(); | 157 void UpdateCloseButtonAccessibilityName(); |
156 | 158 |
| 159 static bool hide_header() { return use_mask_ || use_shape_; } |
| 160 |
157 // True if the item is being shown in the overview, false if it's being | 161 // True if the item is being shown in the overview, false if it's being |
158 // filtered. | 162 // filtered. |
159 bool dimmed_; | 163 bool dimmed_; |
160 | 164 |
161 // The root window this item is being displayed on. | 165 // The root window this item is being displayed on. |
162 WmWindow* root_window_; | 166 WmWindow* root_window_; |
163 | 167 |
164 // The contained Window's wrapper. | 168 // The contained Window's wrapper. |
165 ScopedTransformOverviewWindow transform_window_; | 169 ScopedTransformOverviewWindow transform_window_; |
166 | 170 |
(...skipping 29 matching lines...) Expand all Loading... |
196 | 200 |
197 // A close button for the window in this item. Owned by the | 201 // A close button for the window in this item. Owned by the |
198 // |caption_container_view_| with Material Design or by |close_button_widget_| | 202 // |caption_container_view_| with Material Design or by |close_button_widget_| |
199 // otherwise. | 203 // otherwise. |
200 views::ImageButton* close_button_; | 204 views::ImageButton* close_button_; |
201 | 205 |
202 // Pointer to the WindowSelector that owns the WindowGrid containing |this|. | 206 // Pointer to the WindowSelector that owns the WindowGrid containing |this|. |
203 // Guaranteed to be non-null for the lifetime of |this|. | 207 // Guaranteed to be non-null for the lifetime of |this|. |
204 WindowSelector* window_selector_; | 208 WindowSelector* window_selector_; |
205 | 209 |
| 210 // If true, mask the original window header while in overview and make corners |
| 211 // rounded using a mask layer. This has performance implications so it can be |
| 212 // disabled when there are many windows. |
| 213 static bool use_mask_; |
| 214 |
| 215 // If true, hide the original window header while in overview using alpha |
| 216 // shape. This has performance implications so it can be disabled when there |
| 217 // are many windows. |
| 218 static bool use_shape_; |
| 219 |
206 DISALLOW_COPY_AND_ASSIGN(WindowSelectorItem); | 220 DISALLOW_COPY_AND_ASSIGN(WindowSelectorItem); |
207 }; | 221 }; |
208 | 222 |
209 } // namespace ash | 223 } // namespace ash |
210 | 224 |
211 #endif // ASH_COMMON_WM_OVERVIEW_WINDOW_SELECTOR_ITEM_H_ | 225 #endif // ASH_COMMON_WM_OVERVIEW_WINDOW_SELECTOR_ITEM_H_ |
OLD | NEW |