Chromium Code Reviews| Index: chrome/browser/automation/testing_automation_provider.cc |
| diff --git a/chrome/browser/automation/testing_automation_provider.cc b/chrome/browser/automation/testing_automation_provider.cc |
| index e10c260b35848542421d5d3d7215c31704468457..439ac4163655fc82e8affa3ceff3c2652964a1c5 100644 |
| --- a/chrome/browser/automation/testing_automation_provider.cc |
| +++ b/chrome/browser/automation/testing_automation_provider.cc |
| @@ -6056,11 +6056,20 @@ void TestingAutomationProvider::SetPolicies( |
| struct { |
| std::string name; |
| policy::ConfigurationPolicyProvider* provider; |
| + policy::PolicyLevel level; |
| } providers[] = { |
| - { "managed_cloud", connector->GetManagedCloudProvider() }, |
| - { "managed_platform", connector->GetManagedPlatformProvider() }, |
| - { "recommended_cloud", connector->GetRecommendedCloudProvider() }, |
| - { "recommended_platform", connector->GetRecommendedPlatformProvider() } |
| + { "managed_cloud", |
| + connector->GetManagedCloudProvider(), |
| + policy::POLICY_LEVEL_MANDATORY }, |
| + { "managed_platform", |
| + connector->GetManagedPlatformProvider(), |
| + policy::POLICY_LEVEL_MANDATORY }, |
| + { "recommended_cloud", |
| + connector->GetRecommendedCloudProvider(), |
| + policy::POLICY_LEVEL_RECOMMENDED }, |
| + { "recommended_platform", |
| + connector->GetRecommendedPlatformProvider(), |
| + policy::POLICY_LEVEL_RECOMMENDED }, |
| }; |
| // Verify if all the requested providers exist before changing anything. |
| for (size_t i = 0; i < ARRAYSIZE_UNSAFE(providers); ++i) { |
| @@ -6072,11 +6081,15 @@ void TestingAutomationProvider::SetPolicies( |
| return; |
| } |
| } |
| + policy::PolicyScope scope = policy::POLICY_SCOPE_USER; |
| + bool machine_scope = false; |
| + if (args->GetBoolean("machine_scope", &machine_scope) && machine_scope) |
|
Mattias Nissler (ping if slow)
2012/01/18 15:07:07
shouldn't we rather name this "scope" with possibl
Joao da Silva
2012/01/18 16:49:29
Agreed! The level is determined by the provider an
|
| + scope = policy::POLICY_SCOPE_MACHINE; |
| for (size_t i = 0; i < ARRAYSIZE_UNSAFE(providers); ++i) { |
| DictionaryValue* policies = NULL; |
| if (args->GetDictionary(providers[i].name, &policies) && policies) { |
| policy::PolicyMap* map = new policy::PolicyMap; |
| - map->LoadFrom(policies, list); |
| + map->LoadFrom(policies, list, providers[i].level, scope); |
| providers[i].provider->OverridePolicies(map); |
| } |
| } |