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

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

Issue 2226633002: Add a feature to display a persistence toggle for permission prompts on Android. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address nits, verbal change to make it geolocation-only Created 4 years, 4 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 ed0149ac7cc232ab6a2e075fd3cd6aa6014055db..e920c3e3a918576f7a20dc5bb27a5831a7b62242 100644
--- a/chrome/browser/permissions/permission_uma_util.h
+++ b/chrome/browser/permissions/permission_uma_util.h
@@ -9,6 +9,7 @@
#include "base/logging.h"
#include "base/macros.h"
+#include "chrome/browser/permissions/permission_util.h"
enum class PermissionRequestGestureType;
class GURL;
@@ -20,22 +21,6 @@ enum class PermissionType;
class PermissionRequest;
-// 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
-enum PermissionAction {
- GRANTED = 0,
- DENIED = 1,
- DISMISSED = 2,
- IGNORED = 3,
- REVOKED = 4,
- REENABLED = 5,
- REQUESTED = 6,
-
- // Always keep this at the end.
- PERMISSION_ACTION_NUM,
-};
-
// This should stay in sync with the SourceUI enum in the permission report
// protobuf (src/chrome/common/safe_browsing/permission_report.proto).
enum class PermissionSourceUI {
@@ -124,6 +109,17 @@ class PermissionUmaUtil {
static void PermissionPromptIgnored(content::PermissionType permission,
int count);
+ // A permission prompt was accepted or denied, and the prompt displayed a
+ // persistence toggle. Records whether the toggle was enabled (persist) or
+ // disabled (don't persist).
+ static void PermissionPromptAcceptedWithPersistenceToggle(
+ content::PermissionType permission,
+ bool toggle_enabled);
+
+ static void PermissionPromptDeniedWithPersistenceToggle(
+ content::PermissionType permission,
+ bool toggle_enabled);
+
private:
friend class PermissionUmaUtilTest;

Powered by Google App Engine
This is Rietveld 408576698