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 | 12 |
| 13 enum class PermissionRequestGestureType; |
13 class GURL; | 14 class GURL; |
14 class Profile; | 15 class Profile; |
15 | 16 |
16 namespace content { | 17 namespace content { |
17 enum class PermissionType; | 18 enum class PermissionType; |
18 } // namespace content | 19 } // namespace content |
19 | 20 |
20 class PermissionRequest; | 21 class PermissionRequest; |
21 | 22 |
22 // Enum for UMA purposes, make sure you update histograms.xml if you add new | 23 // Enum for UMA purposes, make sure you update histograms.xml if you add new |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 static const char kPermissionsPromptRequestsPerPrompt[]; | 63 static const char kPermissionsPromptRequestsPerPrompt[]; |
63 static const char kPermissionsPromptMergedBubbleTypes[]; | 64 static const char kPermissionsPromptMergedBubbleTypes[]; |
64 static const char kPermissionsPromptMergedBubbleAccepted[]; | 65 static const char kPermissionsPromptMergedBubbleAccepted[]; |
65 static const char kPermissionsPromptMergedBubbleDenied[]; | 66 static const char kPermissionsPromptMergedBubbleDenied[]; |
66 | 67 |
67 static void PermissionRequested(content::PermissionType permission, | 68 static void PermissionRequested(content::PermissionType permission, |
68 const GURL& requesting_origin, | 69 const GURL& requesting_origin, |
69 const GURL& embedding_origin, | 70 const GURL& embedding_origin, |
70 Profile* profile); | 71 Profile* profile); |
71 static void PermissionGranted(content::PermissionType permission, | 72 static void PermissionGranted(content::PermissionType permission, |
| 73 PermissionRequestGestureType gesture_type, |
72 const GURL& requesting_origin, | 74 const GURL& requesting_origin, |
73 Profile* profile); | 75 Profile* profile); |
74 static void PermissionDenied(content::PermissionType permission, | 76 static void PermissionDenied(content::PermissionType permission, |
| 77 PermissionRequestGestureType gesture_type, |
75 const GURL& requesting_origin, | 78 const GURL& requesting_origin, |
76 Profile* profile); | 79 Profile* profile); |
77 static void PermissionDismissed(content::PermissionType permission, | 80 static void PermissionDismissed(content::PermissionType permission, |
| 81 PermissionRequestGestureType gesture_type, |
78 const GURL& requesting_origin, | 82 const GURL& requesting_origin, |
79 Profile* profile); | 83 Profile* profile); |
80 static void PermissionIgnored(content::PermissionType permission, | 84 static void PermissionIgnored(content::PermissionType permission, |
| 85 PermissionRequestGestureType gesture_type, |
81 const GURL& requesting_origin, | 86 const GURL& requesting_origin, |
82 Profile* profile); | 87 Profile* profile); |
83 static void PermissionRevoked(content::PermissionType permission, | 88 static void PermissionRevoked(content::PermissionType permission, |
84 PermissionSourceUI source_ui, | 89 PermissionSourceUI source_ui, |
85 const GURL& revoked_origin, | 90 const GURL& revoked_origin, |
86 Profile* profile); | 91 Profile* profile); |
87 | 92 |
88 // UMA specifically for when permission prompts are shown. This should be | 93 // UMA specifically for when permission prompts are shown. This should be |
89 // roughly equivalent to the metrics above, however it is | 94 // roughly equivalent to the metrics above, however it is |
90 // useful to have separate UMA to a few reasons: | 95 // useful to have separate UMA to a few reasons: |
(...skipping 19 matching lines...) Expand all Loading... |
110 const std::vector<PermissionRequest*>& requests); | 115 const std::vector<PermissionRequest*>& requests); |
111 | 116 |
112 private: | 117 private: |
113 friend class PermissionUmaUtilTest; | 118 friend class PermissionUmaUtilTest; |
114 | 119 |
115 static bool IsOptedIntoPermissionActionReporting(Profile* profile); | 120 static bool IsOptedIntoPermissionActionReporting(Profile* profile); |
116 | 121 |
117 static void RecordPermissionAction(content::PermissionType permission, | 122 static void RecordPermissionAction(content::PermissionType permission, |
118 PermissionAction action, | 123 PermissionAction action, |
119 PermissionSourceUI source_ui, | 124 PermissionSourceUI source_ui, |
| 125 PermissionRequestGestureType gesture_type, |
120 const GURL& requesting_origin, | 126 const GURL& requesting_origin, |
121 Profile* profile); | 127 Profile* profile); |
122 | 128 |
123 DISALLOW_IMPLICIT_CONSTRUCTORS(PermissionUmaUtil); | 129 DISALLOW_IMPLICIT_CONSTRUCTORS(PermissionUmaUtil); |
124 }; | 130 }; |
125 | 131 |
126 #endif // CHROME_BROWSER_PERMISSIONS_PERMISSION_UMA_UTIL_H_ | 132 #endif // CHROME_BROWSER_PERMISSIONS_PERMISSION_UMA_UTIL_H_ |
OLD | NEW |