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, | |
Jamie
2012/06/14 23:43:56
Nit: Indentation.
alexeypa (please no reviews)
2012/06/19 23:27:29
Done.
| |
168 NPVariant* result); | |
169 | |
170 // Stores the user's consent to report crash dumps. The first argument | |
171 // is a boolean specifing whether the user allowed crash dump collection. | |
172 bool SetUsageStatsConsent(const NPVariant* args, | |
173 uint32_t arg_count, | |
Jamie
2012/06/14 23:43:56
Nit: Indentation.
alexeypa (please no reviews)
2012/06/19 23:27:29
Done.
| |
174 NPVariant* result); | |
175 | |
163 // Start the daemon process with the specified config. Args are: | 176 // Start the daemon process with the specified config. Args are: |
164 // string config | 177 // string config |
165 // function(number) done_callback | 178 // function(number) done_callback |
166 bool StartDaemon(const NPVariant* args, | 179 bool StartDaemon(const NPVariant* args, |
167 uint32_t arg_count, | 180 uint32_t arg_count, |
168 NPVariant* result); | 181 NPVariant* result); |
169 | 182 |
170 // Stop the daemon process. Args are: | 183 // Stop the daemon process. Args are: |
171 // function(number) done_callback | 184 // function(number) done_callback |
172 bool StopDaemon(const NPVariant* args, uint32_t arg_count, NPVariant* result); | 185 bool StopDaemon(const NPVariant* args, uint32_t arg_count, NPVariant* result); |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
233 DaemonController::AsyncResult result); | 246 DaemonController::AsyncResult result); |
234 | 247 |
235 // Callback handler for DaemonController::GetConfig(). | 248 // Callback handler for DaemonController::GetConfig(). |
236 void InvokeGetDaemonConfigCallback(const ScopedRefNPObject& callback, | 249 void InvokeGetDaemonConfigCallback(const ScopedRefNPObject& callback, |
237 scoped_ptr<base::DictionaryValue> config); | 250 scoped_ptr<base::DictionaryValue> config); |
238 | 251 |
239 // Callback handler for DaemonController::GetVersion(). | 252 // Callback handler for DaemonController::GetVersion(). |
240 void InvokeGetDaemonVersionCallback(const ScopedRefNPObject& callback, | 253 void InvokeGetDaemonVersionCallback(const ScopedRefNPObject& callback, |
241 const std::string& version); | 254 const std::string& version); |
242 | 255 |
256 // Callback handler for DaemonController::GetUsageStatsConsent(). | |
257 void InvokeGetUsageStatsConsentCallback(const ScopedRefNPObject& callback, | |
258 bool set_by_policy, | |
259 bool allowed); | |
260 | |
243 ////////////////////////////////////////////////////////// | 261 ////////////////////////////////////////////////////////// |
244 // Basic helper methods used for both It2Me and Me2me. | 262 // Basic helper methods used for both It2Me and Me2me. |
245 | 263 |
246 // Call LogDebugInfo handler if there is one. | 264 // Call LogDebugInfo handler if there is one. |
247 // This must be called on the correct thread. | 265 // This must be called on the correct thread. |
248 void LogDebugInfo(const std::string& message); | 266 void LogDebugInfo(const std::string& message); |
249 | 267 |
250 // Helper function for executing InvokeDefault on an NPObject, and ignoring | 268 // Helper function for executing InvokeDefault on an NPObject, and ignoring |
251 // the return value. | 269 // the return value. |
252 bool InvokeAndIgnoreResult(NPObject* func, | 270 bool InvokeAndIgnoreResult(NPObject* func, |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
321 // SequencedWorkerPool. Problem is that SequencedWorkerPool relies | 339 // SequencedWorkerPool. Problem is that SequencedWorkerPool relies |
322 // on MessageLoopProxy::current(). | 340 // on MessageLoopProxy::current(). |
323 base::Thread worker_thread_; | 341 base::Thread worker_thread_; |
324 | 342 |
325 DISALLOW_COPY_AND_ASSIGN(HostNPScriptObject); | 343 DISALLOW_COPY_AND_ASSIGN(HostNPScriptObject); |
326 }; | 344 }; |
327 | 345 |
328 } // namespace remoting | 346 } // namespace remoting |
329 | 347 |
330 #endif // REMOTING_HOST_PLUGIN_HOST_SCRIPT_OBJECT_H_ | 348 #endif // REMOTING_HOST_PLUGIN_HOST_SCRIPT_OBJECT_H_ |
OLD | NEW |