| 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" |
| 11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "chrome/browser/permissions/permission_request.h" |
| 12 #include "chrome/browser/permissions/permission_util.h" | 13 #include "chrome/browser/permissions/permission_util.h" |
| 13 | 14 |
| 14 enum class PermissionRequestGestureType; | 15 enum class PermissionRequestGestureType; |
| 15 class GURL; | 16 class GURL; |
| 16 class PermissionRequest; | 17 class PermissionRequest; |
| 17 class Profile; | 18 class Profile; |
| 18 | 19 |
| 19 namespace content { | 20 namespace content { |
| 20 enum class PermissionType; | 21 enum class PermissionType; |
| 21 } // namespace content | 22 } // namespace content |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 // Note that for coalesced permission bubbles, PermissionPromptAccepted will | 132 // Note that for coalesced permission bubbles, PermissionPromptAccepted will |
| 132 // always be called, with |accept_states| containing whether each request was | 133 // always be called, with |accept_states| containing whether each request was |
| 133 // accepted or denied. | 134 // accepted or denied. |
| 134 static void PermissionPromptAccepted( | 135 static void PermissionPromptAccepted( |
| 135 const std::vector<PermissionRequest*>& requests, | 136 const std::vector<PermissionRequest*>& requests, |
| 136 const std::vector<bool>& accept_states); | 137 const std::vector<bool>& accept_states); |
| 137 | 138 |
| 138 static void PermissionPromptDenied( | 139 static void PermissionPromptDenied( |
| 139 const std::vector<PermissionRequest*>& requests); | 140 const std::vector<PermissionRequest*>& requests); |
| 140 | 141 |
| 142 // Records the request type and gesture type for a shown, accepted, and denied |
| 143 // prompt. Defined separately as Android must call this method explicitly |
| 144 // until the removal of PermissionQueueController is completed. |
| 145 static void RecordPermissionPromptShown( |
| 146 PermissionRequestType request_type, |
| 147 PermissionRequestGestureType gesture_type); |
| 148 |
| 149 static void RecordPermissionPromptAccepted( |
| 150 PermissionRequestType request_type, |
| 151 PermissionRequestGestureType gesture_type); |
| 152 |
| 153 static void RecordPermissionPromptDenied( |
| 154 PermissionRequestType request_type, |
| 155 PermissionRequestGestureType gesture_type); |
| 156 |
| 141 // A permission prompt was accepted or denied, and the prompt displayed a | 157 // A permission prompt was accepted or denied, and the prompt displayed a |
| 142 // persistence toggle. Records whether the toggle was enabled (persist) or | 158 // persistence toggle. Records whether the toggle was enabled (persist) or |
| 143 // disabled (don't persist). | 159 // disabled (don't persist). |
| 144 static void PermissionPromptAcceptedWithPersistenceToggle( | 160 static void PermissionPromptAcceptedWithPersistenceToggle( |
| 145 content::PermissionType permission, | 161 content::PermissionType permission, |
| 146 bool toggle_enabled); | 162 bool toggle_enabled); |
| 147 | 163 |
| 148 static void PermissionPromptDeniedWithPersistenceToggle( | 164 static void PermissionPromptDeniedWithPersistenceToggle( |
| 149 content::PermissionType permission, | 165 content::PermissionType permission, |
| 150 bool toggle_enabled); | 166 bool toggle_enabled); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 165 // for a single origin using |prefix| for the metric. | 181 // for a single origin using |prefix| for the metric. |
| 166 static void RecordPermissionPromptPriorCount( | 182 static void RecordPermissionPromptPriorCount( |
| 167 content::PermissionType permission, | 183 content::PermissionType permission, |
| 168 const std::string& prefix, | 184 const std::string& prefix, |
| 169 int count); | 185 int count); |
| 170 | 186 |
| 171 DISALLOW_IMPLICIT_CONSTRUCTORS(PermissionUmaUtil); | 187 DISALLOW_IMPLICIT_CONSTRUCTORS(PermissionUmaUtil); |
| 172 }; | 188 }; |
| 173 | 189 |
| 174 #endif // CHROME_BROWSER_PERMISSIONS_PERMISSION_UMA_UTIL_H_ | 190 #endif // CHROME_BROWSER_PERMISSIONS_PERMISSION_UMA_UTIL_H_ |
| OLD | NEW |