Chromium Code Reviews| 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 2f37588ee1dbbe4f861c8fa4f144715a077fe453..93d292209c7247be086431bb80ad6eee3594ae82 100644 |
| --- a/chrome/browser/policy/configuration_policy_pref_store.cc |
| +++ b/chrome/browser/policy/configuration_policy_pref_store.cc |
| @@ -18,10 +18,9 @@ |
| #include "base/utf_string_conversions.h" |
| #include "base/values.h" |
| #include "chrome/browser/browser_process.h" |
| +#include "chrome/browser/policy/browser_policy_connector.h" |
| #include "chrome/browser/policy/configuration_policy_provider.h" |
| -#include "chrome/browser/policy/configuration_policy_provider_keeper.h" |
| -#include "chrome/browser/policy/device_management_policy_provider.h" |
| -#include "chrome/browser/policy/profile_policy_context.h" |
| +#include "chrome/browser/policy/profile_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" |
| @@ -226,7 +225,7 @@ const ConfigurationPolicyPrefKeeper::PolicyToPreferenceMapEntry |
| { Value::TYPE_BOOLEAN, kPolicyDisable3DAPIs, |
| prefs::kDisable3DAPIs }, |
| { Value::TYPE_INTEGER, kPolicyPolicyRefreshRate, |
| - prefs::kPolicyRefreshRate }, |
| + prefs::kPolicyUserPolicyRefreshRate }, |
| { Value::TYPE_BOOLEAN, kPolicyInstantEnabled, prefs::kInstantEnabled }, |
| { Value::TYPE_BOOLEAN, kPolicyDefaultBrowserSettingEnabled, |
| prefs::kDefaultBrowserSettingEnabled }, |
| @@ -734,35 +733,49 @@ void ConfigurationPolicyPrefStore::OnProviderGoingAway() { |
| // static |
| ConfigurationPolicyPrefStore* |
| ConfigurationPolicyPrefStore::CreateManagedPlatformPolicyPrefStore() { |
| - ConfigurationPolicyProviderKeeper* keeper = |
| - g_browser_process->configuration_policy_provider_keeper(); |
| - return new ConfigurationPolicyPrefStore(keeper->managed_platform_provider()); |
| + BrowserPolicyConnector* connector = |
| + g_browser_process->browser_policy_connector(); |
| + return new ConfigurationPolicyPrefStore( |
| + connector->GetManagedPlatformProvider()); |
| } |
| // static |
| ConfigurationPolicyPrefStore* |
| ConfigurationPolicyPrefStore::CreateManagedCloudPolicyPrefStore( |
| Profile* profile) { |
| - if (profile) { |
| - return new ConfigurationPolicyPrefStore( |
| - profile->GetPolicyContext()->GetDeviceManagementPolicyProvider()); |
| + ConfigurationPolicyProvider* provider = NULL; |
| + if (profile) |
| + provider = profile->GetPolicyConnector()->GetManagedPolicyProvider(); |
| + if (!provider) { |
|
gfeher
2011/02/14 17:28:50
Is this logic a temporary thing that will go away
Mattias Nissler (ping if slow)
2011/02/15 10:15:16
The point here is that for user policy (i.e. profi
Jakob Kummerow
2011/02/21 12:12:15
Done. And I've thrown in a comment for good measur
|
| + BrowserPolicyConnector* connector = |
| + g_browser_process->browser_policy_connector(); |
|
Mattias Nissler (ping if slow)
2011/02/15 10:15:16
do we need the connector local? I guess it doesn't
Jakob Kummerow
2011/02/21 12:12:15
We don't need it, but it prevents an ugly line bre
|
| + provider = connector->GetManagedCloudProvider(); |
| } |
| - return new ConfigurationPolicyPrefStore(NULL); |
| + return new ConfigurationPolicyPrefStore(provider); |
| } |
| // static |
| ConfigurationPolicyPrefStore* |
| ConfigurationPolicyPrefStore::CreateRecommendedPlatformPolicyPrefStore() { |
| - ConfigurationPolicyProviderKeeper* keeper = |
| - g_browser_process->configuration_policy_provider_keeper(); |
| - return new ConfigurationPolicyPrefStore(keeper->recommended_provider()); |
| + BrowserPolicyConnector* connector = |
| + g_browser_process->browser_policy_connector(); |
| + return new ConfigurationPolicyPrefStore( |
| + connector->GetRecommendedPlatformProvider()); |
| } |
| // static |
| ConfigurationPolicyPrefStore* |
| ConfigurationPolicyPrefStore::CreateRecommendedCloudPolicyPrefStore( |
| Profile* profile) { |
| - return new ConfigurationPolicyPrefStore(NULL); |
| + ConfigurationPolicyProvider* provider = NULL; |
| + if (profile) |
| + provider = profile->GetPolicyConnector()->GetRecommendedPolicyProvider(); |
| + if (!provider) { |
|
Mattias Nissler (ping if slow)
2011/02/15 10:15:16
same here.
Jakob Kummerow
2011/02/21 12:12:15
Done.
|
| + BrowserPolicyConnector* connector = |
| + g_browser_process->browser_policy_connector(); |
|
Mattias Nissler (ping if slow)
2011/02/15 10:15:16
drop connector local?
Jakob Kummerow
2011/02/21 12:12:15
Same as above -- keeping it as it is for line brea
|
| + provider = connector->GetRecommendedCloudProvider(); |
| + } |
| + return new ConfigurationPolicyPrefStore(provider); |
| } |
| /* static */ |