| OLD | NEW | 
|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/profile_pref_store_manager.h" | 5 #include "chrome/browser/prefs/profile_pref_store_manager.h" | 
| 6 | 6 | 
| 7 #include <utility> | 7 #include <utility> | 
| 8 | 8 | 
| 9 #include "base/bind.h" | 9 #include "base/bind.h" | 
| 10 #include "base/callback.h" | 10 #include "base/callback.h" | 
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 102   g_preference_validation_registry_path_for_testing = path; | 102   g_preference_validation_registry_path_for_testing = path; | 
| 103 } | 103 } | 
| 104 #endif  // OS_WIN | 104 #endif  // OS_WIN | 
| 105 | 105 | 
| 106 PersistentPrefStore* ProfilePrefStoreManager::CreateProfilePrefStore( | 106 PersistentPrefStore* ProfilePrefStoreManager::CreateProfilePrefStore( | 
| 107     const scoped_refptr<base::SequencedTaskRunner>& io_task_runner, | 107     const scoped_refptr<base::SequencedTaskRunner>& io_task_runner, | 
| 108     const base::Closure& on_reset_on_load, | 108     const base::Closure& on_reset_on_load, | 
| 109     prefs::mojom::TrackedPreferenceValidationDelegate* validation_delegate, | 109     prefs::mojom::TrackedPreferenceValidationDelegate* validation_delegate, | 
| 110     service_manager::Connector* connector, | 110     service_manager::Connector* connector, | 
| 111     scoped_refptr<PrefRegistry> pref_registry) { | 111     scoped_refptr<PrefRegistry> pref_registry) { | 
| 112   if (base::FeatureList::IsEnabled(features::kPrefService)) { | 112   if (features::PrefServiceEnabled()) { | 
| 113     ConfigurePrefService(on_reset_on_load, connector); | 113     ConfigurePrefService(on_reset_on_load, connector); | 
| 114     prefs::mojom::PrefStoreConnectorPtr pref_connector; | 114     prefs::mojom::PrefStoreConnectorPtr pref_connector; | 
| 115     connector->BindInterface(prefs::mojom::kPrefStoreServiceName, | 115     connector->BindInterface(prefs::mojom::kPrefStoreServiceName, | 
| 116                              &pref_connector); | 116                              &pref_connector); | 
| 117     return new prefs::PersistentPrefStoreClient(std::move(pref_connector), | 117     return new prefs::PersistentPrefStoreClient(std::move(pref_connector), | 
| 118                                                 std::move(pref_registry)); | 118                                                 std::move(pref_registry)); | 
| 119   } | 119   } | 
| 120   if (!kPlatformSupportsPreferenceTracking) { | 120   if (!kPlatformSupportsPreferenceTracking) { | 
| 121     return new JsonPrefStore(profile_path_.Append(chrome::kPreferencesFilename), | 121     return new JsonPrefStore(profile_path_.Append(chrome::kPreferencesFilename), | 
| 122                              io_task_runner.get(), | 122                              io_task_runner.get(), | 
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 243     const base::Closure& on_reset_on_load, | 243     const base::Closure& on_reset_on_load, | 
| 244     service_manager::Connector* connector) { | 244     service_manager::Connector* connector) { | 
| 245   auto config = prefs::mojom::PersistentPrefStoreConfiguration::New(); | 245   auto config = prefs::mojom::PersistentPrefStoreConfiguration::New(); | 
| 246   config->set_simple_configuration( | 246   config->set_simple_configuration( | 
| 247       prefs::mojom::SimplePersistentPrefStoreConfiguration::New( | 247       prefs::mojom::SimplePersistentPrefStoreConfiguration::New( | 
| 248           profile_path_.Append(chrome::kPreferencesFilename))); | 248           profile_path_.Append(chrome::kPreferencesFilename))); | 
| 249   prefs::mojom::PrefServiceControlPtr control; | 249   prefs::mojom::PrefServiceControlPtr control; | 
| 250   connector->BindInterface(prefs::mojom::kPrefStoreServiceName, &control); | 250   connector->BindInterface(prefs::mojom::kPrefStoreServiceName, &control); | 
| 251   control->Init(std::move(config)); | 251   control->Init(std::move(config)); | 
| 252 } | 252 } | 
| OLD | NEW | 
|---|