Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(315)

Side by Side Diff: ash/common/wm/overview/window_selector.cc

Issue 2115663002: Folds methods in WmShellCommon to WmShell (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 438 matching lines...) Expand 10 before | Expand all | Expand 10 after
449 // need to select a window on the newly selected grid. 449 // need to select a window on the newly selected grid.
450 if (selected_grid_index_ == index - 1) 450 if (selected_grid_index_ == index - 1)
451 Move(LEFT, true); 451 Move(LEFT, true);
452 } 452 }
453 if (grid_list_.empty()) 453 if (grid_list_.empty())
454 CancelSelection(); 454 CancelSelection();
455 } 455 }
456 456
457 void WindowSelector::SelectWindow(WmWindow* window) { 457 void WindowSelector::SelectWindow(WmWindow* window) {
458 std::vector<WmWindow*> window_list = 458 std::vector<WmWindow*> window_list =
459 WmShell::Get()->GetMruWindowTracker()->BuildMruWindowList(); 459 WmShell::Get()->mru_window_tracker()->BuildMruWindowList();
460 if (!window_list.empty()) { 460 if (!window_list.empty()) {
461 // Record UMA_WINDOW_OVERVIEW_ACTIVE_WINDOW_CHANGED if the user is selecting 461 // Record UMA_WINDOW_OVERVIEW_ACTIVE_WINDOW_CHANGED if the user is selecting
462 // a window other than the window that was active prior to entering overview 462 // a window other than the window that was active prior to entering overview
463 // mode (i.e., the window at the front of the MRU list). 463 // mode (i.e., the window at the front of the MRU list).
464 if (window_list[0] != window) { 464 if (window_list[0] != window) {
465 WmShell::Get()->RecordUserMetricsAction( 465 WmShell::Get()->RecordUserMetricsAction(
466 UMA_WINDOW_OVERVIEW_ACTIVE_WINDOW_CHANGED); 466 UMA_WINDOW_OVERVIEW_ACTIVE_WINDOW_CHANGED);
467 } 467 }
468 const auto it = std::find(window_list.begin(), window_list.end(), window); 468 const auto it = std::find(window_list.begin(), window_list.end(), window);
469 if (it != window_list.end()) { 469 if (it != window_list.end()) {
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
687 for (size_t i = 0; i <= grid_list_.size() && 687 for (size_t i = 0; i <= grid_list_.size() &&
688 grid_list_[selected_grid_index_]->Move(direction, animate); 688 grid_list_[selected_grid_index_]->Move(direction, animate);
689 i++) { 689 i++) {
690 selected_grid_index_ = 690 selected_grid_index_ =
691 (selected_grid_index_ + display_direction + grid_list_.size()) % 691 (selected_grid_index_ + display_direction + grid_list_.size()) %
692 grid_list_.size(); 692 grid_list_.size();
693 } 693 }
694 } 694 }
695 695
696 } // namespace ash 696 } // namespace ash
OLDNEW
« no previous file with comments | « ash/common/wm/maximize_mode/maximize_mode_window_manager.cc ('k') | ash/common/wm/overview/window_selector_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698