| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_DEVICE_MANAGEMENT_POLICY_CACHE_H_ | 5 #ifndef CHROME_BROWSER_POLICY_DEVICE_MANAGEMENT_POLICY_CACHE_H_ |
| 6 #define CHROME_BROWSER_POLICY_DEVICE_MANAGEMENT_POLICY_CACHE_H_ | 6 #define CHROME_BROWSER_POLICY_DEVICE_MANAGEMENT_POLICY_CACHE_H_ |
| 7 | 7 |
| 8 #include "base/file_path.h" | 8 #include "base/file_path.h" |
| 9 #include "base/gtest_prod_util.h" | 9 #include "base/gtest_prod_util.h" |
| 10 #include "base/lock.h" | |
| 11 #include "base/ref_counted.h" | 10 #include "base/ref_counted.h" |
| 12 #include "base/scoped_ptr.h" | 11 #include "base/scoped_ptr.h" |
| 12 #include "base/synchronization/lock.h" |
| 13 #include "base/time.h" | 13 #include "base/time.h" |
| 14 #include "chrome/browser/policy/proto/device_management_backend.pb.h" | 14 #include "chrome/browser/policy/proto/device_management_backend.pb.h" |
| 15 | 15 |
| 16 class DictionaryValue; | 16 class DictionaryValue; |
| 17 class Value; | 17 class Value; |
| 18 | 18 |
| 19 namespace policy { | 19 namespace policy { |
| 20 | 20 |
| 21 namespace em = enterprise_management; | 21 namespace em = enterprise_management; |
| 22 | 22 |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 | 67 |
| 68 // Decodes a policy message and returns it in Value representation. Ownership | 68 // Decodes a policy message and returns it in Value representation. Ownership |
| 69 // of the returned dictionary is transferred to the caller. | 69 // of the returned dictionary is transferred to the caller. |
| 70 static DictionaryValue* DecodePolicy( | 70 static DictionaryValue* DecodePolicy( |
| 71 const em::DevicePolicyResponse& response); | 71 const em::DevicePolicyResponse& response); |
| 72 | 72 |
| 73 // The file in which we store a cached version of the policy information. | 73 // The file in which we store a cached version of the policy information. |
| 74 const FilePath backing_file_path_; | 74 const FilePath backing_file_path_; |
| 75 | 75 |
| 76 // Protects |policy_|. | 76 // Protects |policy_|. |
| 77 Lock lock_; | 77 base::Lock lock_; |
| 78 | 78 |
| 79 // Policy key-value information. | 79 // Policy key-value information. |
| 80 scoped_ptr<DictionaryValue> policy_; | 80 scoped_ptr<DictionaryValue> policy_; |
| 81 | 81 |
| 82 // Tracks whether the store received a SetPolicy() call, which overrides any | 82 // Tracks whether the store received a SetPolicy() call, which overrides any |
| 83 // information loaded from the file. | 83 // information loaded from the file. |
| 84 bool fresh_policy_; | 84 bool fresh_policy_; |
| 85 | 85 |
| 86 bool is_device_unmanaged_; | 86 bool is_device_unmanaged_; |
| 87 | 87 |
| 88 // The time at which the policy was last refreshed. | 88 // The time at which the policy was last refreshed. |
| 89 base::Time last_policy_refresh_time_; | 89 base::Time last_policy_refresh_time_; |
| 90 }; | 90 }; |
| 91 | 91 |
| 92 } // namespace policy | 92 } // namespace policy |
| 93 | 93 |
| 94 #endif // CHROME_BROWSER_POLICY_DEVICE_MANAGEMENT_POLICY_CACHE_H_ | 94 #endif // CHROME_BROWSER_POLICY_DEVICE_MANAGEMENT_POLICY_CACHE_H_ |
| OLD | NEW |