| 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 #ifndef ASH_USER_METRICS_RECORDER_H_ | 5 #ifndef ASH_USER_METRICS_RECORDER_H_ |
| 6 #define ASH_USER_METRICS_RECORDER_H_ | 6 #define ASH_USER_METRICS_RECORDER_H_ |
| 7 | 7 |
| 8 #include "ash/ash_export.h" | 8 #include "ash/ash_export.h" |
| 9 #include "base/timer/timer.h" | 9 #include "base/timer/timer.h" |
| 10 | 10 |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 UMA_TRAY_SHUT_DOWN, | 93 UMA_TRAY_SHUT_DOWN, |
| 94 UMA_WINDOW_APP_CLOSE_BUTTON_CLICK, | 94 UMA_WINDOW_APP_CLOSE_BUTTON_CLICK, |
| 95 UMA_WINDOW_CLOSE_BUTTON_CLICK, | 95 UMA_WINDOW_CLOSE_BUTTON_CLICK, |
| 96 UMA_WINDOW_MAXIMIZE_BUTTON_CLICK_EXIT_FULLSCREEN, | 96 UMA_WINDOW_MAXIMIZE_BUTTON_CLICK_EXIT_FULLSCREEN, |
| 97 UMA_WINDOW_MAXIMIZE_BUTTON_CLICK_MAXIMIZE, | 97 UMA_WINDOW_MAXIMIZE_BUTTON_CLICK_MAXIMIZE, |
| 98 UMA_WINDOW_MAXIMIZE_BUTTON_CLICK_MINIMIZE, | 98 UMA_WINDOW_MAXIMIZE_BUTTON_CLICK_MINIMIZE, |
| 99 UMA_WINDOW_MAXIMIZE_BUTTON_CLICK_RESTORE, | 99 UMA_WINDOW_MAXIMIZE_BUTTON_CLICK_RESTORE, |
| 100 UMA_WINDOW_MAXIMIZE_BUTTON_MAXIMIZE_LEFT, | 100 UMA_WINDOW_MAXIMIZE_BUTTON_MAXIMIZE_LEFT, |
| 101 UMA_WINDOW_MAXIMIZE_BUTTON_MAXIMIZE_RIGHT, | 101 UMA_WINDOW_MAXIMIZE_BUTTON_MAXIMIZE_RIGHT, |
| 102 | 102 |
| 103 // Thumbnail sized overview of windows triggered. This is a subset of | 103 // Thumbnail sized overview of windows triggered by pressing the overview key. |
| 104 // UMA_WINDOW_SELECTION triggered by lingering during alt+tab cycles or | |
| 105 // pressing the overview key. | |
| 106 UMA_WINDOW_OVERVIEW, | 104 UMA_WINDOW_OVERVIEW, |
| 107 | 105 |
| 108 // Window selection started by beginning an alt+tab cycle or pressing the | 106 // Selecting a window in overview mode by pressing the enter key. |
| 109 // overview key. This does not count each step through an alt+tab cycle. | 107 UMA_WINDOW_OVERVIEW_ENTER_KEY, |
| 110 UMA_WINDOW_SELECTION, | 108 |
| 109 // Window selection started by beginning an alt+tab cycle. This does not count |
| 110 // each step through an alt+tab cycle. |
| 111 UMA_WINDOW_CYCLE, |
| 111 }; | 112 }; |
| 112 | 113 |
| 113 // User Metrics Recorder provides a repeating callback (RecordPeriodicMetrics) | 114 // User Metrics Recorder provides a repeating callback (RecordPeriodicMetrics) |
| 114 // on a timer to allow recording of state data over time to the UMA records. | 115 // on a timer to allow recording of state data over time to the UMA records. |
| 115 // Any additional states (in ash) that require monitoring can be added to | 116 // Any additional states (in ash) that require monitoring can be added to |
| 116 // this class. As well calls to record on action metrics | 117 // this class. As well calls to record on action metrics |
| 117 // (RecordUserMetricsAction) are passed through the UserMetricsRecorder. | 118 // (RecordUserMetricsAction) are passed through the UserMetricsRecorder. |
| 118 class ASH_EXPORT UserMetricsRecorder { | 119 class ASH_EXPORT UserMetricsRecorder { |
| 119 public: | 120 public: |
| 120 UserMetricsRecorder(); | 121 UserMetricsRecorder(); |
| 121 ~UserMetricsRecorder(); | 122 ~UserMetricsRecorder(); |
| 122 | 123 |
| 123 void RecordUserMetricsAction(ash::UserMetricsAction action); | 124 void RecordUserMetricsAction(ash::UserMetricsAction action); |
| 124 private: | 125 private: |
| 125 void RecordPeriodicMetrics(); | 126 void RecordPeriodicMetrics(); |
| 126 | 127 |
| 127 base::RepeatingTimer<UserMetricsRecorder> timer_; | 128 base::RepeatingTimer<UserMetricsRecorder> timer_; |
| 128 }; | 129 }; |
| 129 | 130 |
| 130 } // namespace ash | 131 } // namespace ash |
| 131 | 132 |
| 132 #endif // ASH_USER_METRICS_RECORDER_H_ | 133 #endif // ASH_USER_METRICS_RECORDER_H_ |
| OLD | NEW |