| 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/wm/overview/window_selector.h" | 5 #include "ash/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> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "ash/common/accessibility_delegate.h" | 13 #include "ash/common/accessibility_delegate.h" |
| 14 #include "ash/common/accessibility_types.h" |
| 14 #include "ash/common/ash_switches.h" | 15 #include "ash/common/ash_switches.h" |
| 15 #include "ash/common/material_design/material_design_controller.h" | 16 #include "ash/common/material_design/material_design_controller.h" |
| 16 #include "ash/common/metrics/user_metrics_action.h" | 17 #include "ash/common/metrics/user_metrics_action.h" |
| 17 #include "ash/common/shelf/wm_shelf.h" | 18 #include "ash/common/shelf/wm_shelf.h" |
| 18 #include "ash/common/shell_window_ids.h" | 19 #include "ash/common/shell_window_ids.h" |
| 19 #include "ash/common/wm/mru_window_tracker.h" | 20 #include "ash/common/wm/mru_window_tracker.h" |
| 20 #include "ash/common/wm/panels/panel_layout_manager.h" | 21 #include "ash/common/wm/panels/panel_layout_manager.h" |
| 21 #include "ash/common/wm/switchable_windows.h" | 22 #include "ash/common/wm/switchable_windows.h" |
| 22 #include "ash/common/wm/window_state.h" | 23 #include "ash/common/wm/window_state.h" |
| 23 #include "ash/common/wm/wm_screen_util.h" | 24 #include "ash/common/wm/wm_screen_util.h" |
| (...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 364 | 365 |
| 365 DCHECK(!grid_list_.empty()); | 366 DCHECK(!grid_list_.empty()); |
| 366 UMA_HISTOGRAM_COUNTS_100("Ash.WindowSelector.Items", num_items_); | 367 UMA_HISTOGRAM_COUNTS_100("Ash.WindowSelector.Items", num_items_); |
| 367 | 368 |
| 368 shell->AddActivationObserver(this); | 369 shell->AddActivationObserver(this); |
| 369 | 370 |
| 370 display::Screen::GetScreen()->AddObserver(this); | 371 display::Screen::GetScreen()->AddObserver(this); |
| 371 shell->RecordUserMetricsAction(UMA_WINDOW_OVERVIEW); | 372 shell->RecordUserMetricsAction(UMA_WINDOW_OVERVIEW); |
| 372 // Send an a11y alert. | 373 // Send an a11y alert. |
| 373 WmShell::Get()->GetAccessibilityDelegate()->TriggerAccessibilityAlert( | 374 WmShell::Get()->GetAccessibilityDelegate()->TriggerAccessibilityAlert( |
| 374 ui::A11Y_ALERT_WINDOW_OVERVIEW_MODE_ENTERED); | 375 A11Y_ALERT_WINDOW_OVERVIEW_MODE_ENTERED); |
| 375 | 376 |
| 376 UpdateShelfVisibility(); | 377 UpdateShelfVisibility(); |
| 377 } | 378 } |
| 378 | 379 |
| 379 // 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 |
| 380 // may cause other, unrelated classes, (ie PanelLayoutManager) to make indirect | 381 // may cause other, unrelated classes, (ie PanelLayoutManager) to make indirect |
| 381 // calls to restoring_minimized_windows() on a partially destructed object. | 382 // calls to restoring_minimized_windows() on a partially destructed object. |
| 382 void WindowSelector::Shutdown() { | 383 void WindowSelector::Shutdown() { |
| 383 ResetFocusRestoreWindow(true); | 384 ResetFocusRestoreWindow(true); |
| 384 RemoveAllObservers(); | 385 RemoveAllObservers(); |
| (...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 680 for (size_t i = 0; | 681 for (size_t i = 0; |
| 681 i <= grid_list_.size() && | 682 i <= grid_list_.size() && |
| 682 grid_list_[selected_grid_index_]->Move(direction, animate); i++) { | 683 grid_list_[selected_grid_index_]->Move(direction, animate); i++) { |
| 683 selected_grid_index_ = | 684 selected_grid_index_ = |
| 684 (selected_grid_index_ + display_direction + grid_list_.size()) % | 685 (selected_grid_index_ + display_direction + grid_list_.size()) % |
| 685 grid_list_.size(); | 686 grid_list_.size(); |
| 686 } | 687 } |
| 687 } | 688 } |
| 688 | 689 |
| 689 } // namespace ash | 690 } // namespace ash |
| OLD | NEW |