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

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, 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/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 2b7ff8f18f6d8c071bba34f6ffa245493b4fe91e..2984eebef11ddf1b7550f64b8006f774fe37a3e1 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,9 +38,11 @@ void RecordPermissionAction(
ContentSettingsType permission, PermissionAction action) {
switch (permission) {
case CONTENT_SETTINGS_TYPE_GEOLOCATION:
- // TODO(miguelg): support geolocation through
- // the generic permission class.
- break;
+ UMA_HISTOGRAM_ENUMERATION(
+ "ContentSettings.PermisionActions_Geolocation",
+ action,
+ PERMISSION_ACTION_NUM);
+
case CONTENT_SETTINGS_TYPE_NOTIFICATIONS:
UMA_HISTOGRAM_ENUMERATION(
"ContentSettings.PermisionActions_Notifications",
@@ -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