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

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
« no previous file with comments | « no previous file | chrome/browser/ui/webui/options/content_settings_handler.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 : prefs_(prefs), 105 : prefs_(prefs),
105 is_incognito_(incognito), 106 is_incognito_(incognito),
106 updating_preferences_(false) { 107 updating_preferences_(false) {
107 DCHECK(prefs_); 108 DCHECK(prefs_);
108 MigrateObsoleteNotificationPref(); 109 MigrateObsoleteNotificationPref();
109 MigrateObsoleteGeolocationPref(); 110 MigrateObsoleteGeolocationPref();
110 111
111 // Read global defaults. 112 // Read global defaults.
112 ReadDefaultSettings(true); 113 ReadDefaultSettings(true);
113 114
114 ContentSetting cookie_setting = ValueToContentSetting( 115 UMA_HISTOGRAM_ENUMERATION(
115 default_settings_[CONTENT_SETTINGS_TYPE_COOKIES].get()); 116 "ContentSettings.DefaultCookiesSetting",
116 if (cookie_setting == CONTENT_SETTING_BLOCK) { 117 ValueToContentSetting(
117 UserMetrics::RecordAction( 118 default_settings_[CONTENT_SETTINGS_TYPE_COOKIES].get()),
118 UserMetricsAction("CookieBlockingEnabledPerDefault")); 119 CONTENT_SETTING_NUM_SETTINGS);
119 } else { 120 UMA_HISTOGRAM_ENUMERATION(
120 UserMetrics::RecordAction( 121 "ContentSettings.DefaultImagesSetting",
121 UserMetricsAction("CookieBlockingDisabledPerDefault")); 122 ValueToContentSetting(
122 } 123 default_settings_[CONTENT_SETTINGS_TYPE_IMAGES].get()),
124 CONTENT_SETTING_NUM_SETTINGS);
125 UMA_HISTOGRAM_ENUMERATION(
126 "ContentSettings.DefaultJavaScriptSetting",
127 ValueToContentSetting(
128 default_settings_[CONTENT_SETTINGS_TYPE_JAVASCRIPT].get()),
129 CONTENT_SETTING_NUM_SETTINGS);
130 UMA_HISTOGRAM_ENUMERATION(
131 "ContentSettings.DefaultPluginsSetting",
132 ValueToContentSetting(
133 default_settings_[CONTENT_SETTINGS_TYPE_PLUGINS].get()),
134 CONTENT_SETTING_NUM_SETTINGS);
135 UMA_HISTOGRAM_ENUMERATION(
136 "ContentSettings.DefaultPopupsSetting",
137 ValueToContentSetting(
138 default_settings_[CONTENT_SETTINGS_TYPE_POPUPS].get()),
139 CONTENT_SETTING_NUM_SETTINGS);
140 UMA_HISTOGRAM_ENUMERATION(
141 "ContentSettings.DefaultLocationSetting",
142 ValueToContentSetting(
143 default_settings_[CONTENT_SETTINGS_TYPE_GEOLOCATION].get()),
144 CONTENT_SETTING_NUM_SETTINGS);
145 UMA_HISTOGRAM_ENUMERATION(
146 "ContentSettings.DefaultNotificationsSetting",
147 ValueToContentSetting(
148 default_settings_[CONTENT_SETTINGS_TYPE_NOTIFICATIONS].get()),
149 CONTENT_SETTING_NUM_SETTINGS);
150 UMA_HISTOGRAM_ENUMERATION(
151 "ContentSettings.DefaultHandlersSetting",
152 ValueToContentSetting(
153 default_settings_[CONTENT_SETTINGS_TYPE_INTENTS].get()),
154 CONTENT_SETTING_NUM_SETTINGS);
155 UMA_HISTOGRAM_ENUMERATION(
156 "ContentSettings.DefaultMouseCursorSetting",
157 ValueToContentSetting(
158 default_settings_[CONTENT_SETTINGS_TYPE_MOUSELOCK].get()),
159 CONTENT_SETTING_NUM_SETTINGS);
123 160
124 pref_change_registrar_.Init(prefs_); 161 pref_change_registrar_.Init(prefs_);
125 pref_change_registrar_.Add(prefs::kDefaultContentSettings, this); 162 pref_change_registrar_.Add(prefs::kDefaultContentSettings, this);
126 pref_change_registrar_.Add(prefs::kGeolocationDefaultContentSetting, this); 163 pref_change_registrar_.Add(prefs::kGeolocationDefaultContentSetting, this);
127 } 164 }
128 165
129 DefaultProvider::~DefaultProvider() { 166 DefaultProvider::~DefaultProvider() {
130 } 167 }
131 168
132 bool DefaultProvider::SetWebsiteSetting( 169 bool DefaultProvider::SetWebsiteSetting(
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
351 SetWebsiteSetting( 388 SetWebsiteSetting(
352 ContentSettingsPattern::Wildcard(), 389 ContentSettingsPattern::Wildcard(),
353 ContentSettingsPattern::Wildcard(), 390 ContentSettingsPattern::Wildcard(),
354 CONTENT_SETTINGS_TYPE_GEOLOCATION, 391 CONTENT_SETTINGS_TYPE_GEOLOCATION,
355 std::string(), 392 std::string(),
356 value->DeepCopy()); 393 value->DeepCopy());
357 } 394 }
358 } 395 }
359 396
360 } // namespace content_settings 397 } // namespace content_settings
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/webui/options/content_settings_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698