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

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

Issue 1884073002: Add a new metric for how many times permissions prompts are shown. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Feedback Created 4 years, 8 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
Index: chrome/browser/permissions/permission_uma_util.h
diff --git a/chrome/browser/permissions/permission_uma_util.h b/chrome/browser/permissions/permission_uma_util.h
index 1f5f24b330e0bccd62638ac9557226be2ebc0efb..c4c8001d215749510c9f390aad526442da0db199 100644
--- a/chrome/browser/permissions/permission_uma_util.h
+++ b/chrome/browser/permissions/permission_uma_util.h
@@ -5,6 +5,8 @@
#ifndef CHROME_BROWSER_PERMISSIONS_PERMISSION_UMA_UTIL_H_
#define CHROME_BROWSER_PERMISSIONS_PERMISSION_UMA_UTIL_H_
+#include <vector>
+
#include "base/logging.h"
#include "base/macros.h"
@@ -15,6 +17,8 @@ namespace content {
enum class PermissionType;
} // namespace content
+class PermissionBubbleRequest;
+
// Enum for UMA purposes, make sure you update histograms.xml if you add new
// permission actions. Never delete or reorder an entry; only add new entries
// immediately before PERMISSION_NUM
@@ -49,6 +53,18 @@ class PermissionUmaUtil {
static void PermissionRevoked(content::PermissionType permission,
const GURL& revoked_origin);
+ // UMA specifically for when permission prompts are shown. This should be
+ // roughly equivalent to the metrics above, however it is
+ // useful to have separate UMA to a few reasons:
+ // - to account for, and get data on coalesced permission bubbles
+ // - there are other types of permissions prompts (e.g. download limiting)
+ // which don't go through PermissionContext
+ // - the above metrics don't always add up (e.g. sum of
+ // granted+denied+dismissed+ignored is not equal to requested), so it is
+ // unclear from those metrics alone how many prompts are seen by users.
+ static void PermissionPromptShown(
+ const std::vector<PermissionBubbleRequest*>& requests);
+
private:
DISALLOW_IMPLICIT_CONSTRUCTORS(PermissionUmaUtil);
};
« no previous file with comments | « chrome/browser/permissions/permission_bubble_request_impl.cc ('k') | chrome/browser/permissions/permission_uma_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698