Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2474)

Unified Diff: chrome/browser/policy/configuration_policy_provider.h

Issue 56623005: Policy providers all get a SchemaRegistry to work with. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@chrome-policy-schema-9-purge-with-callback
Patch Set: rebase Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..4fa49375b3a8655aca49c878b6117f9e09b7161d 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,9 @@ 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| whose domain is supported by this provider.
+ 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 +68,10 @@ 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:
+ // This base implementation calls RefreshPolicies if
+ // |has_new_schemas| is true.
+ virtual void OnSchemaRegistryUpdated(bool has_new_schemas) OVERRIDE;
protected:
// Subclasses must invoke this to update the policies currently served by
@@ -81,6 +79,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 +88,8 @@ class ConfigurationPolicyProvider {
// Whether Shutdown() has been invoked.
bool did_shutdown_;
+ SchemaRegistry* schema_registry_;
+
ObserverList<Observer, true> observer_list_;
DISALLOW_COPY_AND_ASSIGN(ConfigurationPolicyProvider);
« no previous file with comments | « chrome/browser/policy/config_dir_policy_loader_unittest.cc ('k') | chrome/browser/policy/configuration_policy_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698