Chromium Code Reviews| 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 9ed150c2edcea4db27a7506dc6dec680188f4919..1e559560c3a21d65e93efde9bcd0e2d8c654d0b5 100644 |
| --- a/chrome/browser/policy/configuration_policy_provider.h |
| +++ b/chrome/browser/policy/configuration_policy_provider.h |
| @@ -6,12 +6,10 @@ |
| #define CHROME_BROWSER_POLICY_CONFIGURATION_POLICY_PROVIDER_H_ |
| #pragma once |
| -#include <map> |
| -#include <string> |
| - |
| #include "base/basictypes.h" |
| #include "base/memory/scoped_ptr.h" |
| #include "base/observer_list.h" |
| +#include "chrome/browser/policy/policy_bundle.h" |
| namespace policy { |
| @@ -37,8 +35,13 @@ class ConfigurationPolicyProvider { |
| // Fills the given |result| with the current policy values. Returns true if |
| // the policies were provided. This is used mainly by the |
| // ConfigurationPolicyPrefStore, which retrieves policy values from here. |
| + // DEPRECATED: this call is going away, use policies() instead. |
| + // http://crbug.com/108993 |
| bool Provide(PolicyMap* result); |
| + // Returns the current PolicyBundle. |
| + const PolicyBundle& policies() const { return policy_bundle_; } |
| + |
| // Check whether this provider has completed initialization. This is used to |
| // detect whether initialization is done in case providers implementations |
| // need to do asynchronous operations for initialization. |
| @@ -57,11 +60,10 @@ class ConfigurationPolicyProvider { |
| static void FixDeprecatedPolicies(PolicyMap* policies); |
| protected: |
| - // Sends a policy update notification to observers. |
| - void NotifyPolicyUpdated(); |
| - |
| - // Must be implemented by subclasses to provide their policy values. |
| - virtual bool ProvideInternal(PolicyMap* result) = 0; |
| + // Subclasses must invoke this to update the policies currently served by |
| + // this provider. UpdateProviderPolicy() takes ownership of |policies|. |
| + // The observers are notified after the policies are updated. |
| + void UpdateProviderPolicy(scoped_ptr<PolicyBundle> bundle); |
|
Mattias Nissler (ping if slow)
2012/05/14 09:07:21
Why not just UpdatePolicy()?
Joao da Silva
2012/05/14 09:39:17
Done.
|
| const PolicyDefinitionList* policy_definition_list() const { |
| return policy_definition_list_; |
| @@ -73,6 +75,9 @@ class ConfigurationPolicyProvider { |
| virtual void AddObserver(Observer* observer); |
| virtual void RemoveObserver(Observer* observer); |
| + // The policies currently configured at this provider. |
| + PolicyBundle policy_bundle_; |
| + |
| // Contains the default mapping from policy values to the actual names. |
| const PolicyDefinitionList* policy_definition_list_; |