| 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 403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 414 bool WindowSelector::AcceptSelection() { | 414 bool WindowSelector::AcceptSelection() { |
| 415 if (!grid_list_[selected_grid_index_]->is_selecting()) | 415 if (!grid_list_[selected_grid_index_]->is_selecting()) |
| 416 return false; | 416 return false; |
| 417 SelectWindow(grid_list_[selected_grid_index_]->SelectedWindow()); | 417 SelectWindow(grid_list_[selected_grid_index_]->SelectedWindow()); |
| 418 return true; | 418 return true; |
| 419 } | 419 } |
| 420 | 420 |
| 421 void WindowSelector::SelectWindow(WindowSelectorItem* item) { | 421 void WindowSelector::SelectWindow(WindowSelectorItem* item) { |
| 422 WmWindow* window = item->GetWindow(); | 422 WmWindow* window = item->GetWindow(); |
| 423 std::vector<WmWindow*> window_list = | 423 std::vector<WmWindow*> window_list = |
| 424 WmShell::Get()->mru_window_tracker()->BuildMruWindowList(); | 424 Shell::Get()->mru_window_tracker()->BuildMruWindowList(); |
| 425 if (!window_list.empty()) { | 425 if (!window_list.empty()) { |
| 426 // Record UMA_WINDOW_OVERVIEW_ACTIVE_WINDOW_CHANGED if the user is selecting | 426 // Record UMA_WINDOW_OVERVIEW_ACTIVE_WINDOW_CHANGED if the user is selecting |
| 427 // a window other than the window that was active prior to entering overview | 427 // a window other than the window that was active prior to entering overview |
| 428 // mode (i.e., the window at the front of the MRU list). | 428 // mode (i.e., the window at the front of the MRU list). |
| 429 if (window_list[0] != window) { | 429 if (window_list[0] != window) { |
| 430 WmShell::Get()->RecordUserMetricsAction( | 430 WmShell::Get()->RecordUserMetricsAction( |
| 431 UMA_WINDOW_OVERVIEW_ACTIVE_WINDOW_CHANGED); | 431 UMA_WINDOW_OVERVIEW_ACTIVE_WINDOW_CHANGED); |
| 432 } | 432 } |
| 433 const auto it = std::find(window_list.begin(), window_list.end(), window); | 433 const auto it = std::find(window_list.begin(), window_list.end(), window); |
| 434 if (it != window_list.end()) { | 434 if (it != window_list.end()) { |
| (...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 680 for (size_t i = 0; i <= grid_list_.size() && | 680 for (size_t i = 0; i <= grid_list_.size() && |
| 681 grid_list_[selected_grid_index_]->Move(direction, animate); | 681 grid_list_[selected_grid_index_]->Move(direction, animate); |
| 682 i++) { | 682 i++) { |
| 683 selected_grid_index_ = | 683 selected_grid_index_ = |
| 684 (selected_grid_index_ + display_direction + grid_list_.size()) % | 684 (selected_grid_index_ + display_direction + grid_list_.size()) % |
| 685 grid_list_.size(); | 685 grid_list_.size(); |
| 686 } | 686 } |
| 687 } | 687 } |
| 688 | 688 |
| 689 } // namespace ash | 689 } // namespace ash |
| OLD | NEW |