| 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 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 { | 144 { |
| 145 12, extensions::pref_names::kKnownDisabled, | 145 12, extensions::pref_names::kKnownDisabled, |
| 146 PrefHashFilter::NO_ENFORCEMENT, | 146 PrefHashFilter::NO_ENFORCEMENT, |
| 147 PrefHashFilter::TRACKING_STRATEGY_ATOMIC | 147 PrefHashFilter::TRACKING_STRATEGY_ATOMIC |
| 148 }, | 148 }, |
| 149 { | 149 { |
| 150 13, prefs::kProfileResetPromptMemento, | 150 13, prefs::kProfileResetPromptMemento, |
| 151 PrefHashFilter::ENFORCE_ON_LOAD, | 151 PrefHashFilter::ENFORCE_ON_LOAD, |
| 152 PrefHashFilter::TRACKING_STRATEGY_ATOMIC | 152 PrefHashFilter::TRACKING_STRATEGY_ATOMIC |
| 153 }, | 153 }, |
| 154 { |
| 155 // Protecting kPreferenceResetTime does two things: |
| 156 // 1) It ensures this isn't accidently set by someone stomping the pref |
| 157 // file. |
| 158 // 2) More importantly, it declares kPreferenceResetTime as a protected |
| 159 // pref which is required for it to be visible when queried via the |
| 160 // SegregatedPrefStore. This is because it's written directly in the |
| 161 // protected JsonPrefStore by that store's PrefHashFilter if there was |
| 162 // a reset in FilterOnLoad and SegregatedPrefStore will not look for it |
| 163 // in the protected JsonPrefStore unless it's declared as a protected |
| 164 // preference here. |
| 165 14, prefs::kPreferenceResetTime, |
| 166 PrefHashFilter::ENFORCE_ON_LOAD, |
| 167 PrefHashFilter::TRACKING_STRATEGY_ATOMIC |
| 168 }, |
| 154 }; | 169 }; |
| 155 | 170 |
| 156 // The count of tracked preferences IDs across all platforms. | 171 // The count of tracked preferences IDs across all platforms. |
| 157 const size_t kTrackedPrefsReportingIDsCount = 14; | 172 const size_t kTrackedPrefsReportingIDsCount = 15; |
| 158 COMPILE_ASSERT(kTrackedPrefsReportingIDsCount >= arraysize(kTrackedPrefs), | 173 COMPILE_ASSERT(kTrackedPrefsReportingIDsCount >= arraysize(kTrackedPrefs), |
| 159 need_to_increment_ids_count); | 174 need_to_increment_ids_count); |
| 160 | 175 |
| 161 // Each group enforces a superset of the protection provided by the previous | 176 // Each group enforces a superset of the protection provided by the previous |
| 162 // one. | 177 // one. |
| 163 enum SettingsEnforcementGroup { | 178 enum SettingsEnforcementGroup { |
| 164 GROUP_NO_ENFORCEMENT, | 179 GROUP_NO_ENFORCEMENT, |
| 165 // Only enforce settings on profile loads; still allow seeding of unloaded | 180 // Only enforce settings on profile loads; still allow seeding of unloaded |
| 166 // profiles. | 181 // profiles. |
| 167 GROUP_ENFORCE_ON_LOAD, | 182 GROUP_ENFORCE_ON_LOAD, |
| (...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 496 | 511 |
| 497 void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) { | 512 void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) { |
| 498 ProfilePrefStoreManager::RegisterProfilePrefs(registry); | 513 ProfilePrefStoreManager::RegisterProfilePrefs(registry); |
| 499 } | 514 } |
| 500 | 515 |
| 501 void RegisterPrefs(PrefRegistrySimple* registry) { | 516 void RegisterPrefs(PrefRegistrySimple* registry) { |
| 502 ProfilePrefStoreManager::RegisterPrefs(registry); | 517 ProfilePrefStoreManager::RegisterPrefs(registry); |
| 503 } | 518 } |
| 504 | 519 |
| 505 } // namespace chrome_prefs | 520 } // namespace chrome_prefs |
| OLD | NEW |