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 #include "ash/wm/overview/window_grid.h" | 5 #include "ash/wm/overview/window_grid.h" |
6 | 6 |
7 #include "ash/screen_util.h" | 7 #include "ash/screen_util.h" |
8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
9 #include "ash/shell_window_ids.h" | 9 #include "ash/shell_window_ids.h" |
10 #include "ash/wm/overview/scoped_transform_overview_window.h" | 10 #include "ash/wm/overview/scoped_transform_overview_window.h" |
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
301 (*iter)->RemoveWindow(window); | 301 (*iter)->RemoveWindow(window); |
302 | 302 |
303 // If there are still windows in this selector entry then the overview is | 303 // If there are still windows in this selector entry then the overview is |
304 // still active and the active selection remains the same. | 304 // still active and the active selection remains the same. |
305 if (!(*iter)->empty()) | 305 if (!(*iter)->empty()) |
306 return; | 306 return; |
307 | 307 |
308 size_t removed_index = iter - window_list_.begin(); | 308 size_t removed_index = iter - window_list_.begin(); |
309 window_list_.erase(iter); | 309 window_list_.erase(iter); |
310 | 310 |
| 311 // Record that an item has been removed for statistical purposes. |
| 312 window_selector_->on_window_removed(); |
| 313 |
311 if (empty()) { | 314 if (empty()) { |
312 // If the grid is now empty, notify the window selector so that it erases us | 315 // If the grid is now empty, notify the window selector so that it erases us |
313 // from its grid list. | 316 // from its grid list. |
314 window_selector_->OnGridEmpty(this); | 317 window_selector_->OnGridEmpty(this); |
315 return; | 318 return; |
316 } | 319 } |
317 | 320 |
318 // If selecting, update the selection index. | 321 // If selecting, update the selection index. |
319 if (selection_widget_) { | 322 if (selection_widget_) { |
320 bool send_focus_alert = selected_index_ == removed_index; | 323 bool send_focus_alert = selected_index_ == removed_index; |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
430 ui::LayerAnimator::IMMEDIATELY_ANIMATE_TO_NEW_TARGET); | 433 ui::LayerAnimator::IMMEDIATELY_ANIMATE_TO_NEW_TARGET); |
431 selection_widget_->SetBounds(SelectedWindow()->target_bounds()); | 434 selection_widget_->SetBounds(SelectedWindow()->target_bounds()); |
432 selection_widget_->SetOpacity(kWindowOverviewSelectorOpacity); | 435 selection_widget_->SetOpacity(kWindowOverviewSelectorOpacity); |
433 return; | 436 return; |
434 } | 437 } |
435 selection_widget_->SetBounds(SelectedWindow()->target_bounds()); | 438 selection_widget_->SetBounds(SelectedWindow()->target_bounds()); |
436 selection_widget_->SetOpacity(kWindowOverviewSelectorOpacity); | 439 selection_widget_->SetOpacity(kWindowOverviewSelectorOpacity); |
437 } | 440 } |
438 | 441 |
439 } // namespace ash | 442 } // namespace ash |
OLD | NEW |