OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_POLICY_USER_POLICY_CACHE_H_ |
| 6 #define CHROME_BROWSER_POLICY_USER_POLICY_CACHE_H_ |
| 7 #pragma once |
| 8 |
| 9 #include "base/file_path.h" |
| 10 #include "chrome/browser/policy/cloud_policy_cache_base.h" |
| 11 |
| 12 namespace policy { |
| 13 |
| 14 // CloudPolicyCacheBase implementation that persists policy information |
| 15 // into the file specified by the c'tor parameter |backing_file_path|. |
| 16 class UserPolicyCache : public CloudPolicyCacheBase { |
| 17 public: |
| 18 explicit UserPolicyCache(const FilePath& backing_file_path); |
| 19 virtual ~UserPolicyCache(); |
| 20 |
| 21 // CloudPolicyCacheBase implementation: |
| 22 virtual void Load() OVERRIDE; |
| 23 virtual void SetPolicy(const em::PolicyFetchResponse& policy) OVERRIDE; |
| 24 virtual void SetUnmanaged() OVERRIDE; |
| 25 |
| 26 private: |
| 27 void PersistPolicy(const em::PolicyFetchResponse& policy, |
| 28 const base::Time& timestamp); |
| 29 |
| 30 // CloudPolicyCacheBase implementation: |
| 31 virtual bool DecodePolicyData(const em::PolicyData& policy_data, |
| 32 PolicyMap* mandatory, |
| 33 PolicyMap* recommended) OVERRIDE; |
| 34 |
| 35 // The file in which we store a cached version of the policy information. |
| 36 const FilePath backing_file_path_; |
| 37 |
| 38 DISALLOW_COPY_AND_ASSIGN(UserPolicyCache); |
| 39 }; |
| 40 |
| 41 } // namespace policy |
| 42 |
| 43 #endif // CHROME_BROWSER_POLICY_USER_POLICY_CACHE_H_ |
OLD | NEW |