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

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

Issue 376253005: Migrate the notification permission to the new common permission classes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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
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 92da0223fd85e464dceed1bc830cb21024cbde44..7ff97d49e91030e6c46779d7cc895569a8516394 100644
--- a/chrome/browser/content_settings/permission_context_uma_util.cc
+++ b/chrome/browser/content_settings/permission_context_uma_util.cc
@@ -24,9 +24,10 @@ enum PermissionAction {
// permission actions. Never delete or reorder an entry; only add new entries
// immediately before PERMISSION_NUM
enum PermissionType {
- PERMISSION_UNKNOWN,
- PERMISSION_MIDI_SYSEX,
- PERMISSION_PUSH_MESSAGING,
+ PERMISSION_UNKNOWN = 0,
+ PERMISSION_MIDI_SYSEX = 1,
+ PERMISSION_PUSH_MESSAGING = 2,
+ PERMISSION_NOTIFICATIONS = 3,
// Always keep this at the end.
PERMISSION_NUM,
@@ -35,6 +36,8 @@ enum PermissionType {
static const char* kMidiUmaKey = "ContentSettings.PermisionActions_MidiSysEx";
static const char* kPushMessageUmaKey =
"ContentSettings.PermisionActions_PushMessaging";
+static const char* kNotificationsUmaKey =
Peter Beverloo 2014/07/18 10:42:38 All of these should be |const char[] kFoo = "bar";
Miguel Garcia 2014/07/18 12:27:08 Done.
+ "ContentSettings.PermisionActions_Notifications";
void RecordPermissionAction(
ContentSettingsType permission, PermissionAction action) {
@@ -43,6 +46,11 @@ void RecordPermissionAction(
// TODO(miguelg): support geolocation through
// the generic permission class.
break;
+ case CONTENT_SETTINGS_TYPE_NOTIFICATIONS:
+ UMA_HISTOGRAM_ENUMERATION(kNotificationsUmaKey,
+ action,
+ PERMISSION_ACTION_NUM);
+ break;
case CONTENT_SETTINGS_TYPE_MIDI_SYSEX:
UMA_HISTOGRAM_ENUMERATION(kMidiUmaKey,
action,
@@ -68,6 +76,9 @@ void RecordPermissionRequest(
ContentSettingsType permission) {
PermissionType type;
switch (permission) {
+ case CONTENT_SETTINGS_TYPE_NOTIFICATIONS:
+ type = PERMISSION_NOTIFICATIONS;
+ break;
case CONTENT_SETTINGS_TYPE_MIDI_SYSEX:
type = PERMISSION_MIDI_SYSEX;
break;

Powered by Google App Engine
This is Rietveld 408576698