Index: chrome/browser/policy/configuration_policy_pref_store.cc |
diff --git a/chrome/browser/policy/configuration_policy_pref_store.cc b/chrome/browser/policy/configuration_policy_pref_store.cc |
index 822021a6626d4c2af8de7f09def1ac053e0b6b89..43d66d2efdd8c774ac3f5f333786802928f4c865 100644 |
--- a/chrome/browser/policy/configuration_policy_pref_store.cc |
+++ b/chrome/browser/policy/configuration_policy_pref_store.cc |
@@ -21,8 +21,7 @@ |
#include "chrome/browser/policy/browser_policy_connector.h" |
#include "chrome/browser/policy/configuration_policy_provider.h" |
#include "chrome/browser/policy/policy_path_parser.h" |
-#include "chrome/browser/policy/profile_policy_connector.h" |
-#include "chrome/browser/policy/profile_policy_connector_factory.h" |
+#include "chrome/browser/policy/user_policy_connector.h" |
#include "chrome/browser/prefs/pref_value_map.h" |
#include "chrome/browser/prefs/proxy_config_dictionary.h" |
#include "chrome/browser/profiles/profile.h" |
@@ -824,20 +823,9 @@ ConfigurationPolicyPrefStore::CreateManagedPlatformPolicyPrefStore() { |
// static |
ConfigurationPolicyPrefStore* |
-ConfigurationPolicyPrefStore::CreateManagedCloudPolicyPrefStore( |
- Profile* profile) { |
- ConfigurationPolicyProvider* provider = NULL; |
- if (profile) { |
- // For user policy, return the profile's policy provider. |
- provider = policy::ProfilePolicyConnectorFactory::GetForProfile(profile)-> |
- GetManagedCloudProvider(); |
- } else { |
- // For device policy, return the provider of the browser process. |
- BrowserPolicyConnector* connector = |
- g_browser_process->browser_policy_connector(); |
- provider = connector->GetManagedCloudProvider(); |
- } |
- return new ConfigurationPolicyPrefStore(provider); |
+ConfigurationPolicyPrefStore::CreateManagedCloudPolicyPrefStore() { |
+ return new ConfigurationPolicyPrefStore( |
+ g_browser_process->managed_cloud_policy_provider()); |
} |
// static |
@@ -851,20 +839,9 @@ ConfigurationPolicyPrefStore::CreateRecommendedPlatformPolicyPrefStore() { |
// static |
ConfigurationPolicyPrefStore* |
-ConfigurationPolicyPrefStore::CreateRecommendedCloudPolicyPrefStore( |
- Profile* profile) { |
- ConfigurationPolicyProvider* provider = NULL; |
- if (profile) { |
- // For user policy, return the profile's policy provider. |
- provider = policy::ProfilePolicyConnectorFactory::GetForProfile(profile)-> |
- GetRecommendedCloudProvider(); |
- } else { |
- // For device policy, return the provider of the browser process. |
- BrowserPolicyConnector* connector = |
- g_browser_process->browser_policy_connector(); |
- provider = connector->GetRecommendedCloudProvider(); |
- } |
- return new ConfigurationPolicyPrefStore(provider); |
+ConfigurationPolicyPrefStore::CreateRecommendedCloudPolicyPrefStore() { |
+ return new ConfigurationPolicyPrefStore( |
+ g_browser_process->recommended_cloud_policy_provider()); |
} |
/* static */ |