| 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. |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 | 58 |
| 59 // NOTE: Do not renumber these as that would confuse interpretation of | 59 // NOTE: Do not renumber these as that would confuse interpretation of |
| 60 // previously logged data. When making changes, also update the enum list | 60 // previously logged data. When making changes, also update the enum list |
| 61 // in tools/metrics/histograms/histograms.xml to keep it in sync, and | 61 // in tools/metrics/histograms/histograms.xml to keep it in sync, and |
| 62 // update PUSH_REGISTRATION_STATUS_LAST below. | 62 // update PUSH_REGISTRATION_STATUS_LAST below. |
| 63 | 63 |
| 64 PUSH_REGISTRATION_STATUS_LAST = | 64 PUSH_REGISTRATION_STATUS_LAST = |
| 65 PUSH_REGISTRATION_STATUS_MANIFEST_EMPTY_OR_MISSING | 65 PUSH_REGISTRATION_STATUS_MANIFEST_EMPTY_OR_MISSING |
| 66 }; | 66 }; |
| 67 | 67 |
| 68 // Push unregistration reason for reporting in UMA. |
| 69 enum PushUnregistrationReason { |
| 70 // Unregistering because the website called the unsubscribe API. |
| 71 PUSH_UNREGISTRATION_REASON_JAVASCRIPT_API = 0, |
| 72 |
| 73 // Unregistering because the user manually revoked permission. |
| 74 PUSH_UNREGISTRATION_REASON_PERMISSION_REVOKED = 1, |
| 75 |
| 76 // Automatic - incoming message's app id was unknown. |
| 77 PUSH_UNREGISTRATION_REASON_DELIVERY_UNKNOWN_APP_ID = 2, |
| 78 |
| 79 // Automatic - incoming message's origin no longer has permission. |
| 80 PUSH_UNREGISTRATION_REASON_DELIVERY_PERMISSION_DENIED = 3, |
| 81 |
| 82 // Automatic - incoming message's service worker was not found. |
| 83 PUSH_UNREGISTRATION_REASON_DELIVERY_NO_SERVICE_WORKER = 4, |
| 84 |
| 85 // NOTE: Do not renumber these as that would confuse interpretation of |
| 86 // previously logged data. When making changes, also update the enum list |
| 87 // in tools/metrics/histograms/histograms.xml to keep it in sync, and |
| 88 // update PUSH_UNREGISTRATION_REASON_LAST below. |
| 89 |
| 90 PUSH_UNREGISTRATION_REASON_LAST = |
| 91 PUSH_UNREGISTRATION_REASON_DELIVERY_NO_SERVICE_WORKER |
| 92 }; |
| 93 |
| 68 // Push unregistration success/error codes for internal use & reporting in UMA. | 94 // Push unregistration success/error codes for internal use & reporting in UMA. |
| 69 enum PushUnregistrationStatus { | 95 enum PushUnregistrationStatus { |
| 70 // The unregistration was successful. | 96 // The unregistration was successful. |
| 71 PUSH_UNREGISTRATION_STATUS_SUCCESS_UNREGISTERED = 0, | 97 PUSH_UNREGISTRATION_STATUS_SUCCESS_UNREGISTERED = 0, |
| 72 | 98 |
| 73 // Unregistration was unnecessary, as the registration was not found. | 99 // Unregistration was unnecessary, as the registration was not found. |
| 74 PUSH_UNREGISTRATION_STATUS_SUCCESS_WAS_NOT_REGISTERED = 1, | 100 PUSH_UNREGISTRATION_STATUS_SUCCESS_WAS_NOT_REGISTERED = 1, |
| 75 | 101 |
| 76 // The unregistration did not happen because of a network error, but will be | 102 // The unregistration did not happen because of a network error, but will be |
| 77 // retried until it succeeds. | 103 // retried until it succeeds. |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 PUSH_USER_VISIBLE_STATUS_REQUIRED_BUT_NOT_SHOWN_GRACE_EXCEEDED | 214 PUSH_USER_VISIBLE_STATUS_REQUIRED_BUT_NOT_SHOWN_GRACE_EXCEEDED |
| 189 }; | 215 }; |
| 190 | 216 |
| 191 const char* PushRegistrationStatusToString(PushRegistrationStatus status); | 217 const char* PushRegistrationStatusToString(PushRegistrationStatus status); |
| 192 | 218 |
| 193 const char* PushUnregistrationStatusToString(PushUnregistrationStatus status); | 219 const char* PushUnregistrationStatusToString(PushUnregistrationStatus status); |
| 194 | 220 |
| 195 } // namespace content | 221 } // namespace content |
| 196 | 222 |
| 197 #endif // CONTENT_PUBLIC_COMMON_PUSH_MESSAGING_STATUS_H_ | 223 #endif // CONTENT_PUBLIC_COMMON_PUSH_MESSAGING_STATUS_H_ |
| OLD | NEW |