| 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_command_line_pref_store.h> | 5 #include <chrome/browser/prefs/chrome_command_line_pref_store.h> |
| 6 #include "chrome/browser/prefs/chrome_pref_service_factory.h" | 6 #include "chrome/browser/prefs/chrome_pref_service_factory.h" |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 #include "components/search_engines/search_engines_pref_names.h" | 51 #include "components/search_engines/search_engines_pref_names.h" |
| 52 #include "components/signin/core/common/signin_pref_names.h" | 52 #include "components/signin/core/common/signin_pref_names.h" |
| 53 #include "components/sync/base/model_type.h" | 53 #include "components/sync/base/model_type.h" |
| 54 #include "components/sync/base/pref_names.h" | 54 #include "components/sync/base/pref_names.h" |
| 55 #include "components/sync_preferences/pref_model_associator.h" | 55 #include "components/sync_preferences/pref_model_associator.h" |
| 56 #include "components/sync_preferences/pref_service_syncable.h" | 56 #include "components/sync_preferences/pref_service_syncable.h" |
| 57 #include "components/sync_preferences/pref_service_syncable_factory.h" | 57 #include "components/sync_preferences/pref_service_syncable_factory.h" |
| 58 #include "components/user_prefs/tracked/pref_names.h" | 58 #include "components/user_prefs/tracked/pref_names.h" |
| 59 #include "content/public/browser/browser_context.h" | 59 #include "content/public/browser/browser_context.h" |
| 60 #include "content/public/browser/browser_thread.h" | 60 #include "content/public/browser/browser_thread.h" |
| 61 #include "extensions/features/features.h" |
| 61 #include "sql/error_delegate_util.h" | 62 #include "sql/error_delegate_util.h" |
| 62 #include "ui/base/resource/resource_bundle.h" | 63 #include "ui/base/resource/resource_bundle.h" |
| 63 | 64 |
| 64 #if defined(ENABLE_EXTENSIONS) | 65 #if BUILDFLAG(ENABLE_EXTENSIONS) |
| 65 #include "extensions/browser/pref_names.h" | 66 #include "extensions/browser/pref_names.h" |
| 66 #endif | 67 #endif |
| 67 | 68 |
| 68 #if BUILDFLAG(ENABLE_SUPERVISED_USERS) | 69 #if BUILDFLAG(ENABLE_SUPERVISED_USERS) |
| 69 #include "chrome/browser/supervised_user/supervised_user_pref_store.h" | 70 #include "chrome/browser/supervised_user/supervised_user_pref_store.h" |
| 70 #endif | 71 #endif |
| 71 | 72 |
| 72 #if defined(OS_WIN) | 73 #if defined(OS_WIN) |
| 73 #include "base/win/win_util.h" | 74 #include "base/win/win_util.h" |
| 74 #if defined(ENABLE_RLZ) | 75 #if defined(ENABLE_RLZ) |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 PrefHashFilter::ENFORCE_ON_LOAD, | 119 PrefHashFilter::ENFORCE_ON_LOAD, |
| 119 PrefHashFilter::TRACKING_STRATEGY_ATOMIC, | 120 PrefHashFilter::TRACKING_STRATEGY_ATOMIC, |
| 120 PrefHashFilter::VALUE_IMPERSONAL | 121 PrefHashFilter::VALUE_IMPERSONAL |
| 121 }, | 122 }, |
| 122 { | 123 { |
| 123 4, prefs::kURLsToRestoreOnStartup, | 124 4, prefs::kURLsToRestoreOnStartup, |
| 124 PrefHashFilter::ENFORCE_ON_LOAD, | 125 PrefHashFilter::ENFORCE_ON_LOAD, |
| 125 PrefHashFilter::TRACKING_STRATEGY_ATOMIC, | 126 PrefHashFilter::TRACKING_STRATEGY_ATOMIC, |
| 126 PrefHashFilter::VALUE_IMPERSONAL | 127 PrefHashFilter::VALUE_IMPERSONAL |
| 127 }, | 128 }, |
| 128 #if defined(ENABLE_EXTENSIONS) | 129 #if BUILDFLAG(ENABLE_EXTENSIONS) |
| 129 { | 130 { |
| 130 5, extensions::pref_names::kExtensions, | 131 5, extensions::pref_names::kExtensions, |
| 131 PrefHashFilter::NO_ENFORCEMENT, | 132 PrefHashFilter::NO_ENFORCEMENT, |
| 132 PrefHashFilter::TRACKING_STRATEGY_SPLIT, | 133 PrefHashFilter::TRACKING_STRATEGY_SPLIT, |
| 133 PrefHashFilter::VALUE_IMPERSONAL | 134 PrefHashFilter::VALUE_IMPERSONAL |
| 134 }, | 135 }, |
| 135 #endif | 136 #endif |
| 136 { | 137 { |
| 137 6, prefs::kGoogleServicesLastUsername, | 138 6, prefs::kGoogleServicesLastUsername, |
| 138 PrefHashFilter::ENFORCE_ON_LOAD, | 139 PrefHashFilter::ENFORCE_ON_LOAD, |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 334 // Remove enforcement for all tracked preferences. | 335 // Remove enforcement for all tracked preferences. |
| 335 data.enforcement_level = PrefHashFilter::NO_ENFORCEMENT; | 336 data.enforcement_level = PrefHashFilter::NO_ENFORCEMENT; |
| 336 } | 337 } |
| 337 | 338 |
| 338 if (enforcement_group >= GROUP_ENFORCE_ALWAYS_WITH_DSE && | 339 if (enforcement_group >= GROUP_ENFORCE_ALWAYS_WITH_DSE && |
| 339 data.name == DefaultSearchManager::kDefaultSearchProviderDataPrefName) { | 340 data.name == DefaultSearchManager::kDefaultSearchProviderDataPrefName) { |
| 340 // Specifically enable default search settings enforcement. | 341 // Specifically enable default search settings enforcement. |
| 341 data.enforcement_level = PrefHashFilter::ENFORCE_ON_LOAD; | 342 data.enforcement_level = PrefHashFilter::ENFORCE_ON_LOAD; |
| 342 } | 343 } |
| 343 | 344 |
| 344 #if defined(ENABLE_EXTENSIONS) | 345 #if BUILDFLAG(ENABLE_EXTENSIONS) |
| 345 if (enforcement_group >= GROUP_ENFORCE_ALWAYS_WITH_EXTENSIONS_AND_DSE && | 346 if (enforcement_group >= GROUP_ENFORCE_ALWAYS_WITH_EXTENSIONS_AND_DSE && |
| 346 data.name == extensions::pref_names::kExtensions) { | 347 data.name == extensions::pref_names::kExtensions) { |
| 347 // Specifically enable extension settings enforcement. | 348 // Specifically enable extension settings enforcement. |
| 348 data.enforcement_level = PrefHashFilter::ENFORCE_ON_LOAD; | 349 data.enforcement_level = PrefHashFilter::ENFORCE_ON_LOAD; |
| 349 } | 350 } |
| 350 #endif | 351 #endif |
| 351 | 352 |
| 352 result.push_back(data); | 353 result.push_back(data); |
| 353 } | 354 } |
| 354 return result; | 355 return result; |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 540 | 541 |
| 541 void ClearResetTime(Profile* profile) { | 542 void ClearResetTime(Profile* profile) { |
| 542 ProfilePrefStoreManager::ClearResetTime(profile->GetPrefs()); | 543 ProfilePrefStoreManager::ClearResetTime(profile->GetPrefs()); |
| 543 } | 544 } |
| 544 | 545 |
| 545 void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) { | 546 void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) { |
| 546 ProfilePrefStoreManager::RegisterProfilePrefs(registry); | 547 ProfilePrefStoreManager::RegisterProfilePrefs(registry); |
| 547 } | 548 } |
| 548 | 549 |
| 549 } // namespace chrome_prefs | 550 } // namespace chrome_prefs |
| OLD | NEW |