Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(673)

Unified Diff: chrome/browser/permissions/permission_uma_util.cc

Issue 2153133002: Add gesture type value from desktop prompt to permission report (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@add-user-gesture-to-reporting-part
Patch Set: nit Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/permissions/permission_uma_util.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/permissions/permission_uma_util.cc
diff --git a/chrome/browser/permissions/permission_uma_util.cc b/chrome/browser/permissions/permission_uma_util.cc
index 69b0d60cf649047ae72bc91c12d23184c3b797ad..31481f035059ed6b0a92a1e3f55f91611ccf634b 100644
--- a/chrome/browser/permissions/permission_uma_util.cc
+++ b/chrome/browser/permissions/permission_uma_util.cc
@@ -217,32 +217,40 @@ void PermissionUmaUtil::PermissionRequested(PermissionType permission,
profile);
}
-void PermissionUmaUtil::PermissionGranted(PermissionType permission,
- const GURL& requesting_origin,
- Profile* profile) {
+void PermissionUmaUtil::PermissionGranted(
+ PermissionType permission,
+ PermissionRequestGestureType gesture_type,
+ const GURL& requesting_origin,
+ Profile* profile) {
RecordPermissionAction(permission, GRANTED, PermissionSourceUI::PROMPT,
- requesting_origin, profile);
+ gesture_type, requesting_origin, profile);
}
-void PermissionUmaUtil::PermissionDenied(PermissionType permission,
- const GURL& requesting_origin,
- Profile* profile) {
+void PermissionUmaUtil::PermissionDenied(
+ PermissionType permission,
+ PermissionRequestGestureType gesture_type,
+ const GURL& requesting_origin,
+ Profile* profile) {
RecordPermissionAction(permission, DENIED, PermissionSourceUI::PROMPT,
- requesting_origin, profile);
+ gesture_type, requesting_origin, profile);
}
-void PermissionUmaUtil::PermissionDismissed(PermissionType permission,
- const GURL& requesting_origin,
- Profile* profile) {
+void PermissionUmaUtil::PermissionDismissed(
+ PermissionType permission,
+ PermissionRequestGestureType gesture_type,
+ const GURL& requesting_origin,
+ Profile* profile) {
RecordPermissionAction(permission, DISMISSED, PermissionSourceUI::PROMPT,
- requesting_origin, profile);
+ gesture_type, requesting_origin, profile);
}
-void PermissionUmaUtil::PermissionIgnored(PermissionType permission,
- const GURL& requesting_origin,
- Profile* profile) {
+void PermissionUmaUtil::PermissionIgnored(
+ PermissionType permission,
+ PermissionRequestGestureType gesture_type,
+ const GURL& requesting_origin,
+ Profile* profile) {
RecordPermissionAction(permission, IGNORED, PermissionSourceUI::PROMPT,
- requesting_origin, profile);
+ gesture_type, requesting_origin, profile);
}
void PermissionUmaUtil::PermissionRevoked(PermissionType permission,
@@ -255,8 +263,11 @@ void PermissionUmaUtil::PermissionRevoked(PermissionType permission,
permission == PermissionType::GEOLOCATION ||
permission == PermissionType::AUDIO_CAPTURE ||
permission == PermissionType::VIDEO_CAPTURE) {
- RecordPermissionAction(permission, REVOKED, source_ui, revoked_origin,
- profile);
+ // An unknown gesture type is passed in since gesture type is only
+ // applicable in prompt UIs where revocations are not possible.
+ RecordPermissionAction(permission, REVOKED, source_ui,
+ PermissionRequestGestureType::UNKNOWN,
+ revoked_origin, profile);
}
}
@@ -377,20 +388,20 @@ bool PermissionUmaUtil::IsOptedIntoPermissionActionReporting(Profile* profile) {
return true;
}
-void PermissionUmaUtil::RecordPermissionAction(PermissionType permission,
- PermissionAction action,
- PermissionSourceUI source_ui,
- const GURL& requesting_origin,
- Profile* profile) {
+void PermissionUmaUtil::RecordPermissionAction(
+ PermissionType permission,
+ PermissionAction action,
+ PermissionSourceUI source_ui,
+ PermissionRequestGestureType gesture_type,
+ const GURL& requesting_origin,
+ Profile* profile) {
if (IsOptedIntoPermissionActionReporting(profile)) {
// TODO(stefanocs): Add browsertests to make sure the reports are being
// sent.
- // TODO(stefanocs): Get the actual |user_gesture| from permission layer.
g_browser_process->safe_browsing_service()
->ui_manager()
->ReportPermissionAction(requesting_origin, permission, action,
- source_ui,
- PermissionRequestGestureType::UNKNOWN);
+ source_ui, gesture_type);
}
bool secure_origin = content::IsOriginSecure(requesting_origin);
« no previous file with comments | « chrome/browser/permissions/permission_uma_util.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698