| 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 CHROME_BROWSER_PERMISSIONS_PERMISSION_UMA_UTIL_H_ | 5 #ifndef CHROME_BROWSER_PERMISSIONS_PERMISSION_UMA_UTIL_H_ |
| 6 #define CHROME_BROWSER_PERMISSIONS_PERMISSION_UMA_UTIL_H_ | 6 #define CHROME_BROWSER_PERMISSIONS_PERMISSION_UMA_UTIL_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 GURL origin; | 69 GURL origin; |
| 70 content::PermissionType permission; | 70 content::PermissionType permission; |
| 71 PermissionAction action; | 71 PermissionAction action; |
| 72 PermissionSourceUI source_ui; | 72 PermissionSourceUI source_ui; |
| 73 PermissionRequestGestureType gesture_type; | 73 PermissionRequestGestureType gesture_type; |
| 74 PermissionPersistDecision persist_decision; | 74 PermissionPersistDecision persist_decision; |
| 75 int num_prior_dismissals; | 75 int num_prior_dismissals; |
| 76 int num_prior_ignores; | 76 int num_prior_ignores; |
| 77 }; | 77 }; |
| 78 | 78 |
| 79 enum PermissionEmbargoStatus { |
| 80 NOT_EMBARGOED = 0, |
| 81 PERMISSIONS_BLACKLISTING = 1, |
| 82 REPEATED_DISMISSALS = 2, |
| 83 |
| 84 // Keep this at the end. |
| 85 STATUS_NUM, |
| 86 }; |
| 87 |
| 79 // Provides a convenient way of logging UMA for permission related operations. | 88 // Provides a convenient way of logging UMA for permission related operations. |
| 80 class PermissionUmaUtil { | 89 class PermissionUmaUtil { |
| 81 public: | 90 public: |
| 82 static const char kPermissionsPromptShown[]; | 91 static const char kPermissionsPromptShown[]; |
| 83 static const char kPermissionsPromptShownGesture[]; | 92 static const char kPermissionsPromptShownGesture[]; |
| 84 static const char kPermissionsPromptShownNoGesture[]; | 93 static const char kPermissionsPromptShownNoGesture[]; |
| 85 static const char kPermissionsPromptAccepted[]; | 94 static const char kPermissionsPromptAccepted[]; |
| 86 static const char kPermissionsPromptAcceptedGesture[]; | 95 static const char kPermissionsPromptAcceptedGesture[]; |
| 87 static const char kPermissionsPromptAcceptedNoGesture[]; | 96 static const char kPermissionsPromptAcceptedNoGesture[]; |
| 88 static const char kPermissionsPromptDenied[]; | 97 static const char kPermissionsPromptDenied[]; |
| (...skipping 29 matching lines...) Expand all Loading... |
| 118 const GURL& requesting_origin, | 127 const GURL& requesting_origin, |
| 119 Profile* profile); | 128 Profile* profile); |
| 120 static void PermissionIgnored(content::PermissionType permission, | 129 static void PermissionIgnored(content::PermissionType permission, |
| 121 PermissionRequestGestureType gesture_type, | 130 PermissionRequestGestureType gesture_type, |
| 122 const GURL& requesting_origin, | 131 const GURL& requesting_origin, |
| 123 Profile* profile); | 132 Profile* profile); |
| 124 static void PermissionRevoked(content::PermissionType permission, | 133 static void PermissionRevoked(content::PermissionType permission, |
| 125 PermissionSourceUI source_ui, | 134 PermissionSourceUI source_ui, |
| 126 const GURL& revoked_origin, | 135 const GURL& revoked_origin, |
| 127 Profile* profile); | 136 Profile* profile); |
| 137 |
| 138 static void RecordPermissionEmbargoStatus( |
| 139 PermissionEmbargoStatus embargo_status); |
| 140 |
| 128 static void RecordSafeBrowsingResponse(base::TimeDelta response_time, | 141 static void RecordSafeBrowsingResponse(base::TimeDelta response_time, |
| 129 SafeBrowsingResponse response); | 142 SafeBrowsingResponse response); |
| 143 |
| 130 // UMA specifically for when permission prompts are shown. This should be | 144 // UMA specifically for when permission prompts are shown. This should be |
| 131 // roughly equivalent to the metrics above, however it is | 145 // roughly equivalent to the metrics above, however it is |
| 132 // useful to have separate UMA to a few reasons: | 146 // useful to have separate UMA to a few reasons: |
| 133 // - to account for, and get data on coalesced permission bubbles | 147 // - to account for, and get data on coalesced permission bubbles |
| 134 // - there are other types of permissions prompts (e.g. download limiting) | 148 // - there are other types of permissions prompts (e.g. download limiting) |
| 135 // which don't go through PermissionContext | 149 // which don't go through PermissionContext |
| 136 // - the above metrics don't always add up (e.g. sum of | 150 // - the above metrics don't always add up (e.g. sum of |
| 137 // granted+denied+dismissed+ignored is not equal to requested), so it is | 151 // granted+denied+dismissed+ignored is not equal to requested), so it is |
| 138 // unclear from those metrics alone how many prompts are seen by users. | 152 // unclear from those metrics alone how many prompts are seen by users. |
| 139 static void PermissionPromptShown( | 153 static void PermissionPromptShown( |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 // for a single origin using |prefix| for the metric. | 207 // for a single origin using |prefix| for the metric. |
| 194 static void RecordPermissionPromptPriorCount( | 208 static void RecordPermissionPromptPriorCount( |
| 195 content::PermissionType permission, | 209 content::PermissionType permission, |
| 196 const std::string& prefix, | 210 const std::string& prefix, |
| 197 int count); | 211 int count); |
| 198 | 212 |
| 199 DISALLOW_IMPLICIT_CONSTRUCTORS(PermissionUmaUtil); | 213 DISALLOW_IMPLICIT_CONSTRUCTORS(PermissionUmaUtil); |
| 200 }; | 214 }; |
| 201 | 215 |
| 202 #endif // CHROME_BROWSER_PERMISSIONS_PERMISSION_UMA_UTIL_H_ | 216 #endif // CHROME_BROWSER_PERMISSIONS_PERMISSION_UMA_UTIL_H_ |
| OLD | NEW |