OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 REMOTING_HOST_POLICY_WATCHER_H_ | 5 #ifndef REMOTING_HOST_POLICY_WATCHER_H_ |
6 #define REMOTING_HOST_POLICY_WATCHER_H_ | 6 #define REMOTING_HOST_POLICY_WATCHER_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 // security risk of running with incorrectly formulated policies (by either | 52 // security risk of running with incorrectly formulated policies (by either |
53 // shutting down or locking down the host). | 53 // shutting down or locking down the host). |
54 // After calling |policy_error_callback| PolicyWatcher will continue watching | 54 // After calling |policy_error_callback| PolicyWatcher will continue watching |
55 // for policy changes and will call |policy_updated_callback| when the error | 55 // for policy changes and will call |policy_updated_callback| when the error |
56 // is recovered from and may call |policy_error_callback| when new errors are | 56 // is recovered from and may call |policy_error_callback| when new errors are |
57 // found. | 57 // found. |
58 virtual void StartWatching( | 58 virtual void StartWatching( |
59 const PolicyUpdatedCallback& policy_updated_callback, | 59 const PolicyUpdatedCallback& policy_updated_callback, |
60 const PolicyErrorCallback& policy_error_callback); | 60 const PolicyErrorCallback& policy_error_callback); |
61 | 61 |
62 // Return the current policies. | 62 // Return the current policies. If the policies have not yet been read, or if |
| 63 // an error occurred, the returned dictionary will be empty. |
63 std::unique_ptr<base::DictionaryValue> GetCurrentPolicies(); | 64 std::unique_ptr<base::DictionaryValue> GetCurrentPolicies(); |
64 | 65 |
65 // Return the default policies. | 66 // Return the default policies. |
66 static std::unique_ptr<base::DictionaryValue> GetDefaultPolicies(); | 67 static std::unique_ptr<base::DictionaryValue> GetDefaultPolicies(); |
67 | 68 |
68 // Specify a |policy_service| to borrow (on Chrome OS, from the browser | 69 // Specify a |policy_service| to borrow (on Chrome OS, from the browser |
69 // process) or specify nullptr to internally construct and use a new | 70 // process) or specify nullptr to internally construct and use a new |
70 // PolicyService (on other OS-es). PolicyWatcher must be used on the thread on | 71 // PolicyService (on other OS-es). PolicyWatcher must be used on the thread on |
71 // which it is created. |policy_service| is called on the same thread. | 72 // which it is created. |policy_service| is called on the same thread. |
72 // | 73 // |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 std::unique_ptr<policy::SchemaRegistry> owned_schema_registry_; | 157 std::unique_ptr<policy::SchemaRegistry> owned_schema_registry_; |
157 std::unique_ptr<policy::ConfigurationPolicyProvider> owned_policy_provider_; | 158 std::unique_ptr<policy::ConfigurationPolicyProvider> owned_policy_provider_; |
158 std::unique_ptr<policy::PolicyService> owned_policy_service_; | 159 std::unique_ptr<policy::PolicyService> owned_policy_service_; |
159 | 160 |
160 DISALLOW_COPY_AND_ASSIGN(PolicyWatcher); | 161 DISALLOW_COPY_AND_ASSIGN(PolicyWatcher); |
161 }; | 162 }; |
162 | 163 |
163 } // namespace remoting | 164 } // namespace remoting |
164 | 165 |
165 #endif // REMOTING_HOST_POLICY_WATCHER_H_ | 166 #endif // REMOTING_HOST_POLICY_WATCHER_H_ |
OLD | NEW |