Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(370)

Side by Side Diff: chrome/browser/chromeos/arc/arc_optin_uma.h

Issue 2783423002: [Merge M58] arc: Provide UMA for OptIn flow. (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/chromeos/arc/arc_optin_uma.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 CHROME_BROWSER_CHROMEOS_ARC_ARC_OPTIN_UMA_H_ 5 #ifndef CHROME_BROWSER_CHROMEOS_ARC_ARC_OPTIN_UMA_H_
6 #define CHROME_BROWSER_CHROMEOS_ARC_ARC_OPTIN_UMA_H_ 6 #define CHROME_BROWSER_CHROMEOS_ARC_ARC_OPTIN_UMA_H_
7 7
8 #include <ostream> 8 #include <ostream>
9 9
10 namespace base { 10 namespace base {
11 class TimeDelta; 11 class TimeDelta;
12 } 12 }
13 13
14 namespace arc { 14 namespace arc {
15 15
16 // These enums are used to define the buckets for an enumerated UMA histogram 16 // These enums are used to define the buckets for an enumerated UMA histogram
17 // and need to be synced with histograms.xml 17 // and need to be synced with histograms.xml
18 enum class OptInActionType : int { 18 enum class OptInActionType : int {
19 OPTED_OUT = 0, // ARC was opted out by user. 19 // ARC was opted out by user.
20 OPTED_IN = 1, // ARC was opted in by user. 20 OPTED_OUT = 0,
21 NOTIFICATION_ACCEPTED = 2, // ARC OptIn notification was accepted. 21
22 NOTIFICATION_DECLINED = 3, // ARC OptIn notification was declined. 22 // ARC was opted in by user.
23 NOTIFICATION_TIMED_OUT = 4, // ARC OptIn notification was timed out. 23 OPTED_IN = 1,
24 RETRY = 5, // User asked to retry OptIn. 24
25 SIZE, // The size of this enum; keep last. 25 // ARC OptIn notification was accepted.
26 NOTIFICATION_ACCEPTED = 2,
27
28 // ARC OptIn notification was declined.
29 NOTIFICATION_DECLINED = 3,
30
31 // ARC OptIn notification was timed out.
32 NOTIFICATION_TIMED_OUT = 4,
33
34 // User asked to retry OptIn.
35 RETRY = 5,
36
37 // The size of this enum; keep last.
38 SIZE,
26 }; 39 };
27 40
28 enum class OptInCancelReason { 41 enum class OptInCancelReason {
29 USER_CANCEL = 0, // Canceled by user. 42 // Canceled by user.
30 UNKNOWN_ERROR = 1, // Unclassified failure. 43 USER_CANCEL = 0,
31 NETWORK_ERROR = 2, // Network failure. 44
32 SERVICE_UNAVAILABLE = 3, // GMS Services are not available. 45 // Unclassified failure.
46 UNKNOWN_ERROR = 1,
47
48 // Network failure.
49 NETWORK_ERROR = 2,
50
51 DEPRECATED_SERVICE_UNAVAILABLE = 3,
33 DEPRECATED_BAD_AUTHENTICATION = 4, 52 DEPRECATED_BAD_AUTHENTICATION = 4,
34 DEPRECATED_GMS_CORE_NOT_AVAILABLE = 5, 53 DEPRECATED_GMS_CORE_NOT_AVAILABLE = 5,
35 CLOUD_PROVISION_FLOW_FAIL = 6, // Cloud provision flow failed. 54
36 ANDROID_MANAGEMENT_REQUIRED = 7, // Android management is required for user. 55 // Cloud provision flow failed.
37 SIZE, // The size of this enum; keep last. 56 CLOUD_PROVISION_FLOW_FAIL = 6,
57
58 // Android management is required for user.
59 ANDROID_MANAGEMENT_REQUIRED = 7,
60
61 // Cannot start ARC because it is busy.
62 SESSION_BUSY = 8,
63
64 // The size of this enum; keep last.
65 SIZE,
38 }; 66 };
39 67
40 enum class OptInSilentAuthCode { 68 enum class OptInSilentAuthCode {
41 // Silent auth code feature is disabled. 69 // Silent auth code feature is disabled.
42 DISABLED = 0, 70 DISABLED = 0,
71
43 // Silent auth code fetched normally. 72 // Silent auth code fetched normally.
44 SUCCESS = 1, 73 SUCCESS = 1,
74
45 // HTTP Context cannot be prepared. 75 // HTTP Context cannot be prepared.
46 CONTEXT_NOT_READY = 2, 76 CONTEXT_NOT_READY = 2,
77
47 // No LST token is available. 78 // No LST token is available.
48 NO_LST_TOKEN = 3, 79 NO_LST_TOKEN = 3,
80
49 // Silent auth code failed due sever HTTP error 5XX. 81 // Silent auth code failed due sever HTTP error 5XX.
50 HTTP_SERVER_FAILURE = 4, 82 HTTP_SERVER_FAILURE = 4,
83
51 // Silent auth code failed due client HTTP error 4XX. 84 // Silent auth code failed due client HTTP error 4XX.
52 HTTP_CLIENT_FAILURE = 5, 85 HTTP_CLIENT_FAILURE = 5,
86
53 // Silent auth code failed due unknown HTTP error. 87 // Silent auth code failed due unknown HTTP error.
54 HTTP_UNKNOWN_FAILURE = 6, 88 HTTP_UNKNOWN_FAILURE = 6,
89
55 // Cannot parse HTTP response. 90 // Cannot parse HTTP response.
56 RESPONSE_PARSE_FAILURE = 7, 91 RESPONSE_PARSE_FAILURE = 7,
92
57 // No Auth code in response. 93 // No Auth code in response.
58 NO_AUTH_CODE_IN_RESPONSE = 8, 94 NO_AUTH_CODE_IN_RESPONSE = 8,
95
59 // The size of this enum, keep last. 96 // The size of this enum, keep last.
60 SIZE, 97 SIZE,
61 }; 98 };
62 99
63 // The values should be listed in ascending order for SIZE a last, for safety. 100 // The values should be listed in ascending order for SIZE a last, for safety.
64 // For detailed meaning, please see also to auth.mojom. 101 // For detailed meaning, please see also to auth.mojom.
65 enum class ProvisioningResult : int { 102 enum class ProvisioningResult : int {
66 // Provisioning was successful. 103 // Provisioning was successful.
67 SUCCESS = 0, 104 SUCCESS = 0,
68 105
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 // ArcSessionManager::OnProvisioningFinished for details. 146 // ArcSessionManager::OnProvisioningFinished for details.
110 CHROME_SERVER_COMMUNICATION_ERROR = 18, 147 CHROME_SERVER_COMMUNICATION_ERROR = 18,
111 148
112 // Network connection is unavailable in ARC. 149 // Network connection is unavailable in ARC.
113 NO_NETWORK_CONNECTION = 19, 150 NO_NETWORK_CONNECTION = 19,
114 151
115 // The size of this enum; keep last. 152 // The size of this enum; keep last.
116 SIZE, 153 SIZE,
117 }; 154 };
118 155
156 enum class OptInFlowResult : int {
157 // OptIn has started.
158 STARTED = 0,
159
160 // OptIn has been succeeded, this also includes succeeded with error cases.
161 SUCCEEDED = 1,
162
163 // OptIn has been succeeded but with retry after an error.
164 SUCCEEDED_AFTER_RETRY = 2,
165
166 // OptIn has been canceled, this also includes canceled after error cases.
167 CANCELED = 3,
168
169 // OptIn has been canceled after an error was reported.
170 CANCELED_AFTER_ERROR = 4,
171
172 // The size of this enum; keep last.
173 SIZE,
174 };
175
119 void UpdateOptInActionUMA(OptInActionType type); 176 void UpdateOptInActionUMA(OptInActionType type);
120 void UpdateOptInCancelUMA(OptInCancelReason reason); 177 void UpdateOptInCancelUMA(OptInCancelReason reason);
178 void UpdateOptInFlowResultUMA(OptInFlowResult result);
121 void UpdateEnabledStateUMA(bool enabled); 179 void UpdateEnabledStateUMA(bool enabled);
122 void UpdateProvisioningResultUMA(ProvisioningResult result, bool managed); 180 void UpdateProvisioningResultUMA(ProvisioningResult result, bool managed);
123 void UpdateProvisioningTiming(const base::TimeDelta& elapsed_time, 181 void UpdateProvisioningTiming(const base::TimeDelta& elapsed_time,
124 bool success, 182 bool success,
125 bool managed); 183 bool managed);
126 void UpdateSilentAuthCodeUMA(OptInSilentAuthCode state); 184 void UpdateSilentAuthCodeUMA(OptInSilentAuthCode state);
127 void UpdateAuthTiming(const char* histogram_name, base::TimeDelta elapsed_time); 185 void UpdateAuthTiming(const char* histogram_name, base::TimeDelta elapsed_time);
128 void UpdateAuthCheckinAttempts(int32_t num_attempts); 186 void UpdateAuthCheckinAttempts(int32_t num_attempts);
129 187
130 // Outputs the stringified |result| to |os|. This is only for logging purposes. 188 // Outputs the stringified |result| to |os|. This is only for logging purposes.
131 std::ostream& operator<<(std::ostream& os, const ProvisioningResult& result); 189 std::ostream& operator<<(std::ostream& os, const ProvisioningResult& result);
132 190
133 } // namespace arc 191 } // namespace arc
134 192
135 #endif // CHROME_BROWSER_CHROMEOS_ARC_ARC_OPTIN_UMA_H_ 193 #endif // CHROME_BROWSER_CHROMEOS_ARC_ARC_OPTIN_UMA_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/arc/arc_optin_uma.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698