OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 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_CLOUD_POLICY_CACHE_BASE_H_ | 5 #ifndef CHROME_BROWSER_POLICY_CLOUD_POLICY_CACHE_BASE_H_ |
6 #define CHROME_BROWSER_POLICY_CLOUD_POLICY_CACHE_BASE_H_ | 6 #define CHROME_BROWSER_POLICY_CLOUD_POLICY_CACHE_BASE_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/observer_list.h" | 9 #include "base/observer_list.h" |
10 #include "base/threading/non_thread_safe.h" | 10 #include "base/threading/non_thread_safe.h" |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 virtual void Load() = 0; | 50 virtual void Load() = 0; |
51 | 51 |
52 // Resets the policy information. | 52 // Resets the policy information. |
53 virtual void SetPolicy(const em::PolicyFetchResponse& policy) = 0; | 53 virtual void SetPolicy(const em::PolicyFetchResponse& policy) = 0; |
54 | 54 |
55 virtual void SetUnmanaged() = 0; | 55 virtual void SetUnmanaged() = 0; |
56 | 56 |
57 // Invoked whenever an attempt to fetch policy has been completed. The fetch | 57 // Invoked whenever an attempt to fetch policy has been completed. The fetch |
58 // may or may not have suceeded. This can be triggered by failed attempts to | 58 // may or may not have suceeded. This can be triggered by failed attempts to |
59 // fetch oauth tokens, register with dmserver or fetch policy. | 59 // fetch oauth tokens, register with dmserver or fetch policy. |
60 virtual void SetFetchingDone() = 0; | 60 virtual void SetFetchingDone(); |
61 | 61 |
62 bool is_unmanaged() const { | 62 bool is_unmanaged() const { |
63 return is_unmanaged_; | 63 return is_unmanaged_; |
64 } | 64 } |
65 | 65 |
66 // Returns the time at which the policy was last fetched. | 66 // Returns the time at which the policy was last fetched. |
67 base::Time last_policy_refresh_time() const { | 67 base::Time last_policy_refresh_time() const { |
68 return last_policy_refresh_time_; | 68 return last_policy_refresh_time_; |
69 } | 69 } |
70 | 70 |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 | 164 |
165 // Cache observers that are registered with this cache. | 165 // Cache observers that are registered with this cache. |
166 ObserverList<Observer, true> observer_list_; | 166 ObserverList<Observer, true> observer_list_; |
167 | 167 |
168 DISALLOW_COPY_AND_ASSIGN(CloudPolicyCacheBase); | 168 DISALLOW_COPY_AND_ASSIGN(CloudPolicyCacheBase); |
169 }; | 169 }; |
170 | 170 |
171 } // namespace policy | 171 } // namespace policy |
172 | 172 |
173 #endif // CHROME_BROWSER_POLICY_CLOUD_POLICY_CACHE_BASE_H_ | 173 #endif // CHROME_BROWSER_POLICY_CLOUD_POLICY_CACHE_BASE_H_ |
OLD | NEW |