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

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

Issue 8698006: Add UMA for default content settings values, and default content settings changed actions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove unrelated changes Created 9 years 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/content_settings_default_provider.h" 5 #include "chrome/browser/content_settings/content_settings_default_provider.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/auto_reset.h" 10 #include "base/auto_reset.h"
11 #include "base/basictypes.h" 11 #include "base/basictypes.h"
12 #include "base/command_line.h" 12 #include "base/command_line.h"
13 #include "base/metrics/histogram.h"
13 #include "chrome/browser/content_settings/content_settings_rule.h" 14 #include "chrome/browser/content_settings/content_settings_rule.h"
14 #include "chrome/browser/content_settings/content_settings_utils.h" 15 #include "chrome/browser/content_settings/content_settings_utils.h"
15 #include "chrome/browser/prefs/pref_service.h" 16 #include "chrome/browser/prefs/pref_service.h"
16 #include "chrome/browser/prefs/scoped_user_pref_update.h" 17 #include "chrome/browser/prefs/scoped_user_pref_update.h"
17 #include "chrome/common/chrome_notification_types.h" 18 #include "chrome/common/chrome_notification_types.h"
18 #include "chrome/common/content_settings.h" 19 #include "chrome/common/content_settings.h"
19 #include "chrome/common/content_settings_pattern.h" 20 #include "chrome/common/content_settings_pattern.h"
20 #include "chrome/common/pref_names.h" 21 #include "chrome/common/pref_names.h"
21 #include "content/browser/user_metrics.h" 22 #include "content/browser/user_metrics.h"
22 #include "content/public/browser/browser_thread.h" 23 #include "content/public/browser/browser_thread.h"
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 ContentSetting cookie_setting = ValueToContentSetting( 115 ContentSetting cookie_setting = ValueToContentSetting(
115 default_settings_[CONTENT_SETTINGS_TYPE_COOKIES].get()); 116 default_settings_[CONTENT_SETTINGS_TYPE_COOKIES].get());
116 if (cookie_setting == CONTENT_SETTING_BLOCK) { 117 if (cookie_setting == CONTENT_SETTING_BLOCK) {
117 UserMetrics::RecordAction( 118 UserMetrics::RecordAction(
118 UserMetricsAction("CookieBlockingEnabledPerDefault")); 119 UserMetricsAction("CookieBlockingEnabledPerDefault"));
119 } else { 120 } else {
120 UserMetrics::RecordAction( 121 UserMetrics::RecordAction(
121 UserMetricsAction("CookieBlockingDisabledPerDefault")); 122 UserMetricsAction("CookieBlockingDisabledPerDefault"));
122 } 123 }
123 124
125 UMA_HISTOGRAM_ENUMERATION(
126 "ContentSettings.DefaultImagesSetting",
127 ValueToContentSetting(
128 default_settings_[CONTENT_SETTINGS_TYPE_IMAGES].get()),
129 CONTENT_SETTING_NUM_SETTINGS-1);
130 UMA_HISTOGRAM_ENUMERATION(
131 "ContentSettings.DefaultJavaScriptSetting",
132 ValueToContentSetting(
133 default_settings_[CONTENT_SETTINGS_TYPE_JAVASCRIPT].get()),
134 CONTENT_SETTING_NUM_SETTINGS-1);
135 UMA_HISTOGRAM_ENUMERATION(
136 "ContentSettings.DefaultPluginsSetting",
137 ValueToContentSetting(
138 default_settings_[CONTENT_SETTINGS_TYPE_PLUGINS].get()),
139 CONTENT_SETTING_NUM_SETTINGS-1);
140 UMA_HISTOGRAM_ENUMERATION(
141 "ContentSettings.DefaultPopupsSetting",
142 ValueToContentSetting(
143 default_settings_[CONTENT_SETTINGS_TYPE_POPUPS].get()),
144 CONTENT_SETTING_NUM_SETTINGS-1);
145 UMA_HISTOGRAM_ENUMERATION(
146 "ContentSettings.DefaultLocationSetting",
147 ValueToContentSetting(
148 default_settings_[CONTENT_SETTINGS_TYPE_GEOLOCATION].get()),
149 CONTENT_SETTING_NUM_SETTINGS-1);
150 UMA_HISTOGRAM_ENUMERATION(
151 "ContentSettings.DefaultNotificationsSetting",
152 ValueToContentSetting(
153 default_settings_[CONTENT_SETTINGS_TYPE_NOTIFICATIONS].get()),
154 CONTENT_SETTING_NUM_SETTINGS-1);
155 UMA_HISTOGRAM_ENUMERATION(
156 "ContentSettings.DefaultHandlersSetting",
157 ValueToContentSetting(
158 default_settings_[CONTENT_SETTINGS_TYPE_INTENTS].get()),
159 CONTENT_SETTING_NUM_SETTINGS-1);
160 UMA_HISTOGRAM_ENUMERATION(
161 "ContentSettings.DefaultMouseCursorSetting",
162 ValueToContentSetting(
163 default_settings_[CONTENT_SETTINGS_TYPE_MOUSELOCK].get()),
164 CONTENT_SETTING_NUM_SETTINGS-1);
165
124 pref_change_registrar_.Init(prefs_); 166 pref_change_registrar_.Init(prefs_);
125 pref_change_registrar_.Add(prefs::kDefaultContentSettings, this); 167 pref_change_registrar_.Add(prefs::kDefaultContentSettings, this);
126 pref_change_registrar_.Add(prefs::kGeolocationDefaultContentSetting, this); 168 pref_change_registrar_.Add(prefs::kGeolocationDefaultContentSetting, this);
127 } 169 }
128 170
129 DefaultProvider::~DefaultProvider() { 171 DefaultProvider::~DefaultProvider() {
130 } 172 }
131 173
132 bool DefaultProvider::SetWebsiteSetting( 174 bool DefaultProvider::SetWebsiteSetting(
133 const ContentSettingsPattern& primary_pattern, 175 const ContentSettingsPattern& primary_pattern,
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
351 SetWebsiteSetting( 393 SetWebsiteSetting(
352 ContentSettingsPattern::Wildcard(), 394 ContentSettingsPattern::Wildcard(),
353 ContentSettingsPattern::Wildcard(), 395 ContentSettingsPattern::Wildcard(),
354 CONTENT_SETTINGS_TYPE_GEOLOCATION, 396 CONTENT_SETTINGS_TYPE_GEOLOCATION,
355 std::string(), 397 std::string(),
356 value->DeepCopy()); 398 value->DeepCopy());
357 } 399 }
358 } 400 }
359 401
360 } // namespace content_settings 402 } // namespace content_settings
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698