Switch global error menu icon to vectorized MD asset
[chromium-blink-merge.git] / chrome / browser / content_settings / web_site_settings_uma_util.cc
blob4aa979d2dd26c547efba9b092e8dd94b83fb2b48
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 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);
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;