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

Unified Diff: content/public/common/push_messaging_status.h

Issue 2387483002: Push API: Refactor and fix unsubscribe API (Closed)
Patch Set: Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: content/public/common/push_messaging_status.h
diff --git a/content/public/common/push_messaging_status.h b/content/public/common/push_messaging_status.h
index 9dd87ebcc54f3519296897a111ec1a20a81ed6bb..45fc412cca35f0f97008b1ccdbdc48174fa979af 100644
--- a/content/public/common/push_messaging_status.h
+++ b/content/public/common/push_messaging_status.h
@@ -65,6 +65,32 @@ enum PushRegistrationStatus {
PUSH_REGISTRATION_STATUS_MANIFEST_EMPTY_OR_MISSING
};
+// Push unregistration reason for reporting in UMA.
+enum PushUnregistrationReason {
+ // Unregistering because the website called the unsubscribe API.
+ PUSH_UNREGISTRATION_REASON_JAVASCRIPT_API = 0,
+
+ // Unregistering because the user manually revoked permission.
+ PUSH_UNREGISTRATION_REASON_PERMISSION_REVOKED = 1,
+
+ // Automatic - incoming message's app id was unknown.
+ PUSH_UNREGISTRATION_REASON_DELIVERY_UNKNOWN_APP_ID = 2,
+
+ // Automatic - incoming message's origin no longer has permission.
+ PUSH_UNREGISTRATION_REASON_DELIVERY_PERMISSION_DENIED = 3,
+
+ // Automatic - incoming message's service worker was not found.
+ PUSH_UNREGISTRATION_REASON_DELIVERY_NO_SERVICE_WORKER = 4,
+
+ // NOTE: Do not renumber these as that would confuse interpretation of
+ // previously logged data. When making changes, also update the enum list
+ // in tools/metrics/histograms/histograms.xml to keep it in sync, and
+ // update PUSH_UNREGISTRATION_REASON_LAST below.
+
+ PUSH_UNREGISTRATION_REASON_LAST =
+ PUSH_UNREGISTRATION_REASON_DELIVERY_NO_SERVICE_WORKER
+};
+
// Push unregistration success/error codes for internal use & reporting in UMA.
enum PushUnregistrationStatus {
// The unregistration was successful.

Powered by Google App Engine
This is Rietveld 408576698