Index: chrome/browser/policy/configuration_policy_provider.h |
diff --git a/chrome/browser/policy/configuration_policy_provider.h b/chrome/browser/policy/configuration_policy_provider.h |
index 3fef214b49c23eaa68ecfd801eaa201de7883935..33158818f01e4a4d5d903a37c6a9490fac28f1f9 100644 |
--- a/chrome/browser/policy/configuration_policy_provider.h |
+++ b/chrome/browser/policy/configuration_policy_provider.h |
@@ -10,16 +10,15 @@ |
#include "base/memory/scoped_ptr.h" |
#include "base/observer_list.h" |
#include "chrome/browser/policy/policy_bundle.h" |
+#include "chrome/browser/policy/schema_registry.h" |
#include "components/policy/core/common/policy_namespace.h" |
namespace policy { |
-class PolicyDomainDescriptor; |
- |
// A mostly-abstract super class for platform-specific policy providers. |
// Platform-specific policy providers (Windows Group Policy, gconf, |
// etc.) should implement a subclass of this class. |
-class ConfigurationPolicyProvider { |
+class ConfigurationPolicyProvider : public SchemaRegistry::Observer { |
public: |
class Observer { |
public: |
@@ -39,7 +38,10 @@ class ConfigurationPolicyProvider { |
// are created early during startup to provide the initial policies; the |
// Init() call allows them to perform initialization tasks that require |
// running message loops. |
- virtual void Init(); |
+ // The policy provider will load policy for the components registered in |
+ // the |schema_registry|, and will reload whenever the registry issues |
+ // updated. |
bartfab (slow)
2013/11/05 15:53:04
* "whenever the registry issues updated"? This sta
Joao da Silva
2013/11/07 13:15:00
Done.
|
+ virtual void Init(SchemaRegistry* registry); |
// Must be invoked before deleting the provider. Implementations can override |
// this method to do appropriate cleanup while threads are still running, and |
@@ -67,13 +69,11 @@ class ConfigurationPolicyProvider { |
virtual void AddObserver(Observer* observer); |
virtual void RemoveObserver(Observer* observer); |
- // Notifies the provider that there is interest in loading policy for the |
- // listed components in the given |descriptor|. The list is complete; all the |
- // components that matter for the domain are included, and components not |
- // included can be discarded. The provider can ignore this information or use |
- // it to selectively load the corresponding policy from its sources. |
- virtual void RegisterPolicyDomain( |
- scoped_refptr<const PolicyDomainDescriptor> descriptor); |
+ // SchemaRegistry::Observer: |
+ // The base implementation just calls RefreshPolicies. |
bartfab (slow)
2013/11/05 15:53:04
Nit: Maybe better s/The base implementation/This b
Joao da Silva
2013/11/07 13:15:00
Done.
|
+ virtual void OnSchemaRegistryUpdated( |
+ const scoped_refptr<SchemaMap>& current_map, |
bartfab (slow)
2013/11/05 15:53:04
Nit: SchemaMap:
* Forward-declare here.
* #include
Joao da Silva
2013/11/07 13:15:00
It's part of the interface that this is overriding
|
+ bool has_new_schemas) OVERRIDE; |
protected: |
// Subclasses must invoke this to update the policies currently served by |
@@ -81,6 +81,8 @@ class ConfigurationPolicyProvider { |
// The observers are notified after the policies are updated. |
void UpdatePolicy(scoped_ptr<PolicyBundle> bundle); |
+ const scoped_refptr<SchemaMap>& schema_map() const; |
+ |
private: |
// The policies currently configured at this provider. |
PolicyBundle policy_bundle_; |
@@ -88,6 +90,8 @@ class ConfigurationPolicyProvider { |
// Whether Shutdown() has been invoked. |
bool did_shutdown_; |
+ SchemaRegistry* schema_registry_; |
+ |
ObserverList<Observer, true> observer_list_; |
DISALLOW_COPY_AND_ASSIGN(ConfigurationPolicyProvider); |