| 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 // Records |count| total dismissal actions for a prompt of type |permission| |
| 118 // for a single origin. |
| 119 static void PermissionPromptDismissed(content::PermissionType permission, |
| 120 int count); |
| 121 |
| 122 // Records |count| total ignore actions for a prompt of type |permission| for |
| 123 // a single origin. |
| 124 static void PermissionPromptIgnored(content::PermissionType permission, |
| 125 int count); |
| 126 |
| 117 private: | 127 private: |
| 118 friend class PermissionUmaUtilTest; | 128 friend class PermissionUmaUtilTest; |
| 119 | 129 |
| 120 static bool IsOptedIntoPermissionActionReporting(Profile* profile); | 130 static bool IsOptedIntoPermissionActionReporting(Profile* profile); |
| 121 | 131 |
| 122 static void RecordPermissionAction(content::PermissionType permission, | 132 static void RecordPermissionAction(content::PermissionType permission, |
| 123 PermissionAction action, | 133 PermissionAction action, |
| 124 PermissionSourceUI source_ui, | 134 PermissionSourceUI source_ui, |
| 125 PermissionRequestGestureType gesture_type, | 135 PermissionRequestGestureType gesture_type, |
| 126 const GURL& requesting_origin, | 136 const GURL& requesting_origin, |
| 127 Profile* profile); | 137 Profile* profile); |
| 128 | 138 |
| 129 DISALLOW_IMPLICIT_CONSTRUCTORS(PermissionUmaUtil); | 139 DISALLOW_IMPLICIT_CONSTRUCTORS(PermissionUmaUtil); |
| 130 }; | 140 }; |
| 131 | 141 |
| 132 #endif // CHROME_BROWSER_PERMISSIONS_PERMISSION_UMA_UTIL_H_ | 142 #endif // CHROME_BROWSER_PERMISSIONS_PERMISSION_UMA_UTIL_H_ |
| OLD | NEW |