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

Side by Side Diff: components/content_settings/core/browser/content_settings_default_provider.cc

Issue 2039803002: Unregister Images, Plugins and Mouselock content settings on android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@only_register_platform_used_contentsettingtypes
Patch Set: address review comments, minor change Created 4 years, 6 months 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "components/content_settings/core/browser/content_settings_default_prov ider.h" 5 #include "components/content_settings/core/browser/content_settings_default_prov ider.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"
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 UMA_HISTOGRAM_ENUMERATION( 119 UMA_HISTOGRAM_ENUMERATION(
120 "ContentSettings.DefaultCookiesSetting", 120 "ContentSettings.DefaultCookiesSetting",
121 IntToContentSetting(prefs_->GetInteger( 121 IntToContentSetting(prefs_->GetInteger(
122 GetPrefName(CONTENT_SETTINGS_TYPE_COOKIES))), 122 GetPrefName(CONTENT_SETTINGS_TYPE_COOKIES))),
123 CONTENT_SETTING_NUM_SETTINGS); 123 CONTENT_SETTING_NUM_SETTINGS);
124 UMA_HISTOGRAM_ENUMERATION( 124 UMA_HISTOGRAM_ENUMERATION(
125 "ContentSettings.DefaultPopupsSetting", 125 "ContentSettings.DefaultPopupsSetting",
126 IntToContentSetting(prefs_->GetInteger( 126 IntToContentSetting(prefs_->GetInteger(
127 GetPrefName(CONTENT_SETTINGS_TYPE_POPUPS))), 127 GetPrefName(CONTENT_SETTINGS_TYPE_POPUPS))),
128 CONTENT_SETTING_NUM_SETTINGS); 128 CONTENT_SETTING_NUM_SETTINGS);
129 #if !defined(OS_IOS) 129 #if !defined(OS_IOS) && !defined(OS_ANDROID)
130 UMA_HISTOGRAM_ENUMERATION( 130 UMA_HISTOGRAM_ENUMERATION(
131 "ContentSettings.DefaultImagesSetting", 131 "ContentSettings.DefaultImagesSetting",
132 IntToContentSetting(prefs_->GetInteger( 132 IntToContentSetting(prefs_->GetInteger(
133 GetPrefName(CONTENT_SETTINGS_TYPE_IMAGES))), 133 GetPrefName(CONTENT_SETTINGS_TYPE_IMAGES))),
134 CONTENT_SETTING_NUM_SETTINGS); 134 CONTENT_SETTING_NUM_SETTINGS);
135 UMA_HISTOGRAM_ENUMERATION( 135 UMA_HISTOGRAM_ENUMERATION(
136 "ContentSettings.DefaultJavaScriptSetting",
137 IntToContentSetting(prefs_->GetInteger(
138 GetPrefName(CONTENT_SETTINGS_TYPE_JAVASCRIPT))),
139 CONTENT_SETTING_NUM_SETTINGS);
140 UMA_HISTOGRAM_ENUMERATION(
141 "ContentSettings.DefaultPluginsSetting", 136 "ContentSettings.DefaultPluginsSetting",
142 IntToContentSetting(prefs_->GetInteger( 137 IntToContentSetting(prefs_->GetInteger(
143 GetPrefName(CONTENT_SETTINGS_TYPE_PLUGINS))), 138 GetPrefName(CONTENT_SETTINGS_TYPE_PLUGINS))),
144 CONTENT_SETTING_NUM_SETTINGS); 139 CONTENT_SETTING_NUM_SETTINGS);
145 UMA_HISTOGRAM_ENUMERATION( 140 UMA_HISTOGRAM_ENUMERATION(
141 "ContentSettings.DefaultMouseCursorSetting",
142 IntToContentSetting(prefs_->GetInteger(
143 GetPrefName(CONTENT_SETTINGS_TYPE_MOUSELOCK))),
144 CONTENT_SETTING_NUM_SETTINGS);
145 #endif
146
147 #if !defined(OS_IOS)
148 UMA_HISTOGRAM_ENUMERATION(
149 "ContentSettings.DefaultJavaScriptSetting",
150 IntToContentSetting(prefs_->GetInteger(
151 GetPrefName(CONTENT_SETTINGS_TYPE_JAVASCRIPT))),
152 CONTENT_SETTING_NUM_SETTINGS);
153
154 UMA_HISTOGRAM_ENUMERATION(
146 "ContentSettings.DefaultLocationSetting", 155 "ContentSettings.DefaultLocationSetting",
147 IntToContentSetting(prefs_->GetInteger( 156 IntToContentSetting(prefs_->GetInteger(
148 GetPrefName(CONTENT_SETTINGS_TYPE_GEOLOCATION))), 157 GetPrefName(CONTENT_SETTINGS_TYPE_GEOLOCATION))),
149 CONTENT_SETTING_NUM_SETTINGS); 158 CONTENT_SETTING_NUM_SETTINGS);
150 UMA_HISTOGRAM_ENUMERATION( 159 UMA_HISTOGRAM_ENUMERATION(
151 "ContentSettings.DefaultNotificationsSetting", 160 "ContentSettings.DefaultNotificationsSetting",
152 IntToContentSetting(prefs_->GetInteger( 161 IntToContentSetting(prefs_->GetInteger(
153 GetPrefName(CONTENT_SETTINGS_TYPE_NOTIFICATIONS))), 162 GetPrefName(CONTENT_SETTINGS_TYPE_NOTIFICATIONS))),
154 CONTENT_SETTING_NUM_SETTINGS); 163 CONTENT_SETTING_NUM_SETTINGS);
155 UMA_HISTOGRAM_ENUMERATION( 164
156 "ContentSettings.DefaultMouseCursorSetting",
157 IntToContentSetting(prefs_->GetInteger(
158 GetPrefName(CONTENT_SETTINGS_TYPE_MOUSELOCK))),
159 CONTENT_SETTING_NUM_SETTINGS);
160 UMA_HISTOGRAM_ENUMERATION( 165 UMA_HISTOGRAM_ENUMERATION(
161 "ContentSettings.DefaultMediaStreamMicSetting", 166 "ContentSettings.DefaultMediaStreamMicSetting",
162 IntToContentSetting(prefs_->GetInteger( 167 IntToContentSetting(prefs_->GetInteger(
163 GetPrefName(CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC))), 168 GetPrefName(CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC))),
164 CONTENT_SETTING_NUM_SETTINGS); 169 CONTENT_SETTING_NUM_SETTINGS);
165 UMA_HISTOGRAM_ENUMERATION( 170 UMA_HISTOGRAM_ENUMERATION(
166 "ContentSettings.DefaultMediaStreamCameraSetting", 171 "ContentSettings.DefaultMediaStreamCameraSetting",
167 IntToContentSetting(prefs_->GetInteger( 172 IntToContentSetting(prefs_->GetInteger(
168 GetPrefName(CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA))), 173 GetPrefName(CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA))),
169 CONTENT_SETTING_NUM_SETTINGS); 174 CONTENT_SETTING_NUM_SETTINGS);
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
361 int int_value = prefs_->GetInteger(GetPrefName(content_type)); 366 int int_value = prefs_->GetInteger(GetPrefName(content_type));
362 return ContentSettingToValue(IntToContentSetting(int_value)); 367 return ContentSettingToValue(IntToContentSetting(int_value));
363 } 368 }
364 369
365 void DefaultProvider::DiscardObsoletePreferences() { 370 void DefaultProvider::DiscardObsoletePreferences() {
366 prefs_->ClearPref(kObsoleteMetroSwitchToDesktopSetting); 371 prefs_->ClearPref(kObsoleteMetroSwitchToDesktopSetting);
367 prefs_->ClearPref(kObsoleteMediaStreamSetting); 372 prefs_->ClearPref(kObsoleteMediaStreamSetting);
368 } 373 }
369 374
370 } // namespace content_settings 375 } // namespace content_settings
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698