Chromium Code Reviews| 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_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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 68 window_selector_->Init(windows); | 68 window_selector_->Init(windows); |
| 69 OnSelectionStarted(); | 69 OnSelectionStarted(); |
| 70 } | 70 } |
| 71 return true; | 71 return true; |
| 72 } | 72 } |
| 73 | 73 |
| 74 bool WindowSelectorController::IsSelecting() const { | 74 bool WindowSelectorController::IsSelecting() const { |
| 75 return window_selector_.get() != NULL; | 75 return window_selector_.get() != NULL; |
| 76 } | 76 } |
| 77 | 77 |
| 78 void WindowSelectorController::IncrementSelection(int increment) { | |
| 79 DCHECK(IsSelecting()); | |
| 80 window_selector_->IncrementSelection(increment); | |
| 81 } | |
| 82 | |
| 83 bool WindowSelectorController::AcceptSelection() { | |
| 84 DCHECK(IsSelecting()); | |
|
tdanderson
2017/02/06 20:13:57
Is this necessary given how you've documented Acce
varkha
2017/02/08 20:41:13
WindowSelectorController::IsSelecting is true when
tdanderson
2017/02/08 23:14:19
Acknowledged.
| |
| 85 return window_selector_->AcceptSelection(); | |
| 86 } | |
| 87 | |
| 78 bool WindowSelectorController::IsRestoringMinimizedWindows() const { | 88 bool WindowSelectorController::IsRestoringMinimizedWindows() const { |
| 79 return window_selector_.get() != NULL && | 89 return window_selector_.get() != NULL && |
| 80 window_selector_->restoring_minimized_windows(); | 90 window_selector_->restoring_minimized_windows(); |
| 81 } | 91 } |
| 82 | 92 |
| 83 // TODO(flackr): Make WindowSelectorController observe the activation of | 93 // TODO(flackr): Make WindowSelectorController observe the activation of |
| 84 // windows, so we can remove WindowSelectorDelegate. | 94 // windows, so we can remove WindowSelectorDelegate. |
| 85 void WindowSelectorController::OnSelectionEnded() { | 95 void WindowSelectorController::OnSelectionEnded() { |
| 86 window_selector_->Shutdown(); | 96 window_selector_->Shutdown(); |
| 87 window_selector_.reset(); | 97 window_selector_.reset(); |
| (...skipping 27 matching lines...) Expand all Loading... | |
| 115 } | 125 } |
| 116 | 126 |
| 117 void WindowSelectorController::OnSelectionStarted() { | 127 void WindowSelectorController::OnSelectionStarted() { |
| 118 if (!last_selection_time_.is_null()) { | 128 if (!last_selection_time_.is_null()) { |
| 119 UMA_HISTOGRAM_LONG_TIMES("Ash.WindowSelector.TimeBetweenUse", | 129 UMA_HISTOGRAM_LONG_TIMES("Ash.WindowSelector.TimeBetweenUse", |
| 120 base::Time::Now() - last_selection_time_); | 130 base::Time::Now() - last_selection_time_); |
| 121 } | 131 } |
| 122 } | 132 } |
| 123 | 133 |
| 124 } // namespace ash | 134 } // namespace ash |
| OLD | NEW |