| 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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 // so that it's highlighted and announced if accessibility features are | 100 // so that it's highlighted and announced if accessibility features are |
| 101 // enabled. | 101 // enabled. |
| 102 void SendAccessibleSelectionEvent(); | 102 void SendAccessibleSelectionEvent(); |
| 103 | 103 |
| 104 // Sets if the item is dimmed in the overview. Changing the value will also | 104 // Sets if the item is dimmed in the overview. Changing the value will also |
| 105 // change the visibility of the transform windows. | 105 // change the visibility of the transform windows. |
| 106 void SetDimmed(bool dimmed); | 106 void SetDimmed(bool dimmed); |
| 107 bool dimmed() const { return dimmed_; } | 107 bool dimmed() const { return dimmed_; } |
| 108 | 108 |
| 109 const gfx::Rect& target_bounds() const { return target_bounds_; } | 109 const gfx::Rect& target_bounds() const { return target_bounds_; } |
| 110 static void set_use_mask(bool use_mask) { use_mask_ = use_mask; } |
| 111 static void set_use_shape(bool use_shape) { use_shape_ = use_shape; } |
| 110 | 112 |
| 111 // views::ButtonListener: | 113 // views::ButtonListener: |
| 112 void ButtonPressed(views::Button* sender, const ui::Event& event) override; | 114 void ButtonPressed(views::Button* sender, const ui::Event& event) override; |
| 113 | 115 |
| 114 // WmWindowObserver: | 116 // WmWindowObserver: |
| 115 void OnWindowDestroying(WmWindow* window) override; | 117 void OnWindowDestroying(WmWindow* window) override; |
| 116 void OnWindowTitleChanged(WmWindow* window) override; | 118 void OnWindowTitleChanged(WmWindow* window) override; |
| 117 | 119 |
| 118 private: | 120 private: |
| 119 class CaptionContainerView; | 121 class CaptionContainerView; |
| (...skipping 20 matching lines...) Expand all Loading... |
| 140 // |animation_type|. | 142 // |animation_type|. |
| 141 void UpdateHeaderLayout(OverviewAnimationType animation_type); | 143 void UpdateHeaderLayout(OverviewAnimationType animation_type); |
| 142 | 144 |
| 143 // Animates opacity of the |transform_window_| and its caption to |opacity| | 145 // Animates opacity of the |transform_window_| and its caption to |opacity| |
| 144 // using |animation_type|. | 146 // using |animation_type|. |
| 145 void AnimateOpacity(float opacity, OverviewAnimationType animation_type); | 147 void AnimateOpacity(float opacity, OverviewAnimationType animation_type); |
| 146 | 148 |
| 147 // Updates the close buttons accessibility name. | 149 // Updates the close buttons accessibility name. |
| 148 void UpdateCloseButtonAccessibilityName(); | 150 void UpdateCloseButtonAccessibilityName(); |
| 149 | 151 |
| 152 static bool hide_header() { return use_mask_ || use_shape_; } |
| 153 |
| 150 // True if the item is being shown in the overview, false if it's being | 154 // True if the item is being shown in the overview, false if it's being |
| 151 // filtered. | 155 // filtered. |
| 152 bool dimmed_; | 156 bool dimmed_; |
| 153 | 157 |
| 154 // The root window this item is being displayed on. | 158 // The root window this item is being displayed on. |
| 155 WmWindow* root_window_; | 159 WmWindow* root_window_; |
| 156 | 160 |
| 157 // The contained Window's wrapper. | 161 // The contained Window's wrapper. |
| 158 ScopedTransformOverviewWindow transform_window_; | 162 ScopedTransformOverviewWindow transform_window_; |
| 159 | 163 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 186 | 190 |
| 187 // A close button for the window in this item. Owned by the | 191 // A close button for the window in this item. Owned by the |
| 188 // |caption_container_view_| with Material Design or by |close_button_widget_| | 192 // |caption_container_view_| with Material Design or by |close_button_widget_| |
| 189 // otherwise. | 193 // otherwise. |
| 190 views::ImageButton* close_button_; | 194 views::ImageButton* close_button_; |
| 191 | 195 |
| 192 // Pointer to the WindowSelector that owns the WindowGrid containing |this|. | 196 // Pointer to the WindowSelector that owns the WindowGrid containing |this|. |
| 193 // Guaranteed to be non-null for the lifetime of |this|. | 197 // Guaranteed to be non-null for the lifetime of |this|. |
| 194 WindowSelector* window_selector_; | 198 WindowSelector* window_selector_; |
| 195 | 199 |
| 200 // If true, mask the original window header while in overview and make corners |
| 201 // rounded using a mask layer. This has performance implications so it can be |
| 202 // disabled when there are many windows. |
| 203 static bool use_mask_; |
| 204 |
| 205 // If true, hide the original window header while in overview using alpha |
| 206 // shape. This has performance implications so it can be disabled when there |
| 207 // are many windows. |
| 208 static bool use_shape_; |
| 209 |
| 196 DISALLOW_COPY_AND_ASSIGN(WindowSelectorItem); | 210 DISALLOW_COPY_AND_ASSIGN(WindowSelectorItem); |
| 197 }; | 211 }; |
| 198 | 212 |
| 199 } // namespace ash | 213 } // namespace ash |
| 200 | 214 |
| 201 #endif // ASH_COMMON_WM_OVERVIEW_WINDOW_SELECTOR_ITEM_H_ | 215 #endif // ASH_COMMON_WM_OVERVIEW_WINDOW_SELECTOR_ITEM_H_ |
| OLD | NEW |