| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/policy/configuration_policy_provider.h" | 5 #include "chrome/browser/policy/configuration_policy_provider.h" |
| 6 | 6 |
| 7 #include "base/callback.h" | 7 #include "base/callback.h" |
| 8 #include "chrome/browser/policy/external_data_fetcher.h" | 8 #include "chrome/browser/policy/external_data_fetcher.h" |
| 9 #include "chrome/browser/policy/policy_map.h" | 9 #include "chrome/browser/policy/policy_map.h" |
| 10 #include "policy/policy_constants.h" | 10 #include "policy/policy_constants.h" |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 schema_registry_->RemoveObserver(this); | 87 schema_registry_->RemoveObserver(this); |
| 88 schema_registry_ = NULL; | 88 schema_registry_ = NULL; |
| 89 } | 89 } |
| 90 } | 90 } |
| 91 | 91 |
| 92 bool ConfigurationPolicyProvider::IsInitializationComplete( | 92 bool ConfigurationPolicyProvider::IsInitializationComplete( |
| 93 PolicyDomain domain) const { | 93 PolicyDomain domain) const { |
| 94 return true; | 94 return true; |
| 95 } | 95 } |
| 96 | 96 |
| 97 void ConfigurationPolicyProvider::OnSchemaRegistryUpdated( | |
| 98 bool has_new_schemas) { | |
| 99 if (has_new_schemas) | |
| 100 RefreshPolicies(); | |
| 101 } | |
| 102 | |
| 103 void ConfigurationPolicyProvider::UpdatePolicy( | 97 void ConfigurationPolicyProvider::UpdatePolicy( |
| 104 scoped_ptr<PolicyBundle> bundle) { | 98 scoped_ptr<PolicyBundle> bundle) { |
| 105 if (bundle.get()) | 99 if (bundle.get()) |
| 106 policy_bundle_.Swap(bundle.get()); | 100 policy_bundle_.Swap(bundle.get()); |
| 107 else | 101 else |
| 108 policy_bundle_.Clear(); | 102 policy_bundle_.Clear(); |
| 109 FixDeprecatedPolicies(&policy_bundle_.Get( | 103 FixDeprecatedPolicies(&policy_bundle_.Get( |
| 110 PolicyNamespace(POLICY_DOMAIN_CHROME, std::string()))); | 104 PolicyNamespace(POLICY_DOMAIN_CHROME, std::string()))); |
| 111 FOR_EACH_OBSERVER(ConfigurationPolicyProvider::Observer, | 105 FOR_EACH_OBSERVER(ConfigurationPolicyProvider::Observer, |
| 112 observer_list_, | 106 observer_list_, |
| 113 OnUpdatePolicy(this)); | 107 OnUpdatePolicy(this)); |
| 114 } | 108 } |
| 115 | 109 |
| 116 const scoped_refptr<SchemaMap>& | 110 const scoped_refptr<SchemaMap>& |
| 117 ConfigurationPolicyProvider::schema_map() const { | 111 ConfigurationPolicyProvider::schema_map() const { |
| 118 return schema_registry_->schema_map(); | 112 return schema_registry_->schema_map(); |
| 119 } | 113 } |
| 120 | 114 |
| 121 void ConfigurationPolicyProvider::AddObserver(Observer* observer) { | 115 void ConfigurationPolicyProvider::AddObserver(Observer* observer) { |
| 122 observer_list_.AddObserver(observer); | 116 observer_list_.AddObserver(observer); |
| 123 } | 117 } |
| 124 | 118 |
| 125 void ConfigurationPolicyProvider::RemoveObserver(Observer* observer) { | 119 void ConfigurationPolicyProvider::RemoveObserver(Observer* observer) { |
| 126 observer_list_.RemoveObserver(observer); | 120 observer_list_.RemoveObserver(observer); |
| 127 } | 121 } |
| 128 | 122 |
| 123 void ConfigurationPolicyProvider::OnSchemaRegistryUpdated( |
| 124 bool has_new_schemas) {} |
| 125 |
| 126 void ConfigurationPolicyProvider::OnSchemaRegistryReady() {} |
| 127 |
| 129 } // namespace policy | 128 } // namespace policy |
| OLD | NEW |