Chromium Code Reviews| 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" | 10 #include "base/lock.h" |
| (...skipping 23 matching lines...) Expand all Loading... | |
| 34 void LoadPolicyFromFile(); | 34 void LoadPolicyFromFile(); |
| 35 | 35 |
| 36 // Resets the policy information. Returns true if the new policy is different | 36 // Resets the policy information. Returns true if the new policy is different |
| 37 // from the previously stored policy. | 37 // from the previously stored policy. |
| 38 bool SetPolicy(const em::DevicePolicyResponse& policy); | 38 bool SetPolicy(const em::DevicePolicyResponse& policy); |
| 39 | 39 |
| 40 // Gets the policy information. Ownership of the return value is transferred | 40 // Gets the policy information. Ownership of the return value is transferred |
| 41 // to the caller. | 41 // to the caller. |
| 42 DictionaryValue* GetPolicy(); | 42 DictionaryValue* GetPolicy(); |
| 43 | 43 |
| 44 bool is_device_unmanaged() const { | |
| 45 return is_device_unmanaged_; | |
| 46 } | |
| 47 void SetDeviceUnmanaged(bool is_device_unmanaged); | |
|
Mattias Nissler (ping if slow)
2010/11/26 10:37:45
Can you swap these? Most classes I have seen have
Jakob Kummerow
2010/11/26 11:07:42
Done.
| |
| 48 | |
| 44 // Returns the time as which the policy was last fetched. | 49 // Returns the time as which the policy was last fetched. |
| 45 base::Time last_policy_refresh_time() const { | 50 base::Time last_policy_refresh_time() const { |
| 46 return last_policy_refresh_time_; | 51 return last_policy_refresh_time_; |
| 47 } | 52 } |
| 48 | 53 |
| 49 private: | 54 private: |
| 50 friend class DeviceManagementPolicyCacheDecodeTest; | 55 friend class DeviceManagementPolicyCacheDecodeTest; |
| 51 FRIEND_TEST_ALL_PREFIXES(DeviceManagementPolicyCacheDecodeTest, DecodePolicy); | 56 FRIEND_TEST_ALL_PREFIXES(DeviceManagementPolicyCacheDecodeTest, DecodePolicy); |
| 52 | 57 |
| 53 // Decodes an int64 value. Checks whether the passed value fits the numeric | 58 // Decodes an int64 value. Checks whether the passed value fits the numeric |
| (...skipping 16 matching lines...) Expand all Loading... | |
| 70 // Protects |policy_|. | 75 // Protects |policy_|. |
| 71 Lock lock_; | 76 Lock lock_; |
| 72 | 77 |
| 73 // Policy key-value information. | 78 // Policy key-value information. |
| 74 scoped_ptr<DictionaryValue> policy_; | 79 scoped_ptr<DictionaryValue> policy_; |
| 75 | 80 |
| 76 // Tracks whether the store received a SetPolicy() call, which overrides any | 81 // Tracks whether the store received a SetPolicy() call, which overrides any |
| 77 // information loaded from the file. | 82 // information loaded from the file. |
| 78 bool fresh_policy_; | 83 bool fresh_policy_; |
| 79 | 84 |
| 85 bool is_device_unmanaged_; | |
| 86 | |
| 80 // The time at which the policy was last refreshed. | 87 // The time at which the policy was last refreshed. |
| 81 base::Time last_policy_refresh_time_; | 88 base::Time last_policy_refresh_time_; |
| 82 }; | 89 }; |
| 83 | 90 |
| 84 } // namespace policy | 91 } // namespace policy |
| 85 | 92 |
| 86 #endif // CHROME_BROWSER_POLICY_DEVICE_MANAGEMENT_POLICY_CACHE_H_ | 93 #endif // CHROME_BROWSER_POLICY_DEVICE_MANAGEMENT_POLICY_CACHE_H_ |
| OLD | NEW |