Index: chrome/browser/permissions/permission_uma_util.h |
diff --git a/chrome/browser/permissions/permission_uma_util.h b/chrome/browser/permissions/permission_uma_util.h |
index 61a08d9356ef7a2adfeed6bfc62eed93bfdae058..aaa3dab04ee83838a5214d790910d1b61e50349b 100644 |
--- a/chrome/browser/permissions/permission_uma_util.h |
+++ b/chrome/browser/permissions/permission_uma_util.h |
@@ -21,6 +21,10 @@ namespace content { |
enum class PermissionType; |
} // namespace content |
+namespace base { |
+class TimeDelta; |
+} // namespace base |
+ |
// This should stay in sync with the SourceUI enum in the permission report |
// protobuf (src/chrome/common/safe_browsing/permission_report.proto). |
enum class PermissionSourceUI { |
@@ -41,6 +45,26 @@ enum class PermissionPersistDecision { |
NOT_PERSISTED = 2, |
}; |
+// This is used to back a UMA histogram, so it should be treated as append-only. |
+// Any new values should be inserted immediately prior to REPEATED_DISMISSALS. |
+enum PermissionEmbargoReason { |
+ REPEATED_DISMISSALS = 0, |
+ PERMISSIONS_BLACKLISTING = 1, |
dominickn
2017/01/27 06:05:47
This can probably just be called BLACKLISTED
meredithl
2017/01/29 23:48:30
I get a name collision with SafeBrowsingResponse,
dominickn
2017/01/30 00:06:20
Ah, I see. Leave it as is then. :)
meredithl
2017/01/30 00:34:33
Acknowledged.
|
+ NOT_EMBARGOED = 2, |
+ |
+ // Always keep this at the end. |
+ EMBARGO_NUM, |
dominickn
2017/01/27 06:05:47
REASON_NUM
meredithl
2017/01/29 23:48:30
Done.
|
+}; |
+ |
+enum SafeBrowsingResponse { |
+ NOT_BLACKLISTED = 0, |
+ TIMEOUT = 1, |
+ BLACKLISTED = 2, |
+ |
+ // Always keep this at the end. |
+ RESPONSE_NUM, |
+}; |
+ |
// A bundle for the information sent in a PermissionReport. |
struct PermissionReportInfo { |
PermissionReportInfo( |
@@ -114,7 +138,11 @@ class PermissionUmaUtil { |
PermissionSourceUI source_ui, |
const GURL& revoked_origin, |
Profile* profile); |
- |
+ static void RecordPermissionEmbargoReason( |
+ PermissionEmbargoReason embargo_reason); |
+ static void RecordSafeBrowsingResponse(base::TimeDelta response_time, |
+ SafeBrowsingResponse response); |
+ static void RecordRepeatedEmbargo(PermissionEmbargoReason embargo_reason); |
// UMA specifically for when permission prompts are shown. This should be |
// roughly equivalent to the metrics above, however it is |
// useful to have separate UMA to a few reasons: |