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
3 // found in the LICENSE file.
5 #ifndef ASH_USER_METRICS_RECORDER_H_
6 #define ASH_USER_METRICS_RECORDER_H_
8 #include "ash/ash_export.h"
9 #include "base/timer/timer.h"
13 enum UserMetricsAction
{
14 UMA_ACCEL_EXIT_FIRST_Q
,
15 UMA_ACCEL_EXIT_SECOND_Q
,
16 UMA_ACCEL_KEYBOARD_BRIGHTNESS_DOWN_F6
,
17 UMA_ACCEL_KEYBOARD_BRIGHTNESS_UP_F7
,
18 UMA_ACCEL_LOCK_SCREEN_LOCK_BUTTON
,
19 UMA_ACCEL_LOCK_SCREEN_POWER_BUTTON
,
20 UMA_ACCEL_MAXIMIZE_RESTORE_F4
,
21 UMA_ACCEL_PREVWINDOW_F5
,
22 UMA_ACCEL_RESTART_POWER_BUTTON
,
23 UMA_ACCEL_SHUT_DOWN_POWER_BUTTON
,
24 UMA_CLOSE_THROUGH_CONTEXT_MENU
,
25 UMA_DRAG_MAXIMIZE_LEFT
,
26 UMA_DRAG_MAXIMIZE_RIGHT
,
28 UMA_LAUNCHER_BUTTON_PRESSED_WITH_MOUSE
,
29 UMA_LAUNCHER_BUTTON_PRESSED_WITH_TOUCH
,
30 UMA_LAUNCHER_CLICK_ON_APP
,
31 UMA_LAUNCHER_CLICK_ON_APPLIST_BUTTON
,
32 UMA_LAUNCHER_LAUNCH_TASK
,
33 UMA_MAXIMIZE_MODE_DISABLED
,
34 UMA_MAXIMIZE_MODE_ENABLED
,
35 UMA_MAXIMIZE_MODE_INITIALLY_DISABLED
,
37 UMA_PANEL_MINIMIZE_CAPTION_CLICK
,
38 UMA_PANEL_MINIMIZE_CAPTION_GESTURE
,
39 UMA_SHELF_ALIGNMENT_SET_BOTTOM
,
40 UMA_SHELF_ALIGNMENT_SET_LEFT
,
41 UMA_SHELF_ALIGNMENT_SET_RIGHT
,
42 UMA_STATUS_AREA_AUDIO_CURRENT_INPUT_DEVICE
,
43 UMA_STATUS_AREA_AUDIO_CURRENT_OUTPUT_DEVICE
,
44 UMA_STATUS_AREA_AUDIO_SWITCH_INPUT_DEVICE
,
45 UMA_STATUS_AREA_AUDIO_SWITCH_OUTPUT_DEVICE
,
46 UMA_STATUS_AREA_BRIGHTNESS_CHANGED
,
47 UMA_STATUS_AREA_BLUETOOTH_CONNECT_KNOWN_DEVICE
,
48 UMA_STATUS_AREA_BLUETOOTH_CONNECT_UNKNOWN_DEVICE
,
49 UMA_STATUS_AREA_BLUETOOTH_DISABLED
,
50 UMA_STATUS_AREA_BLUETOOTH_ENABLED
,
51 UMA_STATUS_AREA_CAPS_LOCK_DETAILED
,
52 UMA_STATUS_AREA_CAPS_LOCK_DISABLED_BY_CLICK
,
53 UMA_STATUS_AREA_CAPS_LOCK_ENABLED_BY_CLICK
,
54 UMA_STATUS_AREA_CAPS_LOCK_POPUP
,
55 UMA_STATUS_AREA_CONNECT_TO_CONFIGURED_NETWORK
,
56 UMA_STATUS_AREA_CONNECT_TO_UNCONFIGURED_NETWORK
,
57 UMA_STATUS_AREA_CONNECT_TO_VPN
,
58 UMA_STATUS_AREA_CHANGED_VOLUME_MENU
,
59 UMA_STATUS_AREA_CHANGED_VOLUME_POPUP
,
60 UMA_STATUS_AREA_DETAILED_ACCESSABILITY
,
61 UMA_STATUS_AREA_DETAILED_AUDIO_VIEW
,
62 UMA_STATUS_AREA_DETAILED_BLUETOOTH_VIEW
,
63 UMA_STATUS_AREA_DETAILED_BRIGHTNESS_VIEW
,
64 UMA_STATUS_AREA_DETAILED_DRIVE_VIEW
,
65 UMA_STATUS_AREA_DETAILED_NETWORK_VIEW
,
66 UMA_STATUS_AREA_DETAILED_VPN_VIEW
,
67 UMA_STATUS_AREA_DISABLE_AUTO_CLICK
,
68 UMA_STATUS_AREA_DISABLE_HIGH_CONTRAST
,
69 UMA_STATUS_AREA_DISABLE_LARGE_CURSOR
,
70 UMA_STATUS_AREA_DISABLE_MAGNIFIER
,
71 UMA_STATUS_AREA_DISABLE_SPOKEN_FEEDBACK
,
72 UMA_STATUS_AREA_DISABLE_WIFI
,
73 UMA_STATUS_AREA_DISABLE_VIRTUAL_KEYBOARD
,
74 UMA_STATUS_AREA_DRIVE_CANCEL_OPERATION
,
75 UMA_STATUS_AREA_DRIVE_SETTINGS
,
76 UMA_STATUS_AREA_ENABLE_AUTO_CLICK
,
77 UMA_STATUS_AREA_ENABLE_HIGH_CONTRAST
,
78 UMA_STATUS_AREA_ENABLE_LARGE_CURSOR
,
79 UMA_STATUS_AREA_ENABLE_MAGNIFIER
,
80 UMA_STATUS_AREA_ENABLE_SPOKEN_FEEDBACK
,
81 UMA_STATUS_AREA_ENABLE_WIFI
,
82 UMA_STATUS_AREA_ENABLE_VIRTUAL_KEYBOARD
,
83 UMA_STATUS_AREA_IME_SHOW_DETAILED
,
84 UMA_STATUS_AREA_IME_SWITCH_MODE
,
85 UMA_STATUS_AREA_MENU_OPENED
,
86 UMA_STATUS_AREA_NETWORK_JOIN_OTHER_CLICKED
,
87 UMA_STATUS_AREA_NETWORK_SETTINGS_CLICKED
,
88 UMA_STATUS_AREA_SHOW_NETWORK_CONNECTION_DETAILS
,
89 UMA_STATUS_AREA_SHOW_VPN_CONNECTION_DETAILS
,
90 UMA_STATUS_AREA_SIGN_OUT
,
91 UMA_STATUS_AREA_VPN_ADD_BUILT_IN_CLICKED
,
92 UMA_STATUS_AREA_VPN_ADD_THIRD_PARTY_CLICKED
,
93 UMA_STATUS_AREA_VPN_DISCONNECT_CLICKED
,
94 UMA_STATUS_AREA_VPN_SETTINGS_CLICKED
,
95 UMA_TOGGLE_MAXIMIZE_CAPTION_CLICK
,
96 UMA_TOGGLE_MAXIMIZE_CAPTION_GESTURE
,
97 UMA_TOGGLE_SINGLE_AXIS_MAXIMIZE_BORDER_CLICK
,
98 UMA_TOUCHPAD_GESTURE_OVERVIEW
,
99 UMA_TOUCHSCREEN_TAP_DOWN
,
101 UMA_TRAY_LOCK_SCREEN
,
103 UMA_WINDOW_APP_CLOSE_BUTTON_CLICK
,
104 UMA_WINDOW_CLOSE_BUTTON_CLICK
,
105 UMA_WINDOW_MAXIMIZE_BUTTON_CLICK_EXIT_FULLSCREEN
,
106 UMA_WINDOW_MAXIMIZE_BUTTON_CLICK_MAXIMIZE
,
107 UMA_WINDOW_MAXIMIZE_BUTTON_CLICK_MINIMIZE
,
108 UMA_WINDOW_MAXIMIZE_BUTTON_CLICK_RESTORE
,
109 UMA_WINDOW_MAXIMIZE_BUTTON_MAXIMIZE_LEFT
,
110 UMA_WINDOW_MAXIMIZE_BUTTON_MAXIMIZE_RIGHT
,
112 // Thumbnail sized overview of windows triggered by pressing the overview key.
115 // Selecting a window in overview mode by pressing the enter key.
116 UMA_WINDOW_OVERVIEW_ENTER_KEY
,
118 // Window selection started by beginning an alt+tab cycle. This does not count
119 // each step through an alt+tab cycle.
123 // User Metrics Recorder provides a repeating callback (RecordPeriodicMetrics)
124 // on a timer to allow recording of state data over time to the UMA records.
125 // Any additional states (in ash) that require monitoring can be added to
126 // this class. As well calls to record on action metrics
127 // (RecordUserMetricsAction) are passed through the UserMetricsRecorder.
128 class ASH_EXPORT UserMetricsRecorder
{
130 UserMetricsRecorder();
131 ~UserMetricsRecorder();
133 void RecordUserMetricsAction(ash::UserMetricsAction action
);
135 void RecordPeriodicMetrics();
137 base::RepeatingTimer
<UserMetricsRecorder
> timer_
;
142 #endif // ASH_USER_METRICS_RECORDER_H_