OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 COMPONENTS_POLICY_CORE_COMMON_CLOUD_CLOUD_POLICY_SERVICE_H_ | 5 #ifndef COMPONENTS_POLICY_CORE_COMMON_CLOUD_CLOUD_POLICY_SERVICE_H_ |
6 #define COMPONENTS_POLICY_CORE_COMMON_CLOUD_CLOUD_POLICY_SERVICE_H_ | 6 #define COMPONENTS_POLICY_CORE_COMMON_CLOUD_CLOUD_POLICY_SERVICE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 | 50 |
51 // Refreshes policy. |callback| will be invoked after the operation completes | 51 // Refreshes policy. |callback| will be invoked after the operation completes |
52 // or aborts because of errors. | 52 // or aborts because of errors. |
53 void RefreshPolicy(const RefreshPolicyCallback& callback); | 53 void RefreshPolicy(const RefreshPolicyCallback& callback); |
54 | 54 |
55 // Adds/Removes an Observer for this object. | 55 // Adds/Removes an Observer for this object. |
56 void AddObserver(Observer* observer); | 56 void AddObserver(Observer* observer); |
57 void RemoveObserver(Observer* observer); | 57 void RemoveObserver(Observer* observer); |
58 | 58 |
59 // CloudPolicyClient::Observer: | 59 // CloudPolicyClient::Observer: |
60 virtual void OnPolicyFetched(CloudPolicyClient* client) OVERRIDE; | 60 virtual void OnPolicyFetched(CloudPolicyClient* client) override; |
61 virtual void OnRegistrationStateChanged(CloudPolicyClient* client) OVERRIDE; | 61 virtual void OnRegistrationStateChanged(CloudPolicyClient* client) override; |
62 virtual void OnClientError(CloudPolicyClient* client) OVERRIDE; | 62 virtual void OnClientError(CloudPolicyClient* client) override; |
63 | 63 |
64 // CloudPolicyStore::Observer: | 64 // CloudPolicyStore::Observer: |
65 virtual void OnStoreLoaded(CloudPolicyStore* store) OVERRIDE; | 65 virtual void OnStoreLoaded(CloudPolicyStore* store) override; |
66 virtual void OnStoreError(CloudPolicyStore* store) OVERRIDE; | 66 virtual void OnStoreError(CloudPolicyStore* store) override; |
67 | 67 |
68 bool IsInitializationComplete() const { return initialization_complete_; } | 68 bool IsInitializationComplete() const { return initialization_complete_; } |
69 | 69 |
70 private: | 70 private: |
71 // Helper function that is called when initialization may be complete, and | 71 // Helper function that is called when initialization may be complete, and |
72 // which is responsible for notifying observers. | 72 // which is responsible for notifying observers. |
73 void CheckInitializationCompleted(); | 73 void CheckInitializationCompleted(); |
74 | 74 |
75 // Invokes the refresh callbacks and clears refresh state. The |success| flag | 75 // Invokes the refresh callbacks and clears refresh state. The |success| flag |
76 // is passed through to the refresh callbacks. | 76 // is passed through to the refresh callbacks. |
(...skipping 28 matching lines...) Expand all Loading... |
105 // Observers who will receive notifications when the service has finished | 105 // Observers who will receive notifications when the service has finished |
106 // initializing. | 106 // initializing. |
107 ObserverList<Observer, true> observers_; | 107 ObserverList<Observer, true> observers_; |
108 | 108 |
109 DISALLOW_COPY_AND_ASSIGN(CloudPolicyService); | 109 DISALLOW_COPY_AND_ASSIGN(CloudPolicyService); |
110 }; | 110 }; |
111 | 111 |
112 } // namespace policy | 112 } // namespace policy |
113 | 113 |
114 #endif // COMPONENTS_POLICY_CORE_COMMON_CLOUD_CLOUD_POLICY_SERVICE_H_ | 114 #endif // COMPONENTS_POLICY_CORE_COMMON_CLOUD_CLOUD_POLICY_SERVICE_H_ |
OLD | NEW |