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

Side by Side Diff: ash/common/wm/overview/window_selector_controller.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
« no previous file with comments | « ash/common/wm/overview/window_selector.cc ('k') | ash/common/wm/window_positioner.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_controller.h" 5 #include "ash/common/wm/overview/window_selector_controller.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "ash/common/session/session_state_delegate.h" 9 #include "ash/common/session/session_state_delegate.h"
10 #include "ash/common/system/tray/system_tray_delegate.h" 10 #include "ash/common/system/tray/system_tray_delegate.h"
(...skipping 26 matching lines...) Expand all
37 37
38 void WindowSelectorController::ToggleOverview() { 38 void WindowSelectorController::ToggleOverview() {
39 if (IsSelecting()) { 39 if (IsSelecting()) {
40 OnSelectionEnded(); 40 OnSelectionEnded();
41 } else { 41 } else {
42 // Don't start overview if window selection is not allowed. 42 // Don't start overview if window selection is not allowed.
43 if (!CanSelect()) 43 if (!CanSelect())
44 return; 44 return;
45 45
46 std::vector<WmWindow*> windows = 46 std::vector<WmWindow*> windows =
47 WmShell::Get()->GetMruWindowTracker()->BuildMruWindowList(); 47 WmShell::Get()->mru_window_tracker()->BuildMruWindowList();
48 auto end = 48 auto end =
49 std::remove_if(windows.begin(), windows.end(), 49 std::remove_if(windows.begin(), windows.end(),
50 std::not1(std::ptr_fun(&WindowSelector::IsSelectable))); 50 std::not1(std::ptr_fun(&WindowSelector::IsSelectable)));
51 windows.resize(end - windows.begin()); 51 windows.resize(end - windows.begin());
52 52
53 // Don't enter overview mode with no windows. 53 // Don't enter overview mode with no windows.
54 if (windows.empty()) 54 if (windows.empty())
55 return; 55 return;
56 56
57 WmShell::Get()->OnOverviewModeStarting(); 57 WmShell::Get()->OnOverviewModeStarting();
(...skipping 22 matching lines...) Expand all
80 } 80 }
81 81
82 void WindowSelectorController::OnSelectionStarted() { 82 void WindowSelectorController::OnSelectionStarted() {
83 if (!last_selection_time_.is_null()) { 83 if (!last_selection_time_.is_null()) {
84 UMA_HISTOGRAM_LONG_TIMES("Ash.WindowSelector.TimeBetweenUse", 84 UMA_HISTOGRAM_LONG_TIMES("Ash.WindowSelector.TimeBetweenUse",
85 base::Time::Now() - last_selection_time_); 85 base::Time::Now() - last_selection_time_);
86 } 86 }
87 } 87 }
88 88
89 } // namespace ash 89 } // namespace ash
OLDNEW
« no previous file with comments | « ash/common/wm/overview/window_selector.cc ('k') | ash/common/wm/window_positioner.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698