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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 // Note that for coalesced permission bubbles, PermissionPromptAccepted will | 107 // Note that for coalesced permission bubbles, PermissionPromptAccepted will |
108 // always be called, with |accept_states| containing whether each request was | 108 // always be called, with |accept_states| containing whether each request was |
109 // accepted or denied. | 109 // accepted or denied. |
110 static void PermissionPromptAccepted( | 110 static void PermissionPromptAccepted( |
111 const std::vector<PermissionRequest*>& requests, | 111 const std::vector<PermissionRequest*>& requests, |
112 const std::vector<bool>& accept_states); | 112 const std::vector<bool>& accept_states); |
113 | 113 |
114 static void PermissionPromptDenied( | 114 static void PermissionPromptDenied( |
115 const std::vector<PermissionRequest*>& requests); | 115 const std::vector<PermissionRequest*>& requests); |
116 | 116 |
| 117 // A permission prompt was granted or denied, and the prompt had a persistence |
| 118 // toggle displayed. Records whether the toggle was enabled (persist) or |
| 119 // disabled (don't persist). |
| 120 static void PermissionPromptGrantedWithPersistenceToggle( |
| 121 content::PermissionType permission, |
| 122 bool toggle_enabled); |
| 123 |
| 124 static void PermissionPromptDeniedWithPersistenceToggle( |
| 125 content::PermissionType permission, |
| 126 bool toggle_enabled); |
| 127 |
117 private: | 128 private: |
118 friend class PermissionUmaUtilTest; | 129 friend class PermissionUmaUtilTest; |
119 | 130 |
120 static bool IsOptedIntoPermissionActionReporting(Profile* profile); | 131 static bool IsOptedIntoPermissionActionReporting(Profile* profile); |
121 | 132 |
122 static void RecordPermissionAction(content::PermissionType permission, | 133 static void RecordPermissionAction(content::PermissionType permission, |
123 PermissionAction action, | 134 PermissionAction action, |
124 PermissionSourceUI source_ui, | 135 PermissionSourceUI source_ui, |
125 PermissionRequestGestureType gesture_type, | 136 PermissionRequestGestureType gesture_type, |
126 const GURL& requesting_origin, | 137 const GURL& requesting_origin, |
127 Profile* profile); | 138 Profile* profile); |
128 | 139 |
129 DISALLOW_IMPLICIT_CONSTRUCTORS(PermissionUmaUtil); | 140 DISALLOW_IMPLICIT_CONSTRUCTORS(PermissionUmaUtil); |
130 }; | 141 }; |
131 | 142 |
132 #endif // CHROME_BROWSER_PERMISSIONS_PERMISSION_UMA_UTIL_H_ | 143 #endif // CHROME_BROWSER_PERMISSIONS_PERMISSION_UMA_UTIL_H_ |
OLD | NEW |