| 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 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 { | 151 { |
| 152 13, prefs::kProfileResetPromptMemento, | 152 13, prefs::kProfileResetPromptMemento, |
| 153 PrefHashFilter::ENFORCE_ON_LOAD, | 153 PrefHashFilter::ENFORCE_ON_LOAD, |
| 154 PrefHashFilter::TRACKING_STRATEGY_ATOMIC | 154 PrefHashFilter::TRACKING_STRATEGY_ATOMIC |
| 155 }, | 155 }, |
| 156 { | 156 { |
| 157 14, DefaultSearchManager::kDefaultSearchProviderDataPrefName, | 157 14, DefaultSearchManager::kDefaultSearchProviderDataPrefName, |
| 158 PrefHashFilter::NO_ENFORCEMENT, | 158 PrefHashFilter::NO_ENFORCEMENT, |
| 159 PrefHashFilter::TRACKING_STRATEGY_ATOMIC | 159 PrefHashFilter::TRACKING_STRATEGY_ATOMIC |
| 160 }, | 160 }, |
| 161 { |
| 162 // Protecting kPreferenceResetTime does two things: |
| 163 // 1) It ensures this isn't accidently set by someone stomping the pref |
| 164 // file. |
| 165 // 2) More importantly, it declares kPreferenceResetTime as a protected |
| 166 // pref which is required for it to be visible when queried via the |
| 167 // SegregatedPrefStore. This is because it's written directly in the |
| 168 // protected JsonPrefStore by that store's PrefHashFilter if there was |
| 169 // a reset in FilterOnLoad and SegregatedPrefStore will not look for it |
| 170 // in the protected JsonPrefStore unless it's declared as a protected |
| 171 // preference here. |
| 172 15, prefs::kPreferenceResetTime, |
| 173 PrefHashFilter::ENFORCE_ON_LOAD, |
| 174 PrefHashFilter::TRACKING_STRATEGY_ATOMIC |
| 175 }, |
| 161 }; | 176 }; |
| 162 | 177 |
| 163 // The count of tracked preferences IDs across all platforms. | 178 // The count of tracked preferences IDs across all platforms. |
| 164 const size_t kTrackedPrefsReportingIDsCount = 15; | 179 const size_t kTrackedPrefsReportingIDsCount = 16; |
| 165 COMPILE_ASSERT(kTrackedPrefsReportingIDsCount >= arraysize(kTrackedPrefs), | 180 COMPILE_ASSERT(kTrackedPrefsReportingIDsCount >= arraysize(kTrackedPrefs), |
| 166 need_to_increment_ids_count); | 181 need_to_increment_ids_count); |
| 167 | 182 |
| 168 // Each group enforces a superset of the protection provided by the previous | 183 // Each group enforces a superset of the protection provided by the previous |
| 169 // one. | 184 // one. |
| 170 enum SettingsEnforcementGroup { | 185 enum SettingsEnforcementGroup { |
| 171 GROUP_NO_ENFORCEMENT, | 186 GROUP_NO_ENFORCEMENT, |
| 172 // Only enforce settings on profile loads; still allow seeding of unloaded | 187 // Only enforce settings on profile loads; still allow seeding of unloaded |
| 173 // profiles. | 188 // profiles. |
| 174 GROUP_ENFORCE_ON_LOAD, | 189 GROUP_ENFORCE_ON_LOAD, |
| (...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 516 | 531 |
| 517 void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) { | 532 void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) { |
| 518 ProfilePrefStoreManager::RegisterProfilePrefs(registry); | 533 ProfilePrefStoreManager::RegisterProfilePrefs(registry); |
| 519 } | 534 } |
| 520 | 535 |
| 521 void RegisterPrefs(PrefRegistrySimple* registry) { | 536 void RegisterPrefs(PrefRegistrySimple* registry) { |
| 522 ProfilePrefStoreManager::RegisterPrefs(registry); | 537 ProfilePrefStoreManager::RegisterPrefs(registry); |
| 523 } | 538 } |
| 524 | 539 |
| 525 } // namespace chrome_prefs | 540 } // namespace chrome_prefs |
| OLD | NEW |