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 REMOTING_HOST_PLUGIN_HOST_SCRIPT_OBJECT_H_ | 5 #ifndef REMOTING_HOST_PLUGIN_HOST_SCRIPT_OBJECT_H_ |
6 #define REMOTING_HOST_PLUGIN_HOST_SCRIPT_OBJECT_H_ | 6 #define REMOTING_HOST_PLUGIN_HOST_SCRIPT_OBJECT_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 NPVariant* result); | 146 NPVariant* result); |
147 | 147 |
148 // Loads daemon config config. The first argument specifies the | 148 // Loads daemon config config. The first argument specifies the |
149 // callback to be called with the config is loaded. The config is | 149 // callback to be called with the config is loaded. The config is |
150 // returned as a JSON formatted string. Args are: | 150 // returned as a JSON formatted string. Args are: |
151 // function(string) callback | 151 // function(string) callback |
152 bool GetDaemonConfig(const NPVariant* args, | 152 bool GetDaemonConfig(const NPVariant* args, |
153 uint32_t arg_count, | 153 uint32_t arg_count, |
154 NPVariant* result); | 154 NPVariant* result); |
155 | 155 |
156 // Loads daemon config version. The first argument specifies the | 156 // Retrieves daemon config version. The first argument specifies the |
157 // callback to be called with the config is loaded. The version is | 157 // callback to be called with the obtained version. The version is |
158 // returned as a dotted version string, described in daemon_controller.h. | 158 // returned as a dotted version string, described in daemon_controller.h. |
159 bool GetDaemonVersion(const NPVariant* args, | 159 bool GetDaemonVersion(const NPVariant* args, |
160 uint32_t arg_count, | 160 uint32_t arg_count, |
161 NPVariant* result); | 161 NPVariant* result); |
162 | 162 |
| 163 // Retrieves the user's consent to report crash dumps. The first argument |
| 164 // specifies the callback to be called with the recorder consent. Possible |
| 165 // consent codes are defined in remoting/host/breakpad.h. |
| 166 bool GetUsageStatsConsent(const NPVariant* args, |
| 167 uint32_t arg_count, |
| 168 NPVariant* result); |
| 169 |
163 // Start the daemon process with the specified config. Args are: | 170 // Start the daemon process with the specified config. Args are: |
164 // string config | 171 // string config |
165 // function(number) done_callback | 172 // function(number) done_callback |
166 bool StartDaemon(const NPVariant* args, | 173 bool StartDaemon(const NPVariant* args, |
167 uint32_t arg_count, | 174 uint32_t arg_count, |
168 NPVariant* result); | 175 NPVariant* result); |
169 | 176 |
170 // Stop the daemon process. Args are: | 177 // Stop the daemon process. Args are: |
171 // function(number) done_callback | 178 // function(number) done_callback |
172 bool StopDaemon(const NPVariant* args, uint32_t arg_count, NPVariant* result); | 179 bool StopDaemon(const NPVariant* args, uint32_t arg_count, NPVariant* result); |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 ////////////////////////////////////////////////////////// | 227 ////////////////////////////////////////////////////////// |
221 // Helper methods for Me2Me host. | 228 // Helper methods for Me2Me host. |
222 | 229 |
223 // Helpers for GenerateKeyPair(). | 230 // Helpers for GenerateKeyPair(). |
224 void DoGenerateKeyPair(const ScopedRefNPObject& callback); | 231 void DoGenerateKeyPair(const ScopedRefNPObject& callback); |
225 void InvokeGenerateKeyPairCallback(const ScopedRefNPObject& callback, | 232 void InvokeGenerateKeyPairCallback(const ScopedRefNPObject& callback, |
226 const std::string& private_key, | 233 const std::string& private_key, |
227 const std::string& public_key); | 234 const std::string& public_key); |
228 | 235 |
229 | 236 |
230 // Callback handler for SetConfigAndStart(), Stop() and SetPin() in | 237 // Callback handler for SetConfigAndStart(), Stop(), SetPin() and |
231 // DaemonController. | 238 // SetUsageStatsConsent() in DaemonController. |
232 void InvokeAsyncResultCallback(const ScopedRefNPObject& callback, | 239 void InvokeAsyncResultCallback(const ScopedRefNPObject& callback, |
233 DaemonController::AsyncResult result); | 240 DaemonController::AsyncResult result); |
234 | 241 |
235 // Callback handler for DaemonController::GetConfig(). | 242 // Callback handler for DaemonController::GetConfig(). |
236 void InvokeGetDaemonConfigCallback(const ScopedRefNPObject& callback, | 243 void InvokeGetDaemonConfigCallback(const ScopedRefNPObject& callback, |
237 scoped_ptr<base::DictionaryValue> config); | 244 scoped_ptr<base::DictionaryValue> config); |
238 | 245 |
239 // Callback handler for DaemonController::GetVersion(). | 246 // Callback handler for DaemonController::GetVersion(). |
240 void InvokeGetDaemonVersionCallback(const ScopedRefNPObject& callback, | 247 void InvokeGetDaemonVersionCallback(const ScopedRefNPObject& callback, |
241 const std::string& version); | 248 const std::string& version); |
242 | 249 |
| 250 // Callback handler for DaemonController::GetUsageStatsConsent(). |
| 251 void InvokeGetUsageStatsConsentCallback(const ScopedRefNPObject& callback, |
| 252 bool supported, |
| 253 bool allowed, |
| 254 bool set_by_policy); |
| 255 |
243 ////////////////////////////////////////////////////////// | 256 ////////////////////////////////////////////////////////// |
244 // Basic helper methods used for both It2Me and Me2me. | 257 // Basic helper methods used for both It2Me and Me2me. |
245 | 258 |
246 // Call LogDebugInfo handler if there is one. | 259 // Call LogDebugInfo handler if there is one. |
247 // This must be called on the correct thread. | 260 // This must be called on the correct thread. |
248 void LogDebugInfo(const std::string& message); | 261 void LogDebugInfo(const std::string& message); |
249 | 262 |
250 // Helper function for executing InvokeDefault on an NPObject, and ignoring | 263 // Helper function for executing InvokeDefault on an NPObject, and ignoring |
251 // the return value. | 264 // the return value. |
252 bool InvokeAndIgnoreResult(NPObject* func, | 265 bool InvokeAndIgnoreResult(NPObject* func, |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
321 // SequencedWorkerPool. Problem is that SequencedWorkerPool relies | 334 // SequencedWorkerPool. Problem is that SequencedWorkerPool relies |
322 // on MessageLoopProxy::current(). | 335 // on MessageLoopProxy::current(). |
323 base::Thread worker_thread_; | 336 base::Thread worker_thread_; |
324 | 337 |
325 DISALLOW_COPY_AND_ASSIGN(HostNPScriptObject); | 338 DISALLOW_COPY_AND_ASSIGN(HostNPScriptObject); |
326 }; | 339 }; |
327 | 340 |
328 } // namespace remoting | 341 } // namespace remoting |
329 | 342 |
330 #endif // REMOTING_HOST_PLUGIN_HOST_SCRIPT_OBJECT_H_ | 343 #endif // REMOTING_HOST_PLUGIN_HOST_SCRIPT_OBJECT_H_ |
OLD | NEW |