| OLD | NEW |
| 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 "chrome/browser/prefs/chrome_pref_service_factory.h" | 5 #include "chrome/browser/prefs/chrome_pref_service_factory.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 { chrome_prefs::internals::kSettingsEnforcementGroupEnforceAlways, | 223 { chrome_prefs::internals::kSettingsEnforcementGroupEnforceAlways, |
| 224 GROUP_ENFORCE_ALWAYS }, | 224 GROUP_ENFORCE_ALWAYS }, |
| 225 { chrome_prefs::internals:: | 225 { chrome_prefs::internals:: |
| 226 kSettingsEnforcementGroupEnforceAlwaysWithExtensions, | 226 kSettingsEnforcementGroupEnforceAlwaysWithExtensions, |
| 227 GROUP_ENFORCE_ALWAYS_WITH_EXTENSIONS }, | 227 GROUP_ENFORCE_ALWAYS_WITH_EXTENSIONS }, |
| 228 { chrome_prefs::internals:: | 228 { chrome_prefs::internals:: |
| 229 kSettingsEnforcementGroupEnforceAlwaysWithExtensionsAndDSE, | 229 kSettingsEnforcementGroupEnforceAlwaysWithExtensionsAndDSE, |
| 230 GROUP_ENFORCE_ALWAYS_WITH_EXTENSIONS_AND_DSE }, | 230 GROUP_ENFORCE_ALWAYS_WITH_EXTENSIONS_AND_DSE }, |
| 231 }; | 231 }; |
| 232 | 232 |
| 233 // Use the strongest enforcement setting in the absence of a field trial | 233 // Use the no enforcement setting in the absence of a field trial |
| 234 // config on Windows. Remember to update the OFFICIAL_BUILD sections of | 234 // config. Remember to update the OFFICIAL_BUILD sections of |
| 235 // pref_hash_browsertest.cc and extension_startup_browsertest.cc when updating | 235 // pref_hash_browsertest.cc and extension_startup_browsertest.cc when updating |
| 236 // the default value below. | 236 // the default value below. |
| 237 // TODO(gab): Enforce this on all platforms. | 237 // TODO(gab): Change this to the strongest enforcement on all platforms. |
| 238 SettingsEnforcementGroup enforcement_group = | 238 SettingsEnforcementGroup enforcement_group = GROUP_NO_ENFORCEMENT; |
| 239 #if defined(OS_WIN) | |
| 240 GROUP_ENFORCE_DEFAULT; | |
| 241 #else | |
| 242 GROUP_NO_ENFORCEMENT; | |
| 243 #endif | |
| 244 bool group_determined_from_trial = false; | 239 bool group_determined_from_trial = false; |
| 245 base::FieldTrial* trial = | 240 base::FieldTrial* trial = |
| 246 base::FieldTrialList::Find( | 241 base::FieldTrialList::Find( |
| 247 chrome_prefs::internals::kSettingsEnforcementTrialName); | 242 chrome_prefs::internals::kSettingsEnforcementTrialName); |
| 248 if (trial) { | 243 if (trial) { |
| 249 const std::string& group_name = trial->group_name(); | 244 const std::string& group_name = trial->group_name(); |
| 250 // ARRAYSIZE_UNSAFE must be used since the array is declared locally; it is | 245 // ARRAYSIZE_UNSAFE must be used since the array is declared locally; it is |
| 251 // only unsafe because it could not trigger a compile error on some | 246 // only unsafe because it could not trigger a compile error on some |
| 252 // non-array pointer types; this is fine since kEnforcementLevelMap is | 247 // non-array pointer types; this is fine since kEnforcementLevelMap is |
| 253 // clearly an array. | 248 // clearly an array. |
| (...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 534 | 529 |
| 535 void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) { | 530 void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) { |
| 536 ProfilePrefStoreManager::RegisterProfilePrefs(registry); | 531 ProfilePrefStoreManager::RegisterProfilePrefs(registry); |
| 537 } | 532 } |
| 538 | 533 |
| 539 void RegisterPrefs(PrefRegistrySimple* registry) { | 534 void RegisterPrefs(PrefRegistrySimple* registry) { |
| 540 ProfilePrefStoreManager::RegisterPrefs(registry); | 535 ProfilePrefStoreManager::RegisterPrefs(registry); |
| 541 } | 536 } |
| 542 | 537 |
| 543 } // namespace chrome_prefs | 538 } // namespace chrome_prefs |
| OLD | NEW |