OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 CONTENT_PUBLIC_COMMON_PUSH_MESSAGING_STATUS_H_ | 5 #ifndef CONTENT_PUBLIC_COMMON_PUSH_MESSAGING_STATUS_H_ |
6 #define CONTENT_PUBLIC_COMMON_PUSH_MESSAGING_STATUS_H_ | 6 #define CONTENT_PUBLIC_COMMON_PUSH_MESSAGING_STATUS_H_ |
7 | 7 |
8 namespace content { | 8 namespace content { |
9 | 9 |
10 // Push registration success/error codes for internal use & reporting in UMA. | 10 // Push registration success/error codes for internal use & reporting in UMA. |
| 11 // Enum values can be added, but must never be renumbered or deleted and reused. |
11 enum PushRegistrationStatus { | 12 enum PushRegistrationStatus { |
12 // New successful registration (there was not yet a registration cached in | 13 // New successful registration (there was not yet a registration cached in |
13 // Service Worker storage, so the browser successfully registered with the | 14 // Service Worker storage, so the browser successfully registered with the |
14 // push service. This is likely to be a new push registration, though it's | 15 // push service. This is likely to be a new push registration, though it's |
15 // possible that the push service had its own cache (for example if Chrome's | 16 // possible that the push service had its own cache (for example if Chrome's |
16 // app data was cleared, we might have forgotten about a registration that the | 17 // app data was cleared, we might have forgotten about a registration that the |
17 // push service still stores). | 18 // push service still stores). |
18 PUSH_REGISTRATION_STATUS_SUCCESS_FROM_PUSH_SERVICE = 0, | 19 PUSH_REGISTRATION_STATUS_SUCCESS_FROM_PUSH_SERVICE = 0, |
19 | 20 |
20 // Registration failed because there is no Service Worker. | 21 // Registration failed because there is no Service Worker. |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 | 59 |
59 // NOTE: Do not renumber these as that would confuse interpretation of | 60 // NOTE: Do not renumber these as that would confuse interpretation of |
60 // previously logged data. When making changes, also update the enum list | 61 // previously logged data. When making changes, also update the enum list |
61 // in tools/metrics/histograms/histograms.xml to keep it in sync, and | 62 // in tools/metrics/histograms/histograms.xml to keep it in sync, and |
62 // update PUSH_REGISTRATION_STATUS_LAST below. | 63 // update PUSH_REGISTRATION_STATUS_LAST below. |
63 | 64 |
64 PUSH_REGISTRATION_STATUS_LAST = | 65 PUSH_REGISTRATION_STATUS_LAST = |
65 PUSH_REGISTRATION_STATUS_MANIFEST_EMPTY_OR_MISSING | 66 PUSH_REGISTRATION_STATUS_MANIFEST_EMPTY_OR_MISSING |
66 }; | 67 }; |
67 | 68 |
| 69 // Push unregistration reason for reporting in UMA. Enum values can be added, |
| 70 // but must never be renumbered or deleted and reused. |
| 71 enum PushUnregistrationReason { |
| 72 // Should never happen. |
| 73 PUSH_UNREGISTRATION_REASON_UNKNOWN = 0, |
| 74 |
| 75 // Unregistering because the website called the unsubscribe API. |
| 76 PUSH_UNREGISTRATION_REASON_JAVASCRIPT_API = 1, |
| 77 |
| 78 // Unregistering because the user manually revoked permission. |
| 79 PUSH_UNREGISTRATION_REASON_PERMISSION_REVOKED = 2, |
| 80 |
| 81 // Automatic - incoming message's app id was unknown. |
| 82 PUSH_UNREGISTRATION_REASON_DELIVERY_UNKNOWN_APP_ID = 3, |
| 83 |
| 84 // Automatic - incoming message's origin no longer has permission. |
| 85 PUSH_UNREGISTRATION_REASON_DELIVERY_PERMISSION_DENIED = 4, |
| 86 |
| 87 // Automatic - incoming message's service worker was not found. |
| 88 PUSH_UNREGISTRATION_REASON_DELIVERY_NO_SERVICE_WORKER = 5, |
| 89 |
| 90 // NOTE: Do not renumber these as that would confuse interpretation of |
| 91 // previously logged data. When making changes, also update the enum list |
| 92 // in tools/metrics/histograms/histograms.xml to keep it in sync, and |
| 93 // update PUSH_UNREGISTRATION_REASON_LAST below. |
| 94 |
| 95 PUSH_UNREGISTRATION_REASON_LAST = |
| 96 PUSH_UNREGISTRATION_REASON_DELIVERY_NO_SERVICE_WORKER |
| 97 }; |
| 98 |
68 // Push unregistration success/error codes for internal use & reporting in UMA. | 99 // Push unregistration success/error codes for internal use & reporting in UMA. |
| 100 // Enum values can be added, but must never be renumbered or deleted and reused. |
69 enum PushUnregistrationStatus { | 101 enum PushUnregistrationStatus { |
70 // The unregistration was successful. | 102 // The unregistration was successful. |
71 PUSH_UNREGISTRATION_STATUS_SUCCESS_UNREGISTERED = 0, | 103 PUSH_UNREGISTRATION_STATUS_SUCCESS_UNREGISTERED = 0, |
72 | 104 |
73 // Unregistration was unnecessary, as the registration was not found. | 105 // Unregistration was unnecessary, as the registration was not found. |
74 PUSH_UNREGISTRATION_STATUS_SUCCESS_WAS_NOT_REGISTERED = 1, | 106 PUSH_UNREGISTRATION_STATUS_SUCCESS_WAS_NOT_REGISTERED = 1, |
75 | 107 |
76 // The unregistration did not happen because of a network error, but will be | 108 // The unregistration did not happen because of a network error, but will be |
77 // retried until it succeeds. | 109 // retried until it succeeds. |
78 PUSH_UNREGISTRATION_STATUS_PENDING_NETWORK_ERROR = 2, | 110 PUSH_UNREGISTRATION_STATUS_PENDING_NETWORK_ERROR = 2, |
(...skipping 16 matching lines...) Expand all Loading... |
95 | 127 |
96 // NOTE: Do not renumber these as that would confuse interpretation of | 128 // NOTE: Do not renumber these as that would confuse interpretation of |
97 // previously logged data. When making changes, also update the enum list | 129 // previously logged data. When making changes, also update the enum list |
98 // in tools/metrics/histograms/histograms.xml to keep it in sync, and | 130 // in tools/metrics/histograms/histograms.xml to keep it in sync, and |
99 // update PUSH_UNREGISTRATION_STATUS_LAST below. | 131 // update PUSH_UNREGISTRATION_STATUS_LAST below. |
100 | 132 |
101 PUSH_UNREGISTRATION_STATUS_LAST = PUSH_UNREGISTRATION_STATUS_NETWORK_ERROR | 133 PUSH_UNREGISTRATION_STATUS_LAST = PUSH_UNREGISTRATION_STATUS_NETWORK_ERROR |
102 }; | 134 }; |
103 | 135 |
104 // Push getregistration success/error codes for internal use & reporting in UMA. | 136 // Push getregistration success/error codes for internal use & reporting in UMA. |
| 137 // Enum values can be added, but must never be renumbered or deleted and reused. |
105 enum PushGetRegistrationStatus { | 138 enum PushGetRegistrationStatus { |
106 // Getting the registration was successful. | 139 // Getting the registration was successful. |
107 PUSH_GETREGISTRATION_STATUS_SUCCESS = 0, | 140 PUSH_GETREGISTRATION_STATUS_SUCCESS = 0, |
108 | 141 |
109 // Getting the registration failed because the push service is not available. | 142 // Getting the registration failed because the push service is not available. |
110 PUSH_GETREGISTRATION_STATUS_SERVICE_NOT_AVAILABLE = 1, | 143 PUSH_GETREGISTRATION_STATUS_SERVICE_NOT_AVAILABLE = 1, |
111 | 144 |
112 // Getting the registration failed because we failed to read from storage. | 145 // Getting the registration failed because we failed to read from storage. |
113 PUSH_GETREGISTRATION_STATUS_STORAGE_ERROR = 2, | 146 PUSH_GETREGISTRATION_STATUS_STORAGE_ERROR = 2, |
114 | 147 |
(...skipping 10 matching lines...) Expand all Loading... |
125 // NOTE: Do not renumber these as that would confuse interpretation of | 158 // NOTE: Do not renumber these as that would confuse interpretation of |
126 // previously logged data. When making changes, also update the enum list | 159 // previously logged data. When making changes, also update the enum list |
127 // in tools/metrics/histograms/histograms.xml to keep it in sync, and | 160 // in tools/metrics/histograms/histograms.xml to keep it in sync, and |
128 // update PUSH_GETREGISTRATION_STATUS_LAST below. | 161 // update PUSH_GETREGISTRATION_STATUS_LAST below. |
129 | 162 |
130 PUSH_GETREGISTRATION_STATUS_LAST = | 163 PUSH_GETREGISTRATION_STATUS_LAST = |
131 PUSH_GETREGISTRATION_STATUS_PUBLIC_KEY_UNAVAILABLE | 164 PUSH_GETREGISTRATION_STATUS_PUBLIC_KEY_UNAVAILABLE |
132 }; | 165 }; |
133 | 166 |
134 // Push message event success/error codes for internal use & reporting in UMA. | 167 // Push message event success/error codes for internal use & reporting in UMA. |
| 168 // Enum values can be added, but must never be renumbered or deleted and reused. |
135 enum PushDeliveryStatus { | 169 enum PushDeliveryStatus { |
136 // The message was successfully delivered. | 170 // The message was successfully delivered. |
137 PUSH_DELIVERY_STATUS_SUCCESS = 0, | 171 PUSH_DELIVERY_STATUS_SUCCESS = 0, |
138 | 172 |
139 // The message could not be delivered because the app id was unknown. | 173 // The message could not be delivered because the app id was unknown. |
140 PUSH_DELIVERY_STATUS_UNKNOWN_APP_ID = 2, | 174 PUSH_DELIVERY_STATUS_UNKNOWN_APP_ID = 2, |
141 | 175 |
142 // The message could not be delivered because origin no longer has permission. | 176 // The message could not be delivered because origin no longer has permission. |
143 PUSH_DELIVERY_STATUS_PERMISSION_DENIED = 3, | 177 PUSH_DELIVERY_STATUS_PERMISSION_DENIED = 3, |
144 | 178 |
145 // The message could not be delivered because no service worker was found. | 179 // The message could not be delivered because no service worker was found. |
146 PUSH_DELIVERY_STATUS_NO_SERVICE_WORKER = 4, | 180 PUSH_DELIVERY_STATUS_NO_SERVICE_WORKER = 4, |
147 | 181 |
148 // The message could not be delivered because of a service worker error. | 182 // The message could not be delivered because of a service worker error. |
149 PUSH_DELIVERY_STATUS_SERVICE_WORKER_ERROR = 5, | 183 PUSH_DELIVERY_STATUS_SERVICE_WORKER_ERROR = 5, |
150 | 184 |
151 // The message was delivered, but the Service Worker passed a Promise to | 185 // The message was delivered, but the Service Worker passed a Promise to |
152 // event.waitUntil that got rejected. | 186 // event.waitUntil that got rejected. |
153 PUSH_DELIVERY_STATUS_EVENT_WAITUNTIL_REJECTED = 6, | 187 PUSH_DELIVERY_STATUS_EVENT_WAITUNTIL_REJECTED = 6, |
154 | 188 |
155 // NOTE: Do not renumber these as that would confuse interpretation of | 189 // NOTE: Do not renumber these as that would confuse interpretation of |
156 // previously logged data. When making changes, also update the enum list | 190 // previously logged data. When making changes, also update the enum list |
157 // in tools/metrics/histograms/histograms.xml to keep it in sync, and | 191 // in tools/metrics/histograms/histograms.xml to keep it in sync, and |
158 // update PUSH_DELIVERY_STATUS_LAST below. | 192 // update PUSH_DELIVERY_STATUS_LAST below. |
159 | 193 |
160 PUSH_DELIVERY_STATUS_LAST = PUSH_DELIVERY_STATUS_EVENT_WAITUNTIL_REJECTED | 194 PUSH_DELIVERY_STATUS_LAST = PUSH_DELIVERY_STATUS_EVENT_WAITUNTIL_REJECTED |
161 }; | 195 }; |
162 | 196 |
163 // Push message user visible tracking for reporting in UMA. | 197 // Push message user visible tracking for reporting in UMA. Enum values can be |
| 198 // added, but must never be renumbered or deleted and reused. |
164 enum PushUserVisibleStatus { | 199 enum PushUserVisibleStatus { |
165 // A notification was required and one (or more) were shown. | 200 // A notification was required and one (or more) were shown. |
166 PUSH_USER_VISIBLE_STATUS_REQUIRED_AND_SHOWN = 0, | 201 PUSH_USER_VISIBLE_STATUS_REQUIRED_AND_SHOWN = 0, |
167 | 202 |
168 // A notification was not required, but one (or more) were shown anyway. | 203 // A notification was not required, but one (or more) were shown anyway. |
169 PUSH_USER_VISIBLE_STATUS_NOT_REQUIRED_BUT_SHOWN = 1, | 204 PUSH_USER_VISIBLE_STATUS_NOT_REQUIRED_BUT_SHOWN = 1, |
170 | 205 |
171 // A notification was not required and none were shown. | 206 // A notification was not required and none were shown. |
172 PUSH_USER_VISIBLE_STATUS_NOT_REQUIRED_AND_NOT_SHOWN = 2, | 207 PUSH_USER_VISIBLE_STATUS_NOT_REQUIRED_AND_NOT_SHOWN = 2, |
173 | 208 |
(...skipping 14 matching lines...) Expand all Loading... |
188 PUSH_USER_VISIBLE_STATUS_REQUIRED_BUT_NOT_SHOWN_GRACE_EXCEEDED | 223 PUSH_USER_VISIBLE_STATUS_REQUIRED_BUT_NOT_SHOWN_GRACE_EXCEEDED |
189 }; | 224 }; |
190 | 225 |
191 const char* PushRegistrationStatusToString(PushRegistrationStatus status); | 226 const char* PushRegistrationStatusToString(PushRegistrationStatus status); |
192 | 227 |
193 const char* PushUnregistrationStatusToString(PushUnregistrationStatus status); | 228 const char* PushUnregistrationStatusToString(PushUnregistrationStatus status); |
194 | 229 |
195 } // namespace content | 230 } // namespace content |
196 | 231 |
197 #endif // CONTENT_PUBLIC_COMMON_PUSH_MESSAGING_STATUS_H_ | 232 #endif // CONTENT_PUBLIC_COMMON_PUSH_MESSAGING_STATUS_H_ |
OLD | NEW |