| 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_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_controller.h" | 9 #include "ash/common/session/session_controller.h" |
| 10 #include "ash/common/system/tray/system_tray_delegate.h" | 10 #include "ash/common/system/tray/system_tray_delegate.h" |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 | 47 |
| 48 bool WindowSelectorController::ToggleOverview() { | 48 bool WindowSelectorController::ToggleOverview() { |
| 49 if (IsSelecting()) { | 49 if (IsSelecting()) { |
| 50 OnSelectionEnded(); | 50 OnSelectionEnded(); |
| 51 } else { | 51 } else { |
| 52 // Don't start overview if window selection is not allowed. | 52 // Don't start overview if window selection is not allowed. |
| 53 if (!CanSelect()) | 53 if (!CanSelect()) |
| 54 return false; | 54 return false; |
| 55 | 55 |
| 56 std::vector<WmWindow*> windows = | 56 std::vector<WmWindow*> windows = |
| 57 WmShell::Get()->mru_window_tracker()->BuildMruWindowList(); | 57 Shell::Get()->mru_window_tracker()->BuildMruWindowList(); |
| 58 auto end = | 58 auto end = |
| 59 std::remove_if(windows.begin(), windows.end(), | 59 std::remove_if(windows.begin(), windows.end(), |
| 60 std::not1(std::ptr_fun(&WindowSelector::IsSelectable))); | 60 std::not1(std::ptr_fun(&WindowSelector::IsSelectable))); |
| 61 windows.resize(end - windows.begin()); | 61 windows.resize(end - windows.begin()); |
| 62 | 62 |
| 63 // Don't enter overview mode with no windows. | 63 // Don't enter overview mode with no windows. |
| 64 if (windows.empty()) | 64 if (windows.empty()) |
| 65 return false; | 65 return false; |
| 66 | 66 |
| 67 Shell::GetInstance()->NotifyOverviewModeStarting(); | 67 Shell::GetInstance()->NotifyOverviewModeStarting(); |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 } | 126 } |
| 127 | 127 |
| 128 void WindowSelectorController::OnSelectionStarted() { | 128 void WindowSelectorController::OnSelectionStarted() { |
| 129 if (!last_selection_time_.is_null()) { | 129 if (!last_selection_time_.is_null()) { |
| 130 UMA_HISTOGRAM_LONG_TIMES("Ash.WindowSelector.TimeBetweenUse", | 130 UMA_HISTOGRAM_LONG_TIMES("Ash.WindowSelector.TimeBetweenUse", |
| 131 base::Time::Now() - last_selection_time_); | 131 base::Time::Now() - last_selection_time_); |
| 132 } | 132 } |
| 133 } | 133 } |
| 134 | 134 |
| 135 } // namespace ash | 135 } // namespace ash |
| OLD | NEW |