Chromium Code Reviews| Index: chrome/browser/policy/user_cloud_policy_store.h |
| diff --git a/chrome/browser/policy/user_cloud_policy_store.h b/chrome/browser/policy/user_cloud_policy_store.h |
| index f75f4a6535b9f2b443d1fd6b11d3a12aa8b48015..a99f1f45b1da3adeb74763c20fa98aaaac04208b 100644 |
| --- a/chrome/browser/policy/user_cloud_policy_store.h |
| +++ b/chrome/browser/policy/user_cloud_policy_store.h |
| @@ -9,6 +9,7 @@ |
| #include "base/basictypes.h" |
| #include "base/compiler_specific.h" |
| +#include "base/file_path.h" |
| #include "base/memory/weak_ptr.h" |
| #include "chrome/browser/policy/user_cloud_policy_store_base.h" |
| @@ -21,7 +22,8 @@ class UserCloudPolicyStore : public UserCloudPolicyStoreBase { |
| public: |
| // Creates a policy store associated with the user signed in to this |
| // |profile|. |
| - explicit UserCloudPolicyStore(Profile* profile); |
| + explicit UserCloudPolicyStore(Profile* profile, |
|
Joao da Silva
2012/08/22 08:07:00
Nit: no need to be explicit
Andrew T Wilson (Slow)
2012/08/22 23:39:30
Done.
|
| + const FilePath& policy_file); |
| virtual ~UserCloudPolicyStore(); |
| // CloudPolicyStore implementation. |
| @@ -29,6 +31,14 @@ class UserCloudPolicyStore : public UserCloudPolicyStoreBase { |
| virtual void Store( |
| const enterprise_management::PolicyFetchResponse& policy) OVERRIDE; |
| + // Callback invoked when a new policy has been loaded from disk. If |
| + // |error| is true, there was an error reading the policy from disk. |
| + // Otherwise |policy| contains the policy blob, or NULL if no policy was |
| + // found on disk. |
| + void PolicyLoaded( |
| + bool error, |
| + scoped_ptr<enterprise_management::PolicyFetchResponse> policy); |
| + |
| protected: |
| virtual void RemoveStoredPolicy() OVERRIDE; |
| @@ -39,14 +49,22 @@ class UserCloudPolicyStore : public UserCloudPolicyStoreBase { |
| scoped_ptr<enterprise_management::PolicyFetchResponse> policy, |
| const UserCloudPolicyValidator::CompletionCallback& callback); |
| + // Callback invoked to install a just-loaded policy after validation has |
| + // finished. |
| + void InstallLoadedPolicyAfterValidation(UserCloudPolicyValidator* validator); |
| + |
| // Callback invoked to store the policy after validation has finished. |
| void StorePolicyAfterValidation(UserCloudPolicyValidator* validator); |
| + // WeakPtrFactory used to create callbacks for validating and storing policy. |
| base::WeakPtrFactory<UserCloudPolicyStore> weak_factory_; |
| // Weak pointer to the profile associated with this store. |
| Profile* profile_; |
| + // Path to file where we store persisted policy. |
| + FilePath backing_file_path_; |
| + |
| DISALLOW_COPY_AND_ASSIGN(UserCloudPolicyStore); |
| }; |