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/wm/overview/window_selector_controller.h" | 5 #include "ash/wm/overview/window_selector_controller.h" |
6 | 6 |
7 #include "ash/metrics/user_metrics_recorder.h" | 7 #include "ash/metrics/user_metrics_recorder.h" |
8 #include "ash/root_window_controller.h" | 8 #include "ash/root_window_controller.h" |
9 #include "ash/session/session_state_delegate.h" | 9 #include "ash/session/session_state_delegate.h" |
10 #include "ash/shell.h" | 10 #include "ash/shell.h" |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 } | 60 } |
61 | 61 |
62 // TODO(nsatragno): Make WindowSelectorController observe the activation of | 62 // TODO(nsatragno): Make WindowSelectorController observe the activation of |
63 // windows, so we can remove WindowSelectorDelegate. | 63 // windows, so we can remove WindowSelectorDelegate. |
64 void WindowSelectorController::OnSelectionEnded() { | 64 void WindowSelectorController::OnSelectionEnded() { |
65 window_selector_.reset(); | 65 window_selector_.reset(); |
66 last_selection_time_ = base::Time::Now(); | 66 last_selection_time_ = base::Time::Now(); |
67 } | 67 } |
68 | 68 |
69 void WindowSelectorController::OnSelectionStarted() { | 69 void WindowSelectorController::OnSelectionStarted() { |
70 Shell* shell = Shell::GetInstance(); | |
71 shell->metrics()->RecordUserMetricsAction(UMA_WINDOW_SELECTION); | |
72 if (!last_selection_time_.is_null()) { | 70 if (!last_selection_time_.is_null()) { |
73 UMA_HISTOGRAM_LONG_TIMES( | 71 UMA_HISTOGRAM_LONG_TIMES( |
74 "Ash.WindowSelector.TimeBetweenUse", | 72 "Ash.WindowSelector.TimeBetweenUse", |
75 base::Time::Now() - last_selection_time_); | 73 base::Time::Now() - last_selection_time_); |
76 } | 74 } |
77 } | 75 } |
78 | 76 |
79 } // namespace ash | 77 } // namespace ash |
OLD | NEW |