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

Side by Side Diff: chrome/browser/content_settings/web_site_settings_uma_util.cc

Issue 952463002: Add UMA to track permission changes from the content settings menu (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "chrome/browser/content_settings/web_site_settings_uma_util.h"
6
7 #include "base/metrics/histogram_macros.h"
8
9 void WebSiteSettingsUmaUtil::LogPermissionChange(ContentSettingsType type,
10 ContentSetting setting) {
11 ContentSettingsTypeHistogram histogram_value =
12 ContentSettingTypeToHistogramValue(type);
13 DCHECK_NE(histogram_value, CONTENT_SETTINGS_TYPE_HISTOGRAM_INVALID);
14 UMA_HISTOGRAM_ENUMERATION("WebsiteSettings.Menu.PermissionChanged",
15 histogram_value,
16 CONTENT_SETTINGS_HISTOGRAM_NUM_TYPES);
17
18 if (setting == ContentSetting::CONTENT_SETTING_ALLOW) {
19 UMA_HISTOGRAM_ENUMERATION("WebsiteSettings.Menu.PermissionChanged.Allowed",
20 histogram_value,
21 CONTENT_SETTINGS_HISTOGRAM_NUM_TYPES);
22 } else if (setting == ContentSetting::CONTENT_SETTING_BLOCK) {
23 UMA_HISTOGRAM_ENUMERATION("WebsiteSettings.Menu.PermissionChanged.Blocked",
24 histogram_value,
25 CONTENT_SETTINGS_HISTOGRAM_NUM_TYPES);
26 } else if (setting == ContentSetting::CONTENT_SETTING_DEFAULT) {
27 UMA_HISTOGRAM_ENUMERATION("WebsiteSettings.Menu.PermissionChanged.Reset",
28 histogram_value,
29 CONTENT_SETTINGS_HISTOGRAM_NUM_TYPES);
30 } else {
31 NOTREACHED() << "Requested to log permission change " << type << " to "
32 << setting;
33 }
34 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698