Index: components/policy/core/common/configuration_policy_provider.cc |
diff --git a/components/policy/core/common/configuration_policy_provider.cc b/components/policy/core/common/configuration_policy_provider.cc |
index 03fd8d7dd2accc22da17dec26372dcc034bebed8..2080592d67a3a481c63853ebb8008a364f3daa60 100644 |
--- a/components/policy/core/common/configuration_policy_provider.cc |
+++ b/components/policy/core/common/configuration_policy_provider.cc |
@@ -13,7 +13,8 @@ namespace policy { |
ConfigurationPolicyProvider::Observer::~Observer() {} |
ConfigurationPolicyProvider::ConfigurationPolicyProvider() |
- : initialized_(false), |
+ : source_(POLICY_SOURCE_UNKNOWN), |
+ initialized_(false), |
schema_registry_(NULL) {} |
ConfigurationPolicyProvider::~ConfigurationPolicyProvider() { |
@@ -43,15 +44,24 @@ bool ConfigurationPolicyProvider::IsInitializationComplete( |
void ConfigurationPolicyProvider::UpdatePolicy( |
scoped_ptr<PolicyBundle> bundle) { |
- if (bundle.get()) |
+ if (bundle.get()) { |
policy_bundle_.Swap(bundle.get()); |
- else |
+ SetPolicySources(); |
+ } else { |
policy_bundle_.Clear(); |
+ } |
FOR_EACH_OBSERVER(ConfigurationPolicyProvider::Observer, |
observer_list_, |
OnUpdatePolicy(this)); |
} |
+void ConfigurationPolicyProvider::SetPolicySources() { |
+ for (PolicyBundle::iterator it = policy_bundle_.begin(); |
Thiemo Nagel
2015/09/04 20:15:53
I'd suggest a range-based loop to improve readabil
fhorschig
2015/09/07 14:09:34
Wow, it works !? Awesome! Done.
|
+ it != policy_bundle_.end(); ++it) { |
+ it->second->SetEntrySources(source_); |
+ } |
+} |
+ |
SchemaRegistry* ConfigurationPolicyProvider::schema_registry() const { |
return schema_registry_; |
} |