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 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 { chrome_prefs::internals:: | 239 { chrome_prefs::internals:: |
240 kSettingsEnforcementGroupEnforceAlwaysWithDSE, | 240 kSettingsEnforcementGroupEnforceAlwaysWithDSE, |
241 GROUP_ENFORCE_ALWAYS_WITH_DSE }, | 241 GROUP_ENFORCE_ALWAYS_WITH_DSE }, |
242 { chrome_prefs::internals:: | 242 { chrome_prefs::internals:: |
243 kSettingsEnforcementGroupEnforceAlwaysWithExtensionsAndDSE, | 243 kSettingsEnforcementGroupEnforceAlwaysWithExtensionsAndDSE, |
244 GROUP_ENFORCE_ALWAYS_WITH_EXTENSIONS_AND_DSE }, | 244 GROUP_ENFORCE_ALWAYS_WITH_EXTENSIONS_AND_DSE }, |
245 }; | 245 }; |
246 | 246 |
247 // Use the strongest enforcement setting in the absence of a field trial | 247 // Use the strongest enforcement setting in the absence of a field trial |
248 // config on Windows. Remember to update the OFFICIAL_BUILD section of | 248 // config on Windows. Remember to update the OFFICIAL_BUILD section of |
249 // extension_startup_browsertest.cc when updating the default value below. | 249 // extension_startup_browsertest.cc and pref_hash_browsertest.cc when updating |
| 250 // the default value below. |
250 // TODO(gab): Enforce this on all platforms. | 251 // TODO(gab): Enforce this on all platforms. |
251 SettingsEnforcementGroup enforcement_group = | 252 SettingsEnforcementGroup enforcement_group = |
252 #if defined(OS_WIN) | 253 #if defined(OS_WIN) |
253 GROUP_ENFORCE_DEFAULT; | 254 GROUP_ENFORCE_DEFAULT; |
254 #else | 255 #else |
255 GROUP_NO_ENFORCEMENT; | 256 GROUP_NO_ENFORCEMENT; |
256 #endif | 257 #endif |
257 bool group_determined_from_trial = false; | 258 bool group_determined_from_trial = false; |
258 base::FieldTrial* trial = | 259 base::FieldTrial* trial = |
259 base::FieldTrialList::Find( | 260 base::FieldTrialList::Find( |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
405 factory->set_read_error_callback(base::Bind(&HandleReadError)); | 406 factory->set_read_error_callback(base::Bind(&HandleReadError)); |
406 factory->set_user_prefs(user_pref_store); | 407 factory->set_user_prefs(user_pref_store); |
407 } | 408 } |
408 | 409 |
409 } // namespace | 410 } // namespace |
410 | 411 |
411 namespace chrome_prefs { | 412 namespace chrome_prefs { |
412 | 413 |
413 namespace internals { | 414 namespace internals { |
414 | 415 |
| 416 // Group modifications should be reflected in first_run_browsertest.cc and |
| 417 // pref_hash_browsertest.cc. |
415 const char kSettingsEnforcementTrialName[] = "SettingsEnforcement"; | 418 const char kSettingsEnforcementTrialName[] = "SettingsEnforcement"; |
416 const char kSettingsEnforcementGroupNoEnforcement[] = "no_enforcement"; | 419 const char kSettingsEnforcementGroupNoEnforcement[] = "no_enforcement"; |
417 const char kSettingsEnforcementGroupEnforceAlways[] = "enforce_always"; | 420 const char kSettingsEnforcementGroupEnforceAlways[] = "enforce_always"; |
418 const char kSettingsEnforcementGroupEnforceAlwaysWithDSE[] = | 421 const char kSettingsEnforcementGroupEnforceAlwaysWithDSE[] = |
419 "enforce_always_with_dse"; | 422 "enforce_always_with_dse"; |
420 const char kSettingsEnforcementGroupEnforceAlwaysWithExtensionsAndDSE[] = | 423 const char kSettingsEnforcementGroupEnforceAlwaysWithExtensionsAndDSE[] = |
421 "enforce_always_with_extensions_and_dse"; | 424 "enforce_always_with_extensions_and_dse"; |
422 | 425 |
423 } // namespace internals | 426 } // namespace internals |
424 | 427 |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
516 | 519 |
517 void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) { | 520 void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) { |
518 ProfilePrefStoreManager::RegisterProfilePrefs(registry); | 521 ProfilePrefStoreManager::RegisterProfilePrefs(registry); |
519 } | 522 } |
520 | 523 |
521 void RegisterPrefs(PrefRegistrySimple* registry) { | 524 void RegisterPrefs(PrefRegistrySimple* registry) { |
522 ProfilePrefStoreManager::RegisterPrefs(registry); | 525 ProfilePrefStoreManager::RegisterPrefs(registry); |
523 } | 526 } |
524 | 527 |
525 } // namespace chrome_prefs | 528 } // namespace chrome_prefs |
OLD | NEW |