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_WM_OVERVIEW_WINDOW_SELECTOR_ITEM_H_ | 5 #ifndef ASH_WM_OVERVIEW_WINDOW_SELECTOR_ITEM_H_ |
6 #define ASH_WM_OVERVIEW_WINDOW_SELECTOR_ITEM_H_ | 6 #define ASH_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 11 matching lines...) Expand all Loading... |
22 class SlideAnimation; | 22 class SlideAnimation; |
23 } | 23 } |
24 | 24 |
25 namespace views { | 25 namespace views { |
26 class ImageButton; | 26 class ImageButton; |
27 } | 27 } |
28 | 28 |
29 namespace ash { | 29 namespace ash { |
30 | 30 |
31 class WindowSelector; | 31 class WindowSelector; |
32 class WmWindow; | |
33 | 32 |
34 // This class represents an item in overview mode. | 33 // This class represents an item in overview mode. |
35 class ASH_EXPORT WindowSelectorItem : public views::ButtonListener, | 34 class ASH_EXPORT WindowSelectorItem : public views::ButtonListener, |
36 public aura::WindowObserver { | 35 public aura::WindowObserver { |
37 public: | 36 public: |
38 // An image button with a close window icon. | 37 // An image button with a close window icon. |
39 class OverviewCloseButton : public views::ImageButton { | 38 class OverviewCloseButton : public views::ImageButton { |
40 public: | 39 public: |
41 explicit OverviewCloseButton(views::ButtonListener* listener); | 40 explicit OverviewCloseButton(views::ButtonListener* listener); |
42 ~OverviewCloseButton() override; | 41 ~OverviewCloseButton() override; |
43 | 42 |
44 // Resets the listener so that the listener can go out of scope. | 43 // Resets the listener so that the listener can go out of scope. |
45 void ResetListener() { listener_ = nullptr; } | 44 void ResetListener() { listener_ = nullptr; } |
46 | 45 |
47 private: | 46 private: |
48 DISALLOW_COPY_AND_ASSIGN(OverviewCloseButton); | 47 DISALLOW_COPY_AND_ASSIGN(OverviewCloseButton); |
49 }; | 48 }; |
50 | 49 |
51 WindowSelectorItem(WmWindow* window, WindowSelector* window_selector); | 50 WindowSelectorItem(aura::Window* window, WindowSelector* window_selector); |
52 ~WindowSelectorItem() override; | 51 ~WindowSelectorItem() override; |
53 | 52 |
54 WmWindow* GetWindow(); | 53 aura::Window* GetWindow(); |
55 | 54 |
56 // Returns the root window on which this item is shown. | 55 // Returns the root window on which this item is shown. |
57 WmWindow* root_window() { return root_window_; } | 56 aura::Window* root_window() { return root_window_; } |
58 | 57 |
59 // Returns true if |target| is contained in this WindowSelectorItem. | 58 // Returns true if |target| is contained in this WindowSelectorItem. |
60 bool Contains(const WmWindow* target) const; | 59 bool Contains(const aura::Window* target) const; |
61 | 60 |
62 // Restores and animates the managed window to its non overview mode state. | 61 // Restores and animates the managed window to its non overview mode state. |
63 void RestoreWindow(); | 62 void RestoreWindow(); |
64 | 63 |
65 // Ensures that a possibly minimized window becomes visible after restore. | 64 // Ensures that a possibly minimized window becomes visible after restore. |
66 void EnsureVisible(); | 65 void EnsureVisible(); |
67 | 66 |
68 // Restores stacking of window captions above the windows, then fades out. | 67 // Restores stacking of window captions above the windows, then fades out. |
69 void Shutdown(); | 68 void Shutdown(); |
70 | 69 |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 | 157 |
159 // Updates the accessibility name to match the window title. | 158 // Updates the accessibility name to match the window title. |
160 void UpdateAccessibilityName(); | 159 void UpdateAccessibilityName(); |
161 | 160 |
162 // Fades out a window caption when exiting overview mode. | 161 // Fades out a window caption when exiting overview mode. |
163 void FadeOut(std::unique_ptr<views::Widget> widget); | 162 void FadeOut(std::unique_ptr<views::Widget> widget); |
164 | 163 |
165 // Allows a test to directly set animation state. | 164 // Allows a test to directly set animation state. |
166 gfx::SlideAnimation* GetBackgroundViewAnimation(); | 165 gfx::SlideAnimation* GetBackgroundViewAnimation(); |
167 | 166 |
168 WmWindow* GetOverviewWindowForMinimizedStateForTest(); | 167 aura::Window* GetOverviewWindowForMinimizedStateForTest(); |
169 | 168 |
170 // True if the item is being shown in the overview, false if it's being | 169 // True if the item is being shown in the overview, false if it's being |
171 // filtered. | 170 // filtered. |
172 bool dimmed_; | 171 bool dimmed_; |
173 | 172 |
174 // The root window this item is being displayed on. | 173 // The root window this item is being displayed on. |
175 WmWindow* root_window_; | 174 aura::Window* root_window_; |
176 | 175 |
177 // The contained Window's wrapper. | 176 // The contained Window's wrapper. |
178 ScopedTransformOverviewWindow transform_window_; | 177 ScopedTransformOverviewWindow transform_window_; |
179 | 178 |
180 // The target bounds this selector item is fit within. | 179 // The target bounds this selector item is fit within. |
181 gfx::Rect target_bounds_; | 180 gfx::Rect target_bounds_; |
182 | 181 |
183 // True if running SetItemBounds. This prevents recursive calls resulting from | 182 // True if running SetItemBounds. This prevents recursive calls resulting from |
184 // the bounds update when calling ::wm::RecreateWindowLayers to copy | 183 // the bounds update when calling ::wm::RecreateWindowLayers to copy |
185 // a window layer for display on another monitor. | 184 // a window layer for display on another monitor. |
(...skipping 29 matching lines...) Expand all Loading... |
215 // corners. This view can have its color and opacity animated. It has a layer | 214 // corners. This view can have its color and opacity animated. It has a layer |
216 // which is the only textured layer used by the |item_widget_|. | 215 // which is the only textured layer used by the |item_widget_|. |
217 RoundedContainerView* background_view_; | 216 RoundedContainerView* background_view_; |
218 | 217 |
219 DISALLOW_COPY_AND_ASSIGN(WindowSelectorItem); | 218 DISALLOW_COPY_AND_ASSIGN(WindowSelectorItem); |
220 }; | 219 }; |
221 | 220 |
222 } // namespace ash | 221 } // namespace ash |
223 | 222 |
224 #endif // ASH_WM_OVERVIEW_WINDOW_SELECTOR_ITEM_H_ | 223 #endif // ASH_WM_OVERVIEW_WINDOW_SELECTOR_ITEM_H_ |
OLD | NEW |