| 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 431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 442 new JsonPrefStore( | 442 new JsonPrefStore( |
| 443 pref_filename, pref_io_task_runner, scoped_ptr<PrefFilter>()), | 443 pref_filename, pref_io_task_runner, scoped_ptr<PrefFilter>()), |
| 444 NULL, // extension_prefs | 444 NULL, // extension_prefs |
| 445 async); | 445 async); |
| 446 return factory.Create(pref_registry.get()); | 446 return factory.Create(pref_registry.get()); |
| 447 } | 447 } |
| 448 | 448 |
| 449 scoped_ptr<PrefServiceSyncable> CreateProfilePrefs( | 449 scoped_ptr<PrefServiceSyncable> CreateProfilePrefs( |
| 450 const base::FilePath& profile_path, | 450 const base::FilePath& profile_path, |
| 451 base::SequencedTaskRunner* pref_io_task_runner, | 451 base::SequencedTaskRunner* pref_io_task_runner, |
| 452 TrackedPreferenceValidationDelegate* validation_delegate, |
| 452 policy::PolicyService* policy_service, | 453 policy::PolicyService* policy_service, |
| 453 ManagedUserSettingsService* managed_user_settings, | 454 ManagedUserSettingsService* managed_user_settings, |
| 454 const scoped_refptr<PrefStore>& extension_prefs, | 455 const scoped_refptr<PrefStore>& extension_prefs, |
| 455 const scoped_refptr<user_prefs::PrefRegistrySyncable>& pref_registry, | 456 const scoped_refptr<user_prefs::PrefRegistrySyncable>& pref_registry, |
| 456 bool async) { | 457 bool async) { |
| 457 TRACE_EVENT0("browser", "chrome_prefs::CreateProfilePrefs"); | 458 TRACE_EVENT0("browser", "chrome_prefs::CreateProfilePrefs"); |
| 458 PrefServiceSyncableFactory factory; | 459 PrefServiceSyncableFactory factory; |
| 459 PrepareFactory(&factory, | 460 PrepareFactory( |
| 460 policy_service, | 461 &factory, |
| 461 managed_user_settings, | 462 policy_service, |
| 462 scoped_refptr<PersistentPrefStore>( | 463 managed_user_settings, |
| 463 CreateProfilePrefStoreManager(profile_path) | 464 scoped_refptr<PersistentPrefStore>( |
| 464 ->CreateProfilePrefStore(pref_io_task_runner)), | 465 CreateProfilePrefStoreManager(profile_path)->CreateProfilePrefStore( |
| 465 extension_prefs, | 466 pref_io_task_runner, validation_delegate)), |
| 466 async); | 467 extension_prefs, |
| 468 async); |
| 467 scoped_ptr<PrefServiceSyncable> pref_service = | 469 scoped_ptr<PrefServiceSyncable> pref_service = |
| 468 factory.CreateSyncable(pref_registry.get()); | 470 factory.CreateSyncable(pref_registry.get()); |
| 469 | 471 |
| 470 ConfigureDefaultSearchPrefMigrationToDictionaryValue(pref_service.get()); | 472 ConfigureDefaultSearchPrefMigrationToDictionaryValue(pref_service.get()); |
| 471 | 473 |
| 472 return pref_service.Pass(); | 474 return pref_service.Pass(); |
| 473 } | 475 } |
| 474 | 476 |
| 475 void SchedulePrefsFilePathVerification(const base::FilePath& profile_path) { | 477 void SchedulePrefsFilePathVerification(const base::FilePath& profile_path) { |
| 476 #if defined(OS_WIN) | 478 #if defined(OS_WIN) |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 534 | 536 |
| 535 void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) { | 537 void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) { |
| 536 ProfilePrefStoreManager::RegisterProfilePrefs(registry); | 538 ProfilePrefStoreManager::RegisterProfilePrefs(registry); |
| 537 } | 539 } |
| 538 | 540 |
| 539 void RegisterPrefs(PrefRegistrySimple* registry) { | 541 void RegisterPrefs(PrefRegistrySimple* registry) { |
| 540 ProfilePrefStoreManager::RegisterPrefs(registry); | 542 ProfilePrefStoreManager::RegisterPrefs(registry); |
| 541 } | 543 } |
| 542 | 544 |
| 543 } // namespace chrome_prefs | 545 } // namespace chrome_prefs |
| OLD | NEW |