| Index: chrome/browser/policy/configuration_policy_reader.cc
|
| diff --git a/chrome/browser/policy/configuration_policy_reader.cc b/chrome/browser/policy/configuration_policy_reader.cc
|
| index 472a151a70abdfdea0b83956d33b475c1e4a9171..b0d25fdbf0528fbd76a12baa810a811842a8e85e 100644
|
| --- a/chrome/browser/policy/configuration_policy_reader.cc
|
| +++ b/chrome/browser/policy/configuration_policy_reader.cc
|
| @@ -103,6 +103,14 @@ void ConfigurationPolicyReader::OnProviderGoingAway() {
|
| provider_ = NULL;
|
| }
|
|
|
| +void ConfigurationPolicyReader::AddObserver(Observer* observer) {
|
| + observers_.AddObserver(observer);
|
| +}
|
| +
|
| +void ConfigurationPolicyReader::RemoveObserver(Observer* observer) {
|
| + observers_.RemoveObserver(observer);
|
| +}
|
| +
|
| // static
|
| ConfigurationPolicyReader*
|
| ConfigurationPolicyReader::CreateManagedPlatformPolicyReader() {
|
| @@ -172,6 +180,8 @@ void ConfigurationPolicyReader::Refresh() {
|
| scoped_ptr<ConfigurationPolicyStatusKeeper> new_keeper(
|
| new ConfigurationPolicyStatusKeeper(provider_, policy_level_));
|
| policy_keeper_.reset(new_keeper.release());
|
| +
|
| + FOR_EACH_OBSERVER(Observer, observers_, OnPolicyValuesChanged());
|
| }
|
|
|
| // PolicyStatus
|
| @@ -188,11 +198,25 @@ PolicyStatus::PolicyStatus(ConfigurationPolicyReader* managed_platform,
|
| PolicyStatus::~PolicyStatus() {
|
| }
|
|
|
| -ListValue* PolicyStatus::GetPolicyStatusList(bool* any_policies_sent) const {
|
| +void PolicyStatus::AddObserver(Observer* observer) const {
|
| + managed_platform_->AddObserver(observer);
|
| + managed_cloud_->AddObserver(observer);
|
| + recommended_platform_->AddObserver(observer);
|
| + recommended_cloud_->AddObserver(observer);
|
| +}
|
| +
|
| +void PolicyStatus::RemoveObserver(Observer* observer) const {
|
| + managed_platform_->RemoveObserver(observer);
|
| + managed_cloud_->RemoveObserver(observer);
|
| + recommended_platform_->RemoveObserver(observer);
|
| + recommended_cloud_->RemoveObserver(observer);
|
| +}
|
| +
|
| +ListValue* PolicyStatus::GetPolicyStatusList(bool* any_policies_set) const {
|
| ListValue* result = new ListValue();
|
| std::vector<DictionaryValue*> unsent_policies;
|
|
|
| - *any_policies_sent = false;
|
| + *any_policies_set = false;
|
| const PolicyDefinitionList* supported_policies =
|
| ConfigurationPolicyPrefStore::GetChromePolicyDefinitionList();
|
| const PolicyDefinitionList::Entry* policy = supported_policies->begin;
|
| @@ -206,7 +230,7 @@ ListValue* PolicyStatus::GetPolicyStatusList(bool* any_policies_sent) const {
|
| string16());
|
| unsent_policies.push_back(info.GetDictionaryValue());
|
| } else {
|
| - *any_policies_sent = true;
|
| + *any_policies_set = true;
|
| }
|
| }
|
|
|
|
|