OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/content_settings/web_site_settings_uma_util.h" | 5 #include "chrome/browser/content_settings/web_site_settings_uma_util.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "base/metrics/histogram_macros.h" | 9 #include "base/metrics/histogram_macros.h" |
10 | 10 |
11 void WebSiteSettingsUmaUtil::LogPermissionChange(ContentSettingsType type, | 11 void WebSiteSettingsUmaUtil::LogPermissionChange(ContentSettingsType type, |
12 ContentSetting setting) { | 12 ContentSetting setting) { |
13 size_t num_values; | 13 size_t num_values; |
14 int histogram_value = ContentSettingTypeToHistogramValue(type, &num_values); | 14 int histogram_value = ContentSettingTypeToHistogramValue(type, &num_values); |
15 UMA_HISTOGRAM_ENUMERATION("WebsiteSettings.Menu.PermissionChanged", | 15 UMA_HISTOGRAM_EXACT_LINEAR("WebsiteSettings.Menu.PermissionChanged", |
16 histogram_value, num_values); | 16 histogram_value, num_values); |
17 | 17 |
18 if (setting == ContentSetting::CONTENT_SETTING_ALLOW) { | 18 if (setting == ContentSetting::CONTENT_SETTING_ALLOW) { |
19 UMA_HISTOGRAM_ENUMERATION("WebsiteSettings.Menu.PermissionChanged.Allowed", | 19 UMA_HISTOGRAM_EXACT_LINEAR("WebsiteSettings.Menu.PermissionChanged.Allowed", |
20 histogram_value, num_values); | 20 histogram_value, num_values); |
21 } else if (setting == ContentSetting::CONTENT_SETTING_BLOCK) { | 21 } else if (setting == ContentSetting::CONTENT_SETTING_BLOCK) { |
22 UMA_HISTOGRAM_ENUMERATION("WebsiteSettings.Menu.PermissionChanged.Blocked", | 22 UMA_HISTOGRAM_EXACT_LINEAR("WebsiteSettings.Menu.PermissionChanged.Blocked", |
23 histogram_value, num_values); | 23 histogram_value, num_values); |
24 } else if (setting == ContentSetting::CONTENT_SETTING_DEFAULT) { | 24 } else if (setting == ContentSetting::CONTENT_SETTING_DEFAULT) { |
25 UMA_HISTOGRAM_ENUMERATION("WebsiteSettings.Menu.PermissionChanged.Reset", | 25 UMA_HISTOGRAM_EXACT_LINEAR("WebsiteSettings.Menu.PermissionChanged.Reset", |
26 histogram_value, num_values); | 26 histogram_value, num_values); |
27 } else { | 27 } else { |
28 NOTREACHED() << "Requested to log permission change " << type << " to " | 28 NOTREACHED() << "Requested to log permission change " << type << " to " |
29 << setting; | 29 << setting; |
30 } | 30 } |
31 } | 31 } |
OLD | NEW |