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