summaryrefslogtreecommitdiffstats
path: root/chrome/browser/policy/user_cloud_policy_store.h
diff options
context:
space:
mode:
authoratwilson@chromium.org <atwilson@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-23 23:58:54 +0000
committeratwilson@chromium.org <atwilson@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-23 23:58:54 +0000
commit04eb07498287fe679648d5dcf55b4fa9e983bdac (patch)
tree542a230251ebe081a76e72ac1e330742f7caf0a7 /chrome/browser/policy/user_cloud_policy_store.h
parent7f8389d61f13c8902600cddd54b00acafebd8b27 (diff)
downloadchromium_src-04eb07498287fe679648d5dcf55b4fa9e983bdac.zip
chromium_src-04eb07498287fe679648d5dcf55b4fa9e983bdac.tar.gz
chromium_src-04eb07498287fe679648d5dcf55b4fa9e983bdac.tar.bz2
Added code to persist downloaded cloud policy to disk.
Updated UserCloudPolicyStore to actually persist and restore policy from a disk file, and added new tests to exercise this functionality. BUG=141123 Review URL: https://chromiumcodereview.appspot.com/10825415 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@153114 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/policy/user_cloud_policy_store.h')
-rw-r--r--chrome/browser/policy/user_cloud_policy_store.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/chrome/browser/policy/user_cloud_policy_store.h b/chrome/browser/policy/user_cloud_policy_store.h
index f75f4a6..8be8247 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,7 @@ class UserCloudPolicyStore : public UserCloudPolicyStoreBase {
public:
// Creates a policy store associated with the user signed in to this
// |profile|.
- explicit UserCloudPolicyStore(Profile* profile);
+ UserCloudPolicyStore(Profile* profile, const FilePath& policy_file);
virtual ~UserCloudPolicyStore();
// CloudPolicyStore implementation.
@@ -33,20 +34,32 @@ class UserCloudPolicyStore : public UserCloudPolicyStoreBase {
virtual void RemoveStoredPolicy() OVERRIDE;
private:
+
+ // Callback invoked when a new policy has been loaded from disk.
+ void PolicyLoaded(struct PolicyLoadResult policy_load_result);
+
// Starts policy blob validation. |callback| is invoked once validation is
// complete.
void Validate(
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);
};