Add new certificateProvider extension API.
[chromium-blink-merge.git] / chrome / browser / content_settings / web_site_settings_uma_util.cc
blobbb15012659c48d509205bcc98827cbe6c0ef6fbb
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.
5 #include "chrome/browser/content_settings/web_site_settings_uma_util.h"
7 #include "base/metrics/histogram_macros.h"
9 void WebSiteSettingsUmaUtil::LogPermissionChange(ContentSettingsType type,
10 ContentSetting setting) {
11 size_t num_values;
12 int histogram_value = ContentSettingTypeToHistogramValue(type, &num_values);
13 UMA_HISTOGRAM_ENUMERATION("WebsiteSettings.Menu.PermissionChanged",
14 histogram_value, num_values);
16 if (setting == ContentSetting::CONTENT_SETTING_ALLOW) {
17 UMA_HISTOGRAM_ENUMERATION("WebsiteSettings.Menu.PermissionChanged.Allowed",
18 histogram_value, num_values);
19 } else if (setting == ContentSetting::CONTENT_SETTING_BLOCK) {
20 UMA_HISTOGRAM_ENUMERATION("WebsiteSettings.Menu.PermissionChanged.Blocked",
21 histogram_value, num_values);
22 } else if (setting == ContentSetting::CONTENT_SETTING_DEFAULT) {
23 UMA_HISTOGRAM_ENUMERATION("WebsiteSettings.Menu.PermissionChanged.Reset",
24 histogram_value, num_values);
25 } else {
26 NOTREACHED() << "Requested to log permission change " << type << " to "
27 << setting;