| 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. |
| 63 std::unique_ptr<base::DictionaryValue> GetCurrentPolicies(); |
| 64 |
| 62 // Specify a |policy_service| to borrow (on Chrome OS, from the browser | 65 // Specify a |policy_service| to borrow (on Chrome OS, from the browser |
| 63 // process) or specify nullptr to internally construct and use a new | 66 // process) or specify nullptr to internally construct and use a new |
| 64 // PolicyService (on other OS-es). PolicyWatcher must be used on the thread on | 67 // PolicyService (on other OS-es). PolicyWatcher must be used on the thread on |
| 65 // which it is created. |policy_service| is called on the same thread. | 68 // which it is created. |policy_service| is called on the same thread. |
| 66 // | 69 // |
| 67 // When |policy_service| is null, then |file_task_runner| is used for reading | 70 // When |policy_service| is null, then |file_task_runner| is used for reading |
| 68 // the policy from files / registry / preferences (which are blocking | 71 // the policy from files / registry / preferences (which are blocking |
| 69 // operations). |file_task_runner| should be of TYPE_IO type. | 72 // operations). |file_task_runner| should be of TYPE_IO type. |
| 70 // | 73 // |
| 71 // When |policy_service| is specified then |file_task_runner| argument is | 74 // When |policy_service| is specified then |file_task_runner| argument is |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 std::unique_ptr<policy::SchemaRegistry> owned_schema_registry_; | 147 std::unique_ptr<policy::SchemaRegistry> owned_schema_registry_; |
| 145 std::unique_ptr<policy::ConfigurationPolicyProvider> owned_policy_provider_; | 148 std::unique_ptr<policy::ConfigurationPolicyProvider> owned_policy_provider_; |
| 146 std::unique_ptr<policy::PolicyService> owned_policy_service_; | 149 std::unique_ptr<policy::PolicyService> owned_policy_service_; |
| 147 | 150 |
| 148 DISALLOW_COPY_AND_ASSIGN(PolicyWatcher); | 151 DISALLOW_COPY_AND_ASSIGN(PolicyWatcher); |
| 149 }; | 152 }; |
| 150 | 153 |
| 151 } // namespace remoting | 154 } // namespace remoting |
| 152 | 155 |
| 153 #endif // REMOTING_HOST_POLICY_WATCHER_H_ | 156 #endif // REMOTING_HOST_POLICY_WATCHER_H_ |
| OLD | NEW |