OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_GRID_H_ | 5 #ifndef ASH_COMMON_WM_OVERVIEW_WINDOW_GRID_H_ |
6 #define ASH_COMMON_WM_OVERVIEW_WINDOW_GRID_H_ | 6 #define ASH_COMMON_WM_OVERVIEW_WINDOW_GRID_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
11 #include <set> | 11 #include <set> |
12 #include <vector> | 12 #include <vector> |
13 | 13 |
14 #include "ash/common/wm/overview/window_selector.h" | 14 #include "ash/common/wm/overview/window_selector.h" |
15 #include "ash/common/wm_window_observer.h" | 15 #include "ash/common/wm_window_observer.h" |
16 #include "base/macros.h" | 16 #include "base/macros.h" |
17 #include "base/memory/scoped_vector.h" | 17 #include "base/memory/scoped_vector.h" |
| 18 #include "base/scoped_observer.h" |
18 | 19 |
19 namespace views { | 20 namespace views { |
20 class Widget; | 21 class Widget; |
21 } | 22 } |
22 | 23 |
23 namespace wm { | 24 namespace wm { |
24 class Shadow; | 25 class Shadow; |
25 } | 26 } |
26 | 27 |
27 namespace ash { | 28 namespace ash { |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 | 166 |
166 // Root window the grid is in. | 167 // Root window the grid is in. |
167 WmWindow* root_window_; | 168 WmWindow* root_window_; |
168 | 169 |
169 // Pointer to the window selector that spawned this grid. | 170 // Pointer to the window selector that spawned this grid. |
170 WindowSelector* window_selector_; | 171 WindowSelector* window_selector_; |
171 | 172 |
172 // Vector containing all the windows in this grid. | 173 // Vector containing all the windows in this grid. |
173 ScopedVector<WindowSelectorItem> window_list_; | 174 ScopedVector<WindowSelectorItem> window_list_; |
174 | 175 |
175 // Vector containing the observed windows. | 176 ScopedObserver<WmWindow, WindowGrid> window_observer_; |
176 std::set<WmWindow*> observed_windows_; | |
177 | 177 |
178 // Widget that darkens the screen background. | 178 // Widget that darkens the screen background. |
179 std::unique_ptr<views::Widget> shield_widget_; | 179 std::unique_ptr<views::Widget> shield_widget_; |
180 | 180 |
181 // Widget that indicates to the user which is the selected window. | 181 // Widget that indicates to the user which is the selected window. |
182 std::unique_ptr<views::Widget> selection_widget_; | 182 std::unique_ptr<views::Widget> selection_widget_; |
183 | 183 |
184 // Shadow around the selector. | 184 // Shadow around the selector. |
185 std::unique_ptr<::wm::Shadow> selector_shadow_; | 185 std::unique_ptr<::wm::Shadow> selector_shadow_; |
186 | 186 |
187 // Current selected window position. | 187 // Current selected window position. |
188 size_t selected_index_; | 188 size_t selected_index_; |
189 | 189 |
190 // Number of columns in the grid. | 190 // Number of columns in the grid. |
191 size_t num_columns_; | 191 size_t num_columns_; |
192 | 192 |
| 193 // True only after all windows have been prepared for overview. |
| 194 bool prepared_for_overview_; |
| 195 |
193 DISALLOW_COPY_AND_ASSIGN(WindowGrid); | 196 DISALLOW_COPY_AND_ASSIGN(WindowGrid); |
194 }; | 197 }; |
195 | 198 |
196 } // namespace ash | 199 } // namespace ash |
197 | 200 |
198 #endif // ASH_COMMON_WM_OVERVIEW_WINDOW_GRID_H_ | 201 #endif // ASH_COMMON_WM_OVERVIEW_WINDOW_GRID_H_ |
OLD | NEW |