| 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_METRICS_USER_METRICS_RECORDER_H_ | 5 #ifndef ASH_METRICS_USER_METRICS_RECORDER_H_ |
| 6 #define ASH_METRICS_USER_METRICS_RECORDER_H_ | 6 #define ASH_METRICS_USER_METRICS_RECORDER_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "ash/ash_export.h" | 10 #include "ash/ash_export.h" |
| 11 #include "ash/metrics/task_switch_metrics_recorder.h" | 11 #include "ash/metrics/task_switch_metrics_recorder.h" |
| 12 #include "base/macros.h" | 12 #include "base/macros.h" |
| 13 #include "base/timer/timer.h" | 13 #include "base/timer/timer.h" |
| 14 | 14 |
| 15 namespace ash { | 15 namespace ash { |
| 16 | 16 |
| 17 class DesktopTaskSwitchMetricRecorder; | 17 class DesktopTaskSwitchMetricRecorder; |
| 18 | 18 |
| 19 namespace test { | 19 namespace test { |
| 20 class UserMetricsRecorderTestAPI; | 20 class UserMetricsRecorderTestAPI; |
| 21 } | 21 } |
| 22 | 22 |
| 23 namespace wm { |
| 24 enum class WmUserMetricsAction; |
| 25 } |
| 26 |
| 23 enum UserMetricsAction { | 27 enum UserMetricsAction { |
| 24 UMA_ACCEL_EXIT_FIRST_Q, | 28 UMA_ACCEL_EXIT_FIRST_Q, |
| 25 UMA_ACCEL_EXIT_SECOND_Q, | 29 UMA_ACCEL_EXIT_SECOND_Q, |
| 26 UMA_ACCEL_KEYBOARD_BRIGHTNESS_DOWN_F6, | 30 UMA_ACCEL_KEYBOARD_BRIGHTNESS_DOWN_F6, |
| 27 UMA_ACCEL_KEYBOARD_BRIGHTNESS_UP_F7, | 31 UMA_ACCEL_KEYBOARD_BRIGHTNESS_UP_F7, |
| 28 UMA_ACCEL_LOCK_SCREEN_LOCK_BUTTON, | 32 UMA_ACCEL_LOCK_SCREEN_LOCK_BUTTON, |
| 29 UMA_ACCEL_LOCK_SCREEN_POWER_BUTTON, | 33 UMA_ACCEL_LOCK_SCREEN_POWER_BUTTON, |
| 30 UMA_ACCEL_MAXIMIZE_RESTORE_F4, | 34 UMA_ACCEL_MAXIMIZE_RESTORE_F4, |
| 31 UMA_ACCEL_PREVWINDOW_F5, | 35 UMA_ACCEL_PREVWINDOW_F5, |
| 32 UMA_ACCEL_RESTART_POWER_BUTTON, | 36 UMA_ACCEL_RESTART_POWER_BUTTON, |
| 33 UMA_ACCEL_SHUT_DOWN_POWER_BUTTON, | 37 UMA_ACCEL_SHUT_DOWN_POWER_BUTTON, |
| 34 UMA_CLOSE_THROUGH_CONTEXT_MENU, | 38 UMA_CLOSE_THROUGH_CONTEXT_MENU, |
| 35 UMA_DESKTOP_SWITCH_TASK, | 39 UMA_DESKTOP_SWITCH_TASK, |
| 36 UMA_DRAG_MAXIMIZE_LEFT, | |
| 37 UMA_DRAG_MAXIMIZE_RIGHT, | |
| 38 UMA_LAUNCHER_BUTTON_PRESSED_WITH_MOUSE, | 40 UMA_LAUNCHER_BUTTON_PRESSED_WITH_MOUSE, |
| 39 UMA_LAUNCHER_BUTTON_PRESSED_WITH_TOUCH, | 41 UMA_LAUNCHER_BUTTON_PRESSED_WITH_TOUCH, |
| 40 UMA_LAUNCHER_CLICK_ON_APP, | 42 UMA_LAUNCHER_CLICK_ON_APP, |
| 41 UMA_LAUNCHER_CLICK_ON_APPLIST_BUTTON, | 43 UMA_LAUNCHER_CLICK_ON_APPLIST_BUTTON, |
| 42 UMA_LAUNCHER_LAUNCH_TASK, | 44 UMA_LAUNCHER_LAUNCH_TASK, |
| 43 UMA_LAUNCHER_MINIMIZE_TASK, | 45 UMA_LAUNCHER_MINIMIZE_TASK, |
| 44 UMA_LAUNCHER_SWITCH_TASK, | 46 UMA_LAUNCHER_SWITCH_TASK, |
| 45 UMA_MAXIMIZE_MODE_DISABLED, | 47 UMA_MAXIMIZE_MODE_DISABLED, |
| 46 UMA_MAXIMIZE_MODE_ENABLED, | 48 UMA_MAXIMIZE_MODE_ENABLED, |
| 47 UMA_MAXIMIZE_MODE_INITIALLY_DISABLED, | 49 UMA_MAXIMIZE_MODE_INITIALLY_DISABLED, |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 class ASH_EXPORT UserMetricsRecorder { | 150 class ASH_EXPORT UserMetricsRecorder { |
| 149 public: | 151 public: |
| 150 // Creates a UserMetricsRecorder that records metrics periodically. Equivalent | 152 // Creates a UserMetricsRecorder that records metrics periodically. Equivalent |
| 151 // to calling UserMetricsRecorder(true). | 153 // to calling UserMetricsRecorder(true). |
| 152 UserMetricsRecorder(); | 154 UserMetricsRecorder(); |
| 153 | 155 |
| 154 virtual ~UserMetricsRecorder(); | 156 virtual ~UserMetricsRecorder(); |
| 155 | 157 |
| 156 // Records an Ash owned user action. | 158 // Records an Ash owned user action. |
| 157 void RecordUserMetricsAction(ash::UserMetricsAction action); | 159 void RecordUserMetricsAction(ash::UserMetricsAction action); |
| 160 void RecordUserMetricsAction(wm::WmUserMetricsAction action); |
| 158 | 161 |
| 159 TaskSwitchMetricsRecorder& task_switch_metrics_recorder() { | 162 TaskSwitchMetricsRecorder& task_switch_metrics_recorder() { |
| 160 return task_switch_metrics_recorder_; | 163 return task_switch_metrics_recorder_; |
| 161 } | 164 } |
| 162 | 165 |
| 163 // Informs |this| that the Shell has been initialized. | 166 // Informs |this| that the Shell has been initialized. |
| 164 void OnShellInitialized(); | 167 void OnShellInitialized(); |
| 165 | 168 |
| 166 // Informs |this| that the Shell is going to be shut down. | 169 // Informs |this| that the Shell is going to be shut down. |
| 167 void OnShellShuttingDown(); | 170 void OnShellShuttingDown(); |
| (...skipping 28 matching lines...) Expand all Loading... |
| 196 // clicks or touchscreen taps. | 199 // clicks or touchscreen taps. |
| 197 std::unique_ptr<DesktopTaskSwitchMetricRecorder> | 200 std::unique_ptr<DesktopTaskSwitchMetricRecorder> |
| 198 desktop_task_switch_metric_recorder_; | 201 desktop_task_switch_metric_recorder_; |
| 199 | 202 |
| 200 DISALLOW_COPY_AND_ASSIGN(UserMetricsRecorder); | 203 DISALLOW_COPY_AND_ASSIGN(UserMetricsRecorder); |
| 201 }; | 204 }; |
| 202 | 205 |
| 203 } // namespace ash | 206 } // namespace ash |
| 204 | 207 |
| 205 #endif // ASH_METRICS_USER_METRICS_RECORDER_H_ | 208 #endif // ASH_METRICS_USER_METRICS_RECORDER_H_ |
| OLD | NEW |