Chromium Code Reviews| Index: chrome/browser/policy/user_policy_cache.h |
| diff --git a/chrome/browser/policy/user_policy_cache.h b/chrome/browser/policy/user_policy_cache.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..182ca01de5f01c94339976433ae5511c8b7fced9 |
| --- /dev/null |
| +++ b/chrome/browser/policy/user_policy_cache.h |
| @@ -0,0 +1,41 @@ |
| +// Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CHROME_BROWSER_POLICY_USER_POLICY_CACHE_H_ |
| +#define CHROME_BROWSER_POLICY_USER_POLICY_CACHE_H_ |
|
Mattias Nissler (ping if slow)
2011/03/24 18:55:57
#pragma once (also check other files please)
Jakob Kummerow
2011/03/28 13:53:53
Done.
|
| + |
| +#include "base/file_path.h" |
| +#include "chrome/browser/policy/cloud_policy_cache_base.h" |
| + |
| +namespace policy { |
| + |
| +// CloudPolicyCacheBase implementation that persists policy information |
| +// into the file specified by the c'tor parameter |backing_file_path|. |
| +class UserPolicyCache : public CloudPolicyCacheBase { |
| + public: |
| + explicit UserPolicyCache(const FilePath& backing_file_path); |
| + virtual ~UserPolicyCache(); |
| + |
| + // CloudPolicyCacheBase implementation: |
| + virtual void Load(); |
|
Mattias Nissler (ping if slow)
2011/03/24 18:55:57
Consider adding OVERRIDE declarations
Jakob Kummerow
2011/03/28 13:53:53
Done.
|
| + virtual void SetPolicy(const em::PolicyFetchResponse& policy); |
| + virtual void SetUnmanaged(); |
| + |
| + private: |
| + void PersistPolicy(const em::PolicyFetchResponse& policy, |
| + const base::Time& timestamp); |
| + |
|
Mattias Nissler (ping if slow)
2011/03/24 18:55:57
// CloudPolicyCacheBase implementation:
Jakob Kummerow
2011/03/28 13:53:53
Done.
|
| + virtual bool DecodePolicyData(const em::PolicyData& policy_data, |
| + PolicyMap* mandatory, |
| + PolicyMap* recommended); |
|
Mattias Nissler (ping if slow)
2011/03/24 18:55:57
OVERRIDE?
Jakob Kummerow
2011/03/28 13:53:53
Done.
|
| + |
| + // The file in which we store a cached version of the policy information. |
| + const FilePath backing_file_path_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(UserPolicyCache); |
| +}; |
| + |
| +} // namespace policy |
| + |
| +#endif // CHROME_BROWSER_POLICY_USER_POLICY_CACHE_H_ |