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

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

Issue 1326353002: Remove dependency of PrefSyncableService on Profile. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@pref_model_associator
Patch Set: Move files back to //chrome/browser/prefs & //chrome/test/base Created 5 years, 3 months 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/pref_service_syncable_factory.cc
diff --git a/chrome/browser/prefs/pref_service_syncable_factory.cc b/chrome/browser/prefs/pref_service_syncable_factory.cc
index f5470377b432fe1552743da9d7a5b0b752e7b7b1..1032d50751b7d57b302ed2bdb1c76d9737c89b30 100644
--- a/chrome/browser/prefs/pref_service_syncable_factory.cc
+++ b/chrome/browser/prefs/pref_service_syncable_factory.cc
@@ -8,8 +8,6 @@
#include "base/prefs/pref_notifier_impl.h"
#include "base/prefs/pref_value_store.h"
#include "base/trace_event/trace_event.h"
-#include "chrome/browser/browser_process.h"
-#include "chrome/browser/prefs/command_line_pref_store.h"
#include "chrome/browser/prefs/pref_service_syncable.h"
#include "components/pref_registry/pref_registry_syncable.h"
@@ -20,35 +18,36 @@
#include "components/policy/core/common/policy_types.h"
#endif
-PrefServiceSyncableFactory::PrefServiceSyncableFactory() {
-}
+PrefServiceSyncableFactory::PrefServiceSyncableFactory()
+ : pref_model_associator_client_(nullptr) {}
-PrefServiceSyncableFactory::~PrefServiceSyncableFactory() {
-}
+PrefServiceSyncableFactory::~PrefServiceSyncableFactory() {}
#if defined(ENABLE_CONFIGURATION_POLICY)
void PrefServiceSyncableFactory::SetManagedPolicies(
- policy::PolicyService* service) {
+ policy::PolicyService* service,
+ policy::BrowserPolicyConnector* connector) {
set_managed_prefs(
new policy::ConfigurationPolicyPrefStore(
service,
- g_browser_process->browser_policy_connector()->GetHandlerList(),
+ connector->GetHandlerList(),
policy::POLICY_LEVEL_MANDATORY));
}
void PrefServiceSyncableFactory::SetRecommendedPolicies(
- policy::PolicyService* service) {
+ policy::PolicyService* service,
+ policy::BrowserPolicyConnector* connector) {
set_recommended_prefs(
new policy::ConfigurationPolicyPrefStore(
service,
- g_browser_process->browser_policy_connector()->GetHandlerList(),
+ connector->GetHandlerList(),
policy::POLICY_LEVEL_RECOMMENDED));
}
#endif
-void PrefServiceSyncableFactory::SetCommandLine(
- base::CommandLine* command_line) {
- set_command_line_prefs(new CommandLinePrefStore(command_line));
+void PrefServiceSyncableFactory::SetPrefModelAssociatorClient(
+ PrefModelAssociatorClient* pref_model_associator_client) {
+ pref_model_associator_client_ = pref_model_associator_client;
}
scoped_ptr<PrefServiceSyncable> PrefServiceSyncableFactory::CreateSyncable(
@@ -70,5 +69,6 @@ scoped_ptr<PrefServiceSyncable> PrefServiceSyncableFactory::CreateSyncable(
pref_registry,
read_error_callback_,
async_));
+ pref_service->SetPrefModelAssociatorClient(pref_model_associator_client_);
return pref_service.Pass();
}

Powered by Google App Engine
This is Rietveld 408576698