OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_POLICY_USER_CLOUD_POLICY_STORE_H_ | 5 #ifndef CHROME_BROWSER_POLICY_USER_CLOUD_POLICY_STORE_H_ |
6 #define CHROME_BROWSER_POLICY_USER_CLOUD_POLICY_STORE_H_ | 6 #define CHROME_BROWSER_POLICY_USER_CLOUD_POLICY_STORE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 // Creates a policy store associated with the user signed in to this | 22 // Creates a policy store associated with the user signed in to this |
23 // |profile|. | 23 // |profile|. |
24 explicit UserCloudPolicyStore(Profile* profile); | 24 explicit UserCloudPolicyStore(Profile* profile); |
25 virtual ~UserCloudPolicyStore(); | 25 virtual ~UserCloudPolicyStore(); |
26 | 26 |
27 // CloudPolicyStore implementation. | 27 // CloudPolicyStore implementation. |
28 virtual void Load() OVERRIDE; | 28 virtual void Load() OVERRIDE; |
29 virtual void Store( | 29 virtual void Store( |
30 const enterprise_management::PolicyFetchResponse& policy) OVERRIDE; | 30 const enterprise_management::PolicyFetchResponse& policy) OVERRIDE; |
31 | 31 |
| 32 protected: |
| 33 virtual void RemoveStoredPolicy() OVERRIDE; |
| 34 |
32 private: | 35 private: |
33 // Starts policy blob validation. |callback| is invoked once validation is | 36 // Starts policy blob validation. |callback| is invoked once validation is |
34 // complete. | 37 // complete. |
35 void Validate( | 38 void Validate( |
36 scoped_ptr<enterprise_management::PolicyFetchResponse> policy, | 39 scoped_ptr<enterprise_management::PolicyFetchResponse> policy, |
37 const UserCloudPolicyValidator::CompletionCallback& callback); | 40 const UserCloudPolicyValidator::CompletionCallback& callback); |
38 | 41 |
39 // Callback invoked to store the policy after validation has finished. | 42 // Callback invoked to store the policy after validation has finished. |
40 void StorePolicyAfterValidation(UserCloudPolicyValidator* validator); | 43 void StorePolicyAfterValidation(UserCloudPolicyValidator* validator); |
41 | 44 |
42 base::WeakPtrFactory<UserCloudPolicyStore> weak_factory_; | 45 base::WeakPtrFactory<UserCloudPolicyStore> weak_factory_; |
43 | 46 |
44 // Weak pointer to the profile associated with this store. | 47 // Weak pointer to the profile associated with this store. |
45 Profile* profile_; | 48 Profile* profile_; |
46 | 49 |
47 DISALLOW_COPY_AND_ASSIGN(UserCloudPolicyStore); | 50 DISALLOW_COPY_AND_ASSIGN(UserCloudPolicyStore); |
48 }; | 51 }; |
49 | 52 |
50 } // namespace policy | 53 } // namespace policy |
51 | 54 |
52 #endif // CHROME_BROWSER_POLICY_USER_CLOUD_POLICY_STORE_H_ | 55 #endif // CHROME_BROWSER_POLICY_USER_CLOUD_POLICY_STORE_H_ |
OLD | NEW |