Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1909)

Unified Diff: chrome/browser/prefs/chrome_pref_service_factory.cc

Issue 64193003: Clean up PrefServiceBuilder (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix indentation Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/prefs/chrome_pref_service_factory.cc
diff --git a/chrome/browser/prefs/chrome_pref_service_factory.cc b/chrome/browser/prefs/chrome_pref_service_factory.cc
index 67e8d6fe19489ef3f5b8fa305baf3fc24039a977..8e3eea2f749bd8d494e0b1d64b0b206bff06aa9b 100644
--- a/chrome/browser/prefs/chrome_pref_service_factory.cc
+++ b/chrome/browser/prefs/chrome_pref_service_factory.cc
@@ -18,6 +18,7 @@
#include "chrome/browser/browser_process.h"
#include "chrome/browser/prefs/command_line_pref_store.h"
#include "chrome/browser/prefs/pref_model_associator.h"
+#include "chrome/browser/prefs/pref_service_syncable.h"
#include "chrome/browser/prefs/pref_service_syncable_builder.h"
#include "chrome/browser/ui/profile_error_dialog.h"
#include "components/user_prefs/pref_registry_syncable.h"
@@ -94,36 +95,40 @@ void PrepareBuilder(
#if defined(ENABLE_CONFIGURATION_POLICY)
using policy::ConfigurationPolicyPrefStore;
- builder->WithManagedPrefs(new ConfigurationPolicyPrefStore(
- policy_service,
- g_browser_process->browser_policy_connector()->GetHandlerList(),
- policy::POLICY_LEVEL_MANDATORY));
- builder->WithRecommendedPrefs(new ConfigurationPolicyPrefStore(
- policy_service,
- g_browser_process->browser_policy_connector()->GetHandlerList(),
- policy::POLICY_LEVEL_RECOMMENDED));
+ builder->set_managed_prefs(
+ make_scoped_refptr(new ConfigurationPolicyPrefStore(
+ policy_service,
+ g_browser_process->browser_policy_connector()->GetHandlerList(),
+ policy::POLICY_LEVEL_MANDATORY)));
+ builder->set_recommended_prefs(
+ make_scoped_refptr(new ConfigurationPolicyPrefStore(
+ policy_service,
+ g_browser_process->browser_policy_connector()->GetHandlerList(),
+ policy::POLICY_LEVEL_RECOMMENDED)));
#endif // ENABLE_CONFIGURATION_POLICY
#if defined(ENABLE_MANAGED_USERS)
if (managed_user_settings) {
- builder->WithSupervisedUserPrefs(
- new SupervisedUserPrefStore(managed_user_settings));
+ builder->set_supervised_user_prefs(
+ make_scoped_refptr(new SupervisedUserPrefStore(managed_user_settings)));
}
#endif
- builder->WithAsync(async);
- builder->WithExtensionPrefs(extension_prefs.get());
- builder->WithCommandLinePrefs(
- new CommandLinePrefStore(CommandLine::ForCurrentProcess()));
- builder->WithReadErrorCallback(base::Bind(&HandleReadError));
- builder->WithUserPrefs(new JsonPrefStore(pref_filename, pref_io_task_runner));
+ builder->set_async(async);
+ builder->set_extension_prefs(extension_prefs);
+ builder->set_command_line_prefs(
+ make_scoped_refptr(
+ new CommandLinePrefStore(CommandLine::ForCurrentProcess())));
+ builder->set_read_error_callback(base::Bind(&HandleReadError));
+ builder->set_user_prefs(
+ new JsonPrefStore(pref_filename, pref_io_task_runner));
}
} // namespace
namespace chrome_prefs {
-PrefService* CreateLocalState(
+scoped_ptr<PrefService> CreateLocalState(
const base::FilePath& pref_filename,
base::SequencedTaskRunner* pref_io_task_runner,
policy::PolicyService* policy_service,
@@ -140,7 +145,7 @@ PrefService* CreateLocalState(
return builder.Create(pref_registry.get());
}
-PrefServiceSyncable* CreateProfilePrefs(
+scoped_ptr<PrefServiceSyncable> CreateProfilePrefs(
const base::FilePath& pref_filename,
base::SequencedTaskRunner* pref_io_task_runner,
policy::PolicyService* policy_service,

Powered by Google App Engine
This is Rietveld 408576698