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 kTabStripHistogramName[] = |
| 17 "Ash.Tab.TimeBetweenSwitchToExistingTabUserActions"; |
| 18 |
16 const char kAcceleratorWindowCycleHistogramName[] = | 19 const char kAcceleratorWindowCycleHistogramName[] = |
17 "Ash.WindowCycleController.TimeBetweenTaskSwitches"; | 20 "Ash.WindowCycleController.TimeBetweenTaskSwitches"; |
18 | 21 |
19 // Returns the histogram name for the given |task_switch_source|. | 22 // Returns the histogram name for the given |task_switch_source|. |
20 const char* GetHistogramName( | 23 const char* GetHistogramName( |
21 TaskSwitchMetricsRecorder::TaskSwitchSource task_switch_source) { | 24 TaskSwitchMetricsRecorder::TaskSwitchSource task_switch_source) { |
22 switch (task_switch_source) { | 25 switch (task_switch_source) { |
23 case TaskSwitchMetricsRecorder::kShelf: | 26 case TaskSwitchMetricsRecorder::kShelf: |
24 return kShelfHistogramName; | 27 return kShelfHistogramName; |
| 28 case TaskSwitchMetricsRecorder::kTabStrip: |
| 29 return kTabStripHistogramName; |
25 case TaskSwitchMetricsRecorder::kWindowCycleController: | 30 case TaskSwitchMetricsRecorder::kWindowCycleController: |
26 return kAcceleratorWindowCycleHistogramName; | 31 return kAcceleratorWindowCycleHistogramName; |
27 } | 32 } |
28 NOTREACHED(); | 33 NOTREACHED(); |
29 return nullptr; | 34 return nullptr; |
30 } | 35 } |
31 | 36 |
32 } // namespace | 37 } // namespace |
33 | 38 |
34 TaskSwitchMetricsRecorder::TaskSwitchMetricsRecorder() { | 39 TaskSwitchMetricsRecorder::TaskSwitchMetricsRecorder() { |
(...skipping 26 matching lines...) Expand all Loading... |
61 | 66 |
62 const char* histogram_name = GetHistogramName(task_switch_source); | 67 const char* histogram_name = GetHistogramName(task_switch_source); |
63 DCHECK(histogram_name); | 68 DCHECK(histogram_name); |
64 | 69 |
65 histogram_map_.add( | 70 histogram_map_.add( |
66 task_switch_source, | 71 task_switch_source, |
67 make_scoped_ptr(new TaskSwitchTimeTracker(histogram_name))); | 72 make_scoped_ptr(new TaskSwitchTimeTracker(histogram_name))); |
68 } | 73 } |
69 | 74 |
70 } // namespace ash | 75 } // namespace ash |
OLD | NEW |