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 |
11 #include "ash/ash_export.h" | 11 #include "ash/ash_export.h" |
12 #include "ash/common/wm/overview/overview_animation_type.h" | 12 #include "ash/common/wm/overview/overview_animation_type.h" |
13 #include "base/macros.h" | 13 #include "base/macros.h" |
| 14 #include "base/memory/weak_ptr.h" |
14 #include "ui/gfx/geometry/size.h" | 15 #include "ui/gfx/geometry/size.h" |
15 #include "ui/gfx/transform.h" | 16 #include "ui/gfx/transform.h" |
16 | 17 |
17 namespace gfx { | 18 namespace gfx { |
18 class Rect; | 19 class Rect; |
19 } | 20 } |
20 | 21 |
21 namespace ash { | 22 namespace ash { |
22 | 23 |
23 class ScopedOverviewAnimationSettings; | 24 class ScopedOverviewAnimationSettings; |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 | 110 |
110 // Set's the opacity of the managed windows. | 111 // Set's the opacity of the managed windows. |
111 void SetOpacity(float opacity); | 112 void SetOpacity(float opacity); |
112 | 113 |
113 WmWindow* window() const { return window_; } | 114 WmWindow* window() const { return window_; } |
114 | 115 |
115 // Closes the transient root of the window managed by |this|. | 116 // Closes the transient root of the window managed by |this|. |
116 void Close(); | 117 void Close(); |
117 | 118 |
118 private: | 119 private: |
| 120 friend class WindowSelectorTest; |
119 class OverviewContentMask; | 121 class OverviewContentMask; |
120 | 122 |
121 // Shows the window if it was minimized. | 123 // Shows the window if it was minimized. |
122 void ShowWindowIfMinimized(); | 124 void ShowWindowIfMinimized(); |
123 | 125 |
| 126 // Closes the window managed by |this|. |
| 127 void CloseWidget(); |
| 128 |
| 129 // Makes Close() execute synchronously when used in tests. |
| 130 static void SetImmediateCloseForTests(); |
| 131 |
124 // A weak pointer to the real window in the overview. | 132 // A weak pointer to the real window in the overview. |
125 WmWindow* window_; | 133 WmWindow* window_; |
126 | 134 |
127 // Mask layer that hides the original window header. | 135 // Mask layer that hides the original window header. |
128 std::unique_ptr<OverviewContentMask> mask_; | 136 std::unique_ptr<OverviewContentMask> mask_; |
129 | 137 |
130 // If true, the window was minimized and should be restored if the window | 138 // If true, the window was minimized and should be restored if the window |
131 // was not selected. | 139 // was not selected. |
132 bool minimized_; | 140 bool minimized_; |
133 | 141 |
134 // Tracks if this window was ignored by the shelf. | 142 // Tracks if this window was ignored by the shelf. |
135 bool ignored_by_shelf_; | 143 bool ignored_by_shelf_; |
136 | 144 |
137 // True if the window has been transformed for overview mode. | 145 // True if the window has been transformed for overview mode. |
138 bool overview_started_; | 146 bool overview_started_; |
139 | 147 |
140 // The original transform of the window before entering overview mode. | 148 // The original transform of the window before entering overview mode. |
141 gfx::Transform original_transform_; | 149 gfx::Transform original_transform_; |
142 | 150 |
143 // Keeps track of the original transform used when |this| has been positioned | 151 // Keeps track of the original transform used when |this| has been positioned |
144 // during SelectorItem layout. | 152 // during SelectorItem layout. |
145 gfx::Transform overview_transform_; | 153 gfx::Transform overview_transform_; |
146 | 154 |
147 // The original opacity of the window before entering overview mode. | 155 // The original opacity of the window before entering overview mode. |
148 float original_opacity_; | 156 float original_opacity_; |
149 | 157 |
| 158 base::WeakPtrFactory<ScopedTransformOverviewWindow> weak_ptr_factory_; |
| 159 |
150 DISALLOW_COPY_AND_ASSIGN(ScopedTransformOverviewWindow); | 160 DISALLOW_COPY_AND_ASSIGN(ScopedTransformOverviewWindow); |
151 }; | 161 }; |
152 | 162 |
153 } // namespace ash | 163 } // namespace ash |
154 | 164 |
155 #endif // ASH_COMMON_WM_OVERVIEW_SCOPED_TRANSFORM_OVERVIEW_WINDOW_H_ | 165 #endif // ASH_COMMON_WM_OVERVIEW_SCOPED_TRANSFORM_OVERVIEW_WINDOW_H_ |
OLD | NEW |