OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/metrics/task_switch_metrics_recorder.h" | 5 #include "ash/metrics/task_switch_metrics_recorder.h" |
6 | 6 |
7 #include "ash/metrics/task_switch_time_tracker.h" | 7 #include "ash/metrics/task_switch_time_tracker.h" |
8 | 8 |
9 namespace ash { | 9 namespace ash { |
10 | 10 |
11 namespace { | 11 namespace { |
12 | 12 |
13 const char kShelfHistogramName[] = | 13 const char kShelfHistogramName[] = |
14 "Ash.Shelf.TimeBetweenNavigateToTaskSwitches"; | 14 "Ash.Shelf.TimeBetweenNavigateToTaskSwitches"; |
15 | 15 |
| 16 const char kAcceleratorWindowCycleHistogramName[] = |
| 17 "Ash.WindowCycleController.TimeBetweenTaskSwitches"; |
| 18 |
16 // Returns the histogram name for the given |task_switch_source|. | 19 // Returns the histogram name for the given |task_switch_source|. |
17 const char* GetHistogramName( | 20 const char* GetHistogramName( |
18 TaskSwitchMetricsRecorder::TaskSwitchSource task_switch_source) { | 21 TaskSwitchMetricsRecorder::TaskSwitchSource task_switch_source) { |
19 switch (task_switch_source) { | 22 switch (task_switch_source) { |
20 case TaskSwitchMetricsRecorder::kShelf: | 23 case TaskSwitchMetricsRecorder::kShelf: |
21 return kShelfHistogramName; | 24 return kShelfHistogramName; |
| 25 case TaskSwitchMetricsRecorder::kWindowCycleController: |
| 26 return kAcceleratorWindowCycleHistogramName; |
22 } | 27 } |
23 NOTREACHED(); | 28 NOTREACHED(); |
24 return nullptr; | 29 return nullptr; |
25 } | 30 } |
26 | 31 |
27 } // namespace | 32 } // namespace |
28 | 33 |
29 TaskSwitchMetricsRecorder::TaskSwitchMetricsRecorder() { | 34 TaskSwitchMetricsRecorder::TaskSwitchMetricsRecorder() { |
30 } | 35 } |
31 | 36 |
(...skipping 24 matching lines...) Expand all Loading... |
56 | 61 |
57 const char* histogram_name = GetHistogramName(task_switch_source); | 62 const char* histogram_name = GetHistogramName(task_switch_source); |
58 DCHECK(histogram_name); | 63 DCHECK(histogram_name); |
59 | 64 |
60 histogram_map_.add( | 65 histogram_map_.add( |
61 task_switch_source, | 66 task_switch_source, |
62 make_scoped_ptr(new TaskSwitchTimeTracker(histogram_name))); | 67 make_scoped_ptr(new TaskSwitchTimeTracker(histogram_name))); |
63 } | 68 } |
64 | 69 |
65 } // namespace ash | 70 } // namespace ash |
OLD | NEW |