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 13 matching lines...) Expand all Loading... | |
24 #include "base/prefs/pref_value_store.h" | 24 #include "base/prefs/pref_value_store.h" |
25 #include "base/threading/sequenced_worker_pool.h" | 25 #include "base/threading/sequenced_worker_pool.h" |
26 #include "base/time/time.h" | 26 #include "base/time/time.h" |
27 #include "chrome/browser/browser_process.h" | 27 #include "chrome/browser/browser_process.h" |
28 #include "chrome/browser/prefs/command_line_pref_store.h" | 28 #include "chrome/browser/prefs/command_line_pref_store.h" |
29 #include "chrome/browser/prefs/pref_hash_filter.h" | 29 #include "chrome/browser/prefs/pref_hash_filter.h" |
30 #include "chrome/browser/prefs/pref_model_associator.h" | 30 #include "chrome/browser/prefs/pref_model_associator.h" |
31 #include "chrome/browser/prefs/pref_service_syncable.h" | 31 #include "chrome/browser/prefs/pref_service_syncable.h" |
32 #include "chrome/browser/prefs/pref_service_syncable_factory.h" | 32 #include "chrome/browser/prefs/pref_service_syncable_factory.h" |
33 #include "chrome/browser/prefs/profile_pref_store_manager.h" | 33 #include "chrome/browser/prefs/profile_pref_store_manager.h" |
34 #include "chrome/browser/prefs/tracked/tracked_preference_validation_observer.h" | |
34 #include "chrome/browser/profiles/file_path_verifier_win.h" | 35 #include "chrome/browser/profiles/file_path_verifier_win.h" |
35 #include "chrome/browser/profiles/profile_info_cache.h" | 36 #include "chrome/browser/profiles/profile_info_cache.h" |
36 #include "chrome/browser/profiles/profile_manager.h" | 37 #include "chrome/browser/profiles/profile_manager.h" |
37 #include "chrome/browser/search_engines/default_search_pref_migration.h" | 38 #include "chrome/browser/search_engines/default_search_pref_migration.h" |
38 #include "chrome/browser/ui/profile_error_dialog.h" | 39 #include "chrome/browser/ui/profile_error_dialog.h" |
39 #include "chrome/common/chrome_constants.h" | 40 #include "chrome/common/chrome_constants.h" |
40 #include "chrome/common/pref_names.h" | 41 #include "chrome/common/pref_names.h" |
41 #include "components/user_prefs/pref_registry_syncable.h" | 42 #include "components/user_prefs/pref_registry_syncable.h" |
42 #include "content/public/browser/browser_context.h" | 43 #include "content/public/browser/browser_context.h" |
43 #include "content/public/browser/browser_thread.h" | 44 #include "content/public/browser/browser_thread.h" |
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
417 scoped_ptr<PrefServiceSyncable> CreateProfilePrefs( | 418 scoped_ptr<PrefServiceSyncable> CreateProfilePrefs( |
418 const base::FilePath& profile_path, | 419 const base::FilePath& profile_path, |
419 base::SequencedTaskRunner* pref_io_task_runner, | 420 base::SequencedTaskRunner* pref_io_task_runner, |
420 policy::PolicyService* policy_service, | 421 policy::PolicyService* policy_service, |
421 ManagedUserSettingsService* managed_user_settings, | 422 ManagedUserSettingsService* managed_user_settings, |
422 const scoped_refptr<PrefStore>& extension_prefs, | 423 const scoped_refptr<PrefStore>& extension_prefs, |
423 const scoped_refptr<user_prefs::PrefRegistrySyncable>& pref_registry, | 424 const scoped_refptr<user_prefs::PrefRegistrySyncable>& pref_registry, |
424 bool async) { | 425 bool async) { |
425 TRACE_EVENT0("browser", "chrome_prefs::CreateProfilePrefs"); | 426 TRACE_EVENT0("browser", "chrome_prefs::CreateProfilePrefs"); |
426 PrefServiceSyncableFactory factory; | 427 PrefServiceSyncableFactory factory; |
427 PrepareFactory(&factory, | 428 PrepareFactory( |
428 policy_service, | 429 &factory, |
429 managed_user_settings, | 430 policy_service, |
430 scoped_refptr<PersistentPrefStore>( | 431 managed_user_settings, |
431 CreateProfilePrefStoreManager(profile_path) | 432 scoped_refptr<PersistentPrefStore>( |
432 ->CreateProfilePrefStore(pref_io_task_runner)), | 433 CreateProfilePrefStoreManager(profile_path)->CreateProfilePrefStore( |
433 extension_prefs, | 434 pref_io_task_runner, |
434 async); | 435 scoped_ptr<TrackedPreferenceValidationObserver>())), |
erikwright (departed)
2014/05/14 00:39:26
I gather the actual implementation will be supplie
grt (UTC plus 2)
2014/05/14 18:57:22
Correct.
| |
436 extension_prefs, | |
437 async); | |
435 scoped_ptr<PrefServiceSyncable> pref_service = | 438 scoped_ptr<PrefServiceSyncable> pref_service = |
436 factory.CreateSyncable(pref_registry.get()); | 439 factory.CreateSyncable(pref_registry.get()); |
437 | 440 |
438 ConfigureDefaultSearchPrefMigrationToDictionaryValue(pref_service.get()); | 441 ConfigureDefaultSearchPrefMigrationToDictionaryValue(pref_service.get()); |
439 | 442 |
440 return pref_service.Pass(); | 443 return pref_service.Pass(); |
441 } | 444 } |
442 | 445 |
443 void SchedulePrefsFilePathVerification(const base::FilePath& profile_path) { | 446 void SchedulePrefsFilePathVerification(const base::FilePath& profile_path) { |
444 #if defined(OS_WIN) | 447 #if defined(OS_WIN) |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
502 | 505 |
503 void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) { | 506 void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) { |
504 ProfilePrefStoreManager::RegisterProfilePrefs(registry); | 507 ProfilePrefStoreManager::RegisterProfilePrefs(registry); |
505 } | 508 } |
506 | 509 |
507 void RegisterPrefs(PrefRegistrySimple* registry) { | 510 void RegisterPrefs(PrefRegistrySimple* registry) { |
508 ProfilePrefStoreManager::RegisterPrefs(registry); | 511 ProfilePrefStoreManager::RegisterPrefs(registry); |
509 } | 512 } |
510 | 513 |
511 } // namespace chrome_prefs | 514 } // namespace chrome_prefs |
OLD | NEW |