| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 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/extensions/api/settings_private/prefs_util.h" | 5 #include "chrome/browser/extensions/api/settings_private/prefs_util.h" |
| 6 | 6 |
| 7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
| 8 #include "chrome/browser/browser_process.h" | 8 #include "chrome/browser/browser_process.h" |
| 9 #include "chrome/browser/extensions/chrome_extension_function.h" | 9 #include "chrome/browser/extensions/chrome_extension_function.h" |
| 10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 (*s_whitelist)[browsing_data::prefs::kDeleteFormData] = | 174 (*s_whitelist)[browsing_data::prefs::kDeleteFormData] = |
| 175 settings_private::PrefType::PREF_TYPE_BOOLEAN; | 175 settings_private::PrefType::PREF_TYPE_BOOLEAN; |
| 176 (*s_whitelist)[browsing_data::prefs::kDeleteHostedAppsData] = | 176 (*s_whitelist)[browsing_data::prefs::kDeleteHostedAppsData] = |
| 177 settings_private::PrefType::PREF_TYPE_BOOLEAN; | 177 settings_private::PrefType::PREF_TYPE_BOOLEAN; |
| 178 (*s_whitelist)[browsing_data::prefs::kDeleteMediaLicenses] = | 178 (*s_whitelist)[browsing_data::prefs::kDeleteMediaLicenses] = |
| 179 settings_private::PrefType::PREF_TYPE_BOOLEAN; | 179 settings_private::PrefType::PREF_TYPE_BOOLEAN; |
| 180 (*s_whitelist)[browsing_data::prefs::kDeleteTimePeriod] = | 180 (*s_whitelist)[browsing_data::prefs::kDeleteTimePeriod] = |
| 181 settings_private::PrefType::PREF_TYPE_NUMBER; | 181 settings_private::PrefType::PREF_TYPE_NUMBER; |
| 182 | 182 |
| 183 #if defined(OS_CHROMEOS) | 183 #if defined(OS_CHROMEOS) |
| 184 // Accounts / Users / People. |
| 184 (*s_whitelist)[chromeos::kAccountsPrefAllowGuest] = | 185 (*s_whitelist)[chromeos::kAccountsPrefAllowGuest] = |
| 185 settings_private::PrefType::PREF_TYPE_BOOLEAN; | 186 settings_private::PrefType::PREF_TYPE_BOOLEAN; |
| 186 (*s_whitelist)[chromeos::kAccountsPrefSupervisedUsersEnabled] = | 187 (*s_whitelist)[chromeos::kAccountsPrefSupervisedUsersEnabled] = |
| 187 settings_private::PrefType::PREF_TYPE_BOOLEAN; | 188 settings_private::PrefType::PREF_TYPE_BOOLEAN; |
| 188 (*s_whitelist)[chromeos::kAccountsPrefShowUserNamesOnSignIn] = | 189 (*s_whitelist)[chromeos::kAccountsPrefShowUserNamesOnSignIn] = |
| 189 settings_private::PrefType::PREF_TYPE_BOOLEAN; | 190 settings_private::PrefType::PREF_TYPE_BOOLEAN; |
| 190 (*s_whitelist)[chromeos::kAccountsPrefAllowNewUser] = | 191 (*s_whitelist)[chromeos::kAccountsPrefAllowNewUser] = |
| 191 settings_private::PrefType::PREF_TYPE_BOOLEAN; | 192 settings_private::PrefType::PREF_TYPE_BOOLEAN; |
| 192 (*s_whitelist)[chromeos::kAccountsPrefUsers] = | 193 (*s_whitelist)[chromeos::kAccountsPrefUsers] = |
| 193 settings_private::PrefType::PREF_TYPE_LIST; | 194 settings_private::PrefType::PREF_TYPE_LIST; |
| 195 (*s_whitelist)[::prefs::kEnableAutoScreenLock] = |
| 196 settings_private::PrefType::PREF_TYPE_BOOLEAN; |
| 197 |
| 198 // Accessibility. |
| 194 (*s_whitelist)[::prefs::kAccessibilitySpokenFeedbackEnabled] = | 199 (*s_whitelist)[::prefs::kAccessibilitySpokenFeedbackEnabled] = |
| 195 settings_private::PrefType::PREF_TYPE_BOOLEAN; | 200 settings_private::PrefType::PREF_TYPE_BOOLEAN; |
| 196 (*s_whitelist)[::prefs::kAccessibilityAutoclickEnabled] = | 201 (*s_whitelist)[::prefs::kAccessibilityAutoclickEnabled] = |
| 197 settings_private::PrefType::PREF_TYPE_BOOLEAN; | 202 settings_private::PrefType::PREF_TYPE_BOOLEAN; |
| 198 (*s_whitelist)[::prefs::kAccessibilityAutoclickDelayMs] = | 203 (*s_whitelist)[::prefs::kAccessibilityAutoclickDelayMs] = |
| 199 settings_private::PrefType::PREF_TYPE_BOOLEAN; | 204 settings_private::PrefType::PREF_TYPE_BOOLEAN; |
| 200 (*s_whitelist)[::prefs::kAccessibilityCaretHighlightEnabled] = | 205 (*s_whitelist)[::prefs::kAccessibilityCaretHighlightEnabled] = |
| 201 settings_private::PrefType::PREF_TYPE_BOOLEAN; | 206 settings_private::PrefType::PREF_TYPE_BOOLEAN; |
| 202 (*s_whitelist)[::prefs::kAccessibilityCursorHighlightEnabled] = | 207 (*s_whitelist)[::prefs::kAccessibilityCursorHighlightEnabled] = |
| 203 settings_private::PrefType::PREF_TYPE_BOOLEAN; | 208 settings_private::PrefType::PREF_TYPE_BOOLEAN; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 214 (*s_whitelist)[::prefs::kAccessibilitySelectToSpeakEnabled] = | 219 (*s_whitelist)[::prefs::kAccessibilitySelectToSpeakEnabled] = |
| 215 settings_private::PrefType::PREF_TYPE_BOOLEAN; | 220 settings_private::PrefType::PREF_TYPE_BOOLEAN; |
| 216 (*s_whitelist)[::prefs::kAccessibilityStickyKeysEnabled] = | 221 (*s_whitelist)[::prefs::kAccessibilityStickyKeysEnabled] = |
| 217 settings_private::PrefType::PREF_TYPE_BOOLEAN; | 222 settings_private::PrefType::PREF_TYPE_BOOLEAN; |
| 218 (*s_whitelist)[::prefs::kAccessibilitySwitchAccessEnabled] = | 223 (*s_whitelist)[::prefs::kAccessibilitySwitchAccessEnabled] = |
| 219 settings_private::PrefType::PREF_TYPE_BOOLEAN; | 224 settings_private::PrefType::PREF_TYPE_BOOLEAN; |
| 220 (*s_whitelist)[::prefs::kAccessibilityVirtualKeyboardEnabled] = | 225 (*s_whitelist)[::prefs::kAccessibilityVirtualKeyboardEnabled] = |
| 221 settings_private::PrefType::PREF_TYPE_BOOLEAN; | 226 settings_private::PrefType::PREF_TYPE_BOOLEAN; |
| 222 (*s_whitelist)[::prefs::kAccessibilityMonoAudioEnabled] = | 227 (*s_whitelist)[::prefs::kAccessibilityMonoAudioEnabled] = |
| 223 settings_private::PrefType::PREF_TYPE_BOOLEAN; | 228 settings_private::PrefType::PREF_TYPE_BOOLEAN; |
| 229 |
| 230 // Misc. |
| 224 (*s_whitelist)[::prefs::kUse24HourClock] = | 231 (*s_whitelist)[::prefs::kUse24HourClock] = |
| 225 settings_private::PrefType::PREF_TYPE_BOOLEAN; | 232 settings_private::PrefType::PREF_TYPE_BOOLEAN; |
| 226 (*s_whitelist)[::prefs::kLanguagePreferredLanguages] = | 233 (*s_whitelist)[::prefs::kLanguagePreferredLanguages] = |
| 227 settings_private::PrefType::PREF_TYPE_STRING; | 234 settings_private::PrefType::PREF_TYPE_STRING; |
| 228 (*s_whitelist)[::prefs::kTapDraggingEnabled] = | 235 (*s_whitelist)[::prefs::kTapDraggingEnabled] = |
| 229 settings_private::PrefType::PREF_TYPE_BOOLEAN; | 236 settings_private::PrefType::PREF_TYPE_BOOLEAN; |
| 230 (*s_whitelist)[chromeos::kStatsReportingPref] = | 237 (*s_whitelist)[chromeos::kStatsReportingPref] = |
| 231 settings_private::PrefType::PREF_TYPE_BOOLEAN; | 238 settings_private::PrefType::PREF_TYPE_BOOLEAN; |
| 239 (*s_whitelist)[chromeos::kAttestationForContentProtectionEnabled] = |
| 240 settings_private::PrefType::PREF_TYPE_BOOLEAN; |
| 241 |
| 242 // Bluetooth & Internet settings. |
| 232 (*s_whitelist)[chromeos::kAllowBluetooth] = | 243 (*s_whitelist)[chromeos::kAllowBluetooth] = |
| 233 settings_private::PrefType::PREF_TYPE_BOOLEAN; | 244 settings_private::PrefType::PREF_TYPE_BOOLEAN; |
| 234 (*s_whitelist)[chromeos::kAttestationForContentProtectionEnabled] = | 245 (*s_whitelist)[proxy_config::prefs::kUseSharedProxies] = |
| 235 settings_private::PrefType::PREF_TYPE_BOOLEAN; | 246 settings_private::PrefType::PREF_TYPE_BOOLEAN; |
| 236 (*s_whitelist)[::prefs::kWakeOnWifiDarkConnect] = | 247 (*s_whitelist)[::prefs::kWakeOnWifiDarkConnect] = |
| 237 settings_private::PrefType::PREF_TYPE_BOOLEAN; | 248 settings_private::PrefType::PREF_TYPE_BOOLEAN; |
| 238 (*s_whitelist)[::prefs::kEnableAutoScreenLock] = | |
| 239 settings_private::PrefType::PREF_TYPE_BOOLEAN; | |
| 240 | 249 |
| 241 // Timezone settings. | 250 // Timezone settings. |
| 242 (*s_whitelist)[chromeos::kSystemTimezone] = | 251 (*s_whitelist)[chromeos::kSystemTimezone] = |
| 243 settings_private::PrefType::PREF_TYPE_BOOLEAN; | 252 settings_private::PrefType::PREF_TYPE_BOOLEAN; |
| 244 (*s_whitelist)[::prefs::kResolveTimezoneByGeolocation] = | 253 (*s_whitelist)[::prefs::kResolveTimezoneByGeolocation] = |
| 245 settings_private::PrefType::PREF_TYPE_BOOLEAN; | 254 settings_private::PrefType::PREF_TYPE_BOOLEAN; |
| 246 | 255 |
| 247 // Ash settings. | 256 // Ash settings. |
| 248 (*s_whitelist)[::prefs::kEnableStylusTools] = | 257 (*s_whitelist)[::prefs::kEnableStylusTools] = |
| 249 settings_private::PrefType::PREF_TYPE_BOOLEAN; | 258 settings_private::PrefType::PREF_TYPE_BOOLEAN; |
| (...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 659 | 668 |
| 660 bool PrefsUtil::IsCrosSetting(const std::string& pref_name) { | 669 bool PrefsUtil::IsCrosSetting(const std::string& pref_name) { |
| 661 #if defined(OS_CHROMEOS) | 670 #if defined(OS_CHROMEOS) |
| 662 return CrosSettings::Get()->IsCrosSettings(pref_name); | 671 return CrosSettings::Get()->IsCrosSettings(pref_name); |
| 663 #else | 672 #else |
| 664 return false; | 673 return false; |
| 665 #endif | 674 #endif |
| 666 } | 675 } |
| 667 | 676 |
| 668 } // namespace extensions | 677 } // namespace extensions |
| OLD | NEW |