| 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 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 // persistence toggle. Records whether the toggle was enabled (persist) or | 189 // persistence toggle. Records whether the toggle was enabled (persist) or |
| 190 // disabled (don't persist). | 190 // disabled (don't persist). |
| 191 static void PermissionPromptAcceptedWithPersistenceToggle( | 191 static void PermissionPromptAcceptedWithPersistenceToggle( |
| 192 ContentSettingsType permission, | 192 ContentSettingsType permission, |
| 193 bool toggle_enabled); | 193 bool toggle_enabled); |
| 194 | 194 |
| 195 static void PermissionPromptDeniedWithPersistenceToggle( | 195 static void PermissionPromptDeniedWithPersistenceToggle( |
| 196 ContentSettingsType permission, | 196 ContentSettingsType permission, |
| 197 bool toggle_enabled); | 197 bool toggle_enabled); |
| 198 | 198 |
| 199 // Permission Action Reporting data is only sent in official, Chrome branded |
| 200 // builds. This function allows this to be overridden for testing. |
| 201 static void FakeOfficialBuildForTest(); |
| 202 |
| 199 private: | 203 private: |
| 200 friend class PermissionUmaUtilTest; | 204 friend class PermissionUmaUtilTest; |
| 201 | 205 |
| 202 static bool IsOptedIntoPermissionActionReporting(Profile* profile); | 206 static bool IsOptedIntoPermissionActionReporting(Profile* profile); |
| 203 | 207 |
| 204 static void RecordPermissionAction(ContentSettingsType permission, | 208 static void RecordPermissionAction(ContentSettingsType permission, |
| 205 PermissionAction action, | 209 PermissionAction action, |
| 206 PermissionSourceUI source_ui, | 210 PermissionSourceUI source_ui, |
| 207 PermissionRequestGestureType gesture_type, | 211 PermissionRequestGestureType gesture_type, |
| 208 const GURL& requesting_origin, | 212 const GURL& requesting_origin, |
| 209 Profile* profile); | 213 Profile* profile); |
| 210 | 214 |
| 211 // Records |count| total prior actions for a prompt of type |permission| | 215 // Records |count| total prior actions for a prompt of type |permission| |
| 212 // for a single origin using |prefix| for the metric. | 216 // for a single origin using |prefix| for the metric. |
| 213 static void RecordPermissionPromptPriorCount( | 217 static void RecordPermissionPromptPriorCount( |
| 214 ContentSettingsType permission, | 218 ContentSettingsType permission, |
| 215 const std::string& prefix, | 219 const std::string& prefix, |
| 216 int count); | 220 int count); |
| 217 | 221 |
| 218 DISALLOW_IMPLICIT_CONSTRUCTORS(PermissionUmaUtil); | 222 DISALLOW_IMPLICIT_CONSTRUCTORS(PermissionUmaUtil); |
| 219 }; | 223 }; |
| 220 | 224 |
| 221 #endif // CHROME_BROWSER_PERMISSIONS_PERMISSION_UMA_UTIL_H_ | 225 #endif // CHROME_BROWSER_PERMISSIONS_PERMISSION_UMA_UTIL_H_ |
| OLD | NEW |