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 #ifndef ASH_METRICS_TASK_SWITCH_METRIC_RECORDER_H_ | 5 #ifndef ASH_METRICS_TASK_SWITCH_METRIC_RECORDER_H_ |
6 #define ASH_METRICS_TASK_SWITCH_METRIC_RECORDER_H_ | 6 #define ASH_METRICS_TASK_SWITCH_METRIC_RECORDER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "ash/ash_export.h" | 10 #include "ash/ash_export.h" |
11 #include "base/containers/scoped_ptr_hash_map.h" | 11 #include "base/containers/scoped_ptr_hash_map.h" |
12 | 12 |
13 namespace ash { | 13 namespace ash { |
14 | 14 |
15 class TaskSwitchTimeTracker; | 15 class TaskSwitchTimeTracker; |
16 | 16 |
17 // The TaskSwitchMetricsRecorder class records UMA metrics related to task | 17 // The TaskSwitchMetricsRecorder class records UMA metrics related to task |
18 // switching. The main purpose of the TaskSwitchMetricsRecorder is to track time | 18 // switching. The main purpose of the TaskSwitchMetricsRecorder is to track time |
19 // deltas between task switches and record histograms of the deltas. | 19 // deltas between task switches and record histograms of the deltas. |
20 class ASH_EXPORT TaskSwitchMetricsRecorder { | 20 class ASH_EXPORT TaskSwitchMetricsRecorder { |
21 public: | 21 public: |
22 // Enumeration of the different user interfaces that could be the source of | 22 // Enumeration of the different user interfaces that could be the source of |
23 // a task switch. Note this is not necessarily comprehensive of all sources. | 23 // a task switch. Note this is not necessarily comprehensive of all sources. |
24 enum TaskSwitchSource { | 24 enum TaskSwitchSource { |
25 // All task switches caused by shelf buttons, not including sub-menus. | 25 // All task switches caused by shelf buttons, not including sub-menus. |
26 kShelf, | 26 kShelf, |
| 27 // All task switches caused by the tab strip. |
| 28 kTabStrip, |
27 // Task switches caused by the WindowCycleController (ie Alt+Tab). | 29 // Task switches caused by the WindowCycleController (ie Alt+Tab). |
28 kWindowCycleController | 30 kWindowCycleController |
29 }; | 31 }; |
30 | 32 |
31 TaskSwitchMetricsRecorder(); | 33 TaskSwitchMetricsRecorder(); |
32 virtual ~TaskSwitchMetricsRecorder(); | 34 virtual ~TaskSwitchMetricsRecorder(); |
33 | 35 |
34 // Notifies |this| that a "navigate to" task switch has occurred. A | 36 // Notifies |this| that a "navigate to" task switch has occurred. A |
35 // "navigate to" operation is defined by a task switch where the specific task | 37 // "navigate to" operation is defined by a task switch where the specific task |
36 // that becomes active is user-predictable (ie Alt+Tab accelerator, launching | 38 // that becomes active is user-predictable (ie Alt+Tab accelerator, launching |
(...skipping 21 matching lines...) Expand all Loading... |
58 // |histogram_map_| is populated on demand the first time a | 60 // |histogram_map_| is populated on demand the first time a |
59 // TaskSwitchTimeTracker is needed for a given source. | 61 // TaskSwitchTimeTracker is needed for a given source. |
60 base::ScopedPtrHashMap<int, scoped_ptr<TaskSwitchTimeTracker>> histogram_map_; | 62 base::ScopedPtrHashMap<int, scoped_ptr<TaskSwitchTimeTracker>> histogram_map_; |
61 | 63 |
62 DISALLOW_COPY_AND_ASSIGN(TaskSwitchMetricsRecorder); | 64 DISALLOW_COPY_AND_ASSIGN(TaskSwitchMetricsRecorder); |
63 }; | 65 }; |
64 | 66 |
65 } // namespace ash | 67 } // namespace ash |
66 | 68 |
67 #endif // ASH_METRICS_TASK_SWITCH_METRIC_RECORDER_H_ | 69 #endif // ASH_METRICS_TASK_SWITCH_METRIC_RECORDER_H_ |
OLD | NEW |