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 #include "ash/common/wm/overview/window_selector.h" | 5 #include "ash/common/wm/overview/window_selector.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <functional> | 8 #include <functional> |
9 #include <set> | 9 #include <set> |
10 #include <utility> | 10 #include <utility> |
(...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
374 WmShell::Get()->accessibility_delegate()->TriggerAccessibilityAlert( | 374 WmShell::Get()->accessibility_delegate()->TriggerAccessibilityAlert( |
375 A11Y_ALERT_WINDOW_OVERVIEW_MODE_ENTERED); | 375 A11Y_ALERT_WINDOW_OVERVIEW_MODE_ENTERED); |
376 | 376 |
377 UpdateShelfVisibility(); | 377 UpdateShelfVisibility(); |
378 } | 378 } |
379 | 379 |
380 // NOTE: The work done in Shutdown() is not done in the destructor because it | 380 // NOTE: The work done in Shutdown() is not done in the destructor because it |
381 // may cause other, unrelated classes, (ie PanelLayoutManager) to make indirect | 381 // may cause other, unrelated classes, (ie PanelLayoutManager) to make indirect |
382 // calls to restoring_minimized_windows() on a partially destructed object. | 382 // calls to restoring_minimized_windows() on a partially destructed object. |
383 void WindowSelector::Shutdown() { | 383 void WindowSelector::Shutdown() { |
| 384 is_shut_down_ = true; |
384 // Stop observing screen metrics changes first to avoid auto-positioning | 385 // Stop observing screen metrics changes first to avoid auto-positioning |
385 // windows in response to work area changes from window activation. | 386 // windows in response to work area changes from window activation. |
386 display::Screen::GetScreen()->RemoveObserver(this); | 387 display::Screen::GetScreen()->RemoveObserver(this); |
387 | 388 |
388 size_t remaining_items = 0; | 389 size_t remaining_items = 0; |
389 for (std::unique_ptr<WindowGrid>& window_grid : grid_list_) { | 390 for (std::unique_ptr<WindowGrid>& window_grid : grid_list_) { |
390 for (WindowSelectorItem* window_selector_item : window_grid->window_list()) | 391 for (WindowSelectorItem* window_selector_item : window_grid->window_list()) |
391 window_selector_item->RestoreWindow(); | 392 window_selector_item->RestoreWindow(); |
392 remaining_items += window_grid->size(); | 393 remaining_items += window_grid->size(); |
393 } | 394 } |
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
713 for (size_t i = 0; i <= grid_list_.size() && | 714 for (size_t i = 0; i <= grid_list_.size() && |
714 grid_list_[selected_grid_index_]->Move(direction, animate); | 715 grid_list_[selected_grid_index_]->Move(direction, animate); |
715 i++) { | 716 i++) { |
716 selected_grid_index_ = | 717 selected_grid_index_ = |
717 (selected_grid_index_ + display_direction + grid_list_.size()) % | 718 (selected_grid_index_ + display_direction + grid_list_.size()) % |
718 grid_list_.size(); | 719 grid_list_.size(); |
719 } | 720 } |
720 } | 721 } |
721 | 722 |
722 } // namespace ash | 723 } // namespace ash |
OLD | NEW |