| Index: chrome/browser/policy/cloud/cloud_policy_store.h
|
| diff --git a/chrome/browser/policy/cloud/cloud_policy_store.h b/chrome/browser/policy/cloud/cloud_policy_store.h
|
| index fee92b7218d9a30f3d35901cd2dc2ff838138904..31f6961846f029db7fbf756cbffb516ba4141114 100644
|
| --- a/chrome/browser/policy/cloud/cloud_policy_store.h
|
| +++ b/chrome/browser/policy/cloud/cloud_policy_store.h
|
| @@ -73,11 +73,23 @@ class CloudPolicyStore {
|
| return validation_status_;
|
| }
|
|
|
| + // Returns true if the latest policy loaded was different from the previous
|
| + // policy.
|
| + bool policy_changed() const {
|
| + return policy_changed_;
|
| + }
|
| +
|
| // Store a new policy blob. Pending load/store operations will be canceled.
|
| // The store operation may proceed asynchronously and observers are notified
|
| // once the operation finishes. If successful, OnStoreLoaded() will be invoked
|
| // on the observers and the updated policy can be read through policy().
|
| // Errors generate OnStoreError() notifications.
|
| + // |invalidation_version| is the invalidation version of the policy to be
|
| + // stored.
|
| + void Store(
|
| + const enterprise_management::PolicyFetchResponse& policy,
|
| + int64 invalidation_version);
|
| +
|
| virtual void Store(
|
| const enterprise_management::PolicyFetchResponse& policy) = 0;
|
|
|
| @@ -93,6 +105,11 @@ class CloudPolicyStore {
|
| // Removes the specified observer.
|
| void RemoveObserver(Observer* observer);
|
|
|
| + // The invalidation version of the last policy stored. This value can be read
|
| + // by observers to determine which version of the policy is now available.
|
| + int64 invalidation_version() {
|
| + return invalidation_version_;
|
| + }
|
| protected:
|
| // Invokes the corresponding callback on all registered observers.
|
| void NotifyStoreLoaded();
|
| @@ -110,11 +127,21 @@ class CloudPolicyStore {
|
| // Latest validation status.
|
| CloudPolicyValidatorBase::Status validation_status_;
|
|
|
| + // The invalidation version of the last policy stored.
|
| + int64 invalidation_version_;
|
| +
|
| private:
|
| // Whether the store has completed asynchronous initialization, which is
|
| // triggered by calling Load().
|
| bool is_initialized_;
|
|
|
| + // Whether latest policy loaded was different from the previous policy.
|
| + bool policy_changed_;
|
| +
|
| + // The hash value of the current policy. This is used to determine when the
|
| + // policy changes.
|
| + uint32 hash_value_;
|
| +
|
| ObserverList<Observer, true> observers_;
|
|
|
| DISALLOW_COPY_AND_ASSIGN(CloudPolicyStore);
|
|
|