OLD | NEW |
(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 } |
OLD | NEW |