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

Unified Diff: chrome/browser/content_settings/permission_context_uma_util.cc

Issue 459953002: Migrate geolocation permissions to the new common permission class. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 3 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/content_settings/permission_context_uma_util.cc
diff --git a/chrome/browser/content_settings/permission_context_uma_util.cc b/chrome/browser/content_settings/permission_context_uma_util.cc
index 0b16be020ee05b746ed15dc06bc2e5fb998b8a63..b76d5414a384ea1f6f85f4c9749ab80a96c73341 100644
--- a/chrome/browser/content_settings/permission_context_uma_util.cc
+++ b/chrome/browser/content_settings/permission_context_uma_util.cc
@@ -28,6 +28,7 @@ enum PermissionType {
PERMISSION_MIDI_SYSEX = 1,
PERMISSION_PUSH_MESSAGING = 2,
PERMISSION_NOTIFICATIONS = 3,
+ PERMISSION_GEOLOCATION = 4,
// Always keep this at the end.
PERMISSION_NUM,
@@ -37,8 +38,10 @@ void RecordPermissionAction(
ContentSettingsType permission, PermissionAction action) {
switch (permission) {
case CONTENT_SETTINGS_TYPE_GEOLOCATION:
- // TODO(miguelg): support geolocation through
- // the generic permission class.
+ UMA_HISTOGRAM_ENUMERATION(
+ "ContentSettings.PermissionActions_Geolocation",
+ action,
+ PERMISSION_ACTION_NUM);
break;
case CONTENT_SETTINGS_TYPE_NOTIFICATIONS:
UMA_HISTOGRAM_ENUMERATION(
@@ -72,6 +75,9 @@ void RecordPermissionRequest(
ContentSettingsType permission) {
PermissionType type;
switch (permission) {
+ case CONTENT_SETTINGS_TYPE_GEOLOCATION:
+ type = PERMISSION_GEOLOCATION;
+ break;
case CONTENT_SETTINGS_TYPE_NOTIFICATIONS:
type = PERMISSION_NOTIFICATIONS;
break;

Powered by Google App Engine
This is Rietveld 408576698