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 }, | |
176 }; | 161 }; |
177 | 162 |
178 // The count of tracked preferences IDs across all platforms. | 163 // The count of tracked preferences IDs across all platforms. |
179 const size_t kTrackedPrefsReportingIDsCount = 16; | 164 const size_t kTrackedPrefsReportingIDsCount = 15; |
180 COMPILE_ASSERT(kTrackedPrefsReportingIDsCount >= arraysize(kTrackedPrefs), | 165 COMPILE_ASSERT(kTrackedPrefsReportingIDsCount >= arraysize(kTrackedPrefs), |
181 need_to_increment_ids_count); | 166 need_to_increment_ids_count); |
182 | 167 |
183 // Each group enforces a superset of the protection provided by the previous | 168 // Each group enforces a superset of the protection provided by the previous |
184 // one. | 169 // one. |
185 enum SettingsEnforcementGroup { | 170 enum SettingsEnforcementGroup { |
186 GROUP_NO_ENFORCEMENT, | 171 GROUP_NO_ENFORCEMENT, |
187 // Only enforce settings on profile loads; still allow seeding of unloaded | 172 // Only enforce settings on profile loads; still allow seeding of unloaded |
188 // profiles. | 173 // profiles. |
189 GROUP_ENFORCE_ON_LOAD, | 174 GROUP_ENFORCE_ON_LOAD, |
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
531 | 516 |
532 void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) { | 517 void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) { |
533 ProfilePrefStoreManager::RegisterProfilePrefs(registry); | 518 ProfilePrefStoreManager::RegisterProfilePrefs(registry); |
534 } | 519 } |
535 | 520 |
536 void RegisterPrefs(PrefRegistrySimple* registry) { | 521 void RegisterPrefs(PrefRegistrySimple* registry) { |
537 ProfilePrefStoreManager::RegisterPrefs(registry); | 522 ProfilePrefStoreManager::RegisterPrefs(registry); |
538 } | 523 } |
539 | 524 |
540 } // namespace chrome_prefs | 525 } // namespace chrome_prefs |
OLD | NEW |