OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 // This implements the JavaScript class entrypoint for the plugin instance. | 5 // This implements the JavaScript class entrypoint for the plugin instance. |
6 // The Javascript API is defined as follows. | 6 // The Javascript API is defined as follows. |
7 // | 7 // |
8 // interface ChromotingScriptableObject { | 8 // interface ChromotingScriptableObject { |
9 // | 9 // |
10 // // Chromoting session API version (for this plugin). | 10 // // Chromoting session API version (for this plugin). |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 MethodHandler method; | 207 MethodHandler method; |
208 }; | 208 }; |
209 | 209 |
210 // Routines to add new attribute, method properties. | 210 // Routines to add new attribute, method properties. |
211 void AddAttribute(const std::string& name, pp::Var attribute); | 211 void AddAttribute(const std::string& name, pp::Var attribute); |
212 void AddMethod(const std::string& name, MethodHandler handler); | 212 void AddMethod(const std::string& name, MethodHandler handler); |
213 | 213 |
214 void SignalConnectionInfoChange(); | 214 void SignalConnectionInfoChange(); |
215 void SignalDesktopSizeChange(); | 215 void SignalDesktopSizeChange(); |
216 | 216 |
217 // Calls to these methods are posted to the plugin thread from | 217 // Calls to these methods are posted to the plugin thread so that we |
218 // corresponding Signal*() methods. They actually call JavaScript | 218 // call JavaScript with clean stack. This is necessary because |
219 // code. This is necessary becase JavaScript needs to be called with | 219 // JavaScript event handlers may destroy the plugin. |
220 // clean stack - JavaScript event handlers may destroy the plugin. | |
221 void DoSignalConnectionInfoChange(); | 220 void DoSignalConnectionInfoChange(); |
222 void DoSignalDesktopSizeChange(); | 221 void DoSignalDesktopSizeChange(); |
223 void DoSignalLoginChallenge(); | 222 void DoSignalLoginChallenge(); |
| 223 void DoSendIq(const std::string& message_xml); |
224 | 224 |
225 pp::Var DoConnect(const std::vector<pp::Var>& args, pp::Var* exception); | 225 pp::Var DoConnect(const std::vector<pp::Var>& args, pp::Var* exception); |
226 pp::Var DoDisconnect(const std::vector<pp::Var>& args, pp::Var* exception); | 226 pp::Var DoDisconnect(const std::vector<pp::Var>& args, pp::Var* exception); |
227 | 227 |
228 // This method is called by JS to provide login information. | 228 // This method is called by JS to provide login information. |
229 pp::Var DoSubmitLogin(const std::vector<pp::Var>& args, pp::Var* exception); | 229 pp::Var DoSubmitLogin(const std::vector<pp::Var>& args, pp::Var* exception); |
230 | 230 |
231 // This method is called by JS to set scale-to-fit. | 231 // This method is called by JS to set scale-to-fit. |
232 pp::Var DoSetScaleToFit(const std::vector<pp::Var>& args, pp::Var* exception); | 232 pp::Var DoSetScaleToFit(const std::vector<pp::Var>& args, pp::Var* exception); |
233 | 233 |
(...skipping 14 matching lines...) Expand all Loading... |
248 | 248 |
249 scoped_refptr<base::MessageLoopProxy> plugin_message_loop_; | 249 scoped_refptr<base::MessageLoopProxy> plugin_message_loop_; |
250 ScopedRunnableMethodFactory<ChromotingScriptableObject> task_factory_; | 250 ScopedRunnableMethodFactory<ChromotingScriptableObject> task_factory_; |
251 | 251 |
252 DISALLOW_COPY_AND_ASSIGN(ChromotingScriptableObject); | 252 DISALLOW_COPY_AND_ASSIGN(ChromotingScriptableObject); |
253 }; | 253 }; |
254 | 254 |
255 } // namespace remoting | 255 } // namespace remoting |
256 | 256 |
257 #endif // REMOTING_CLIENT_PLUGIN_CHROMOTING_SCRIPTABLE_OBJECT_H_ | 257 #endif // REMOTING_CLIENT_PLUGIN_CHROMOTING_SCRIPTABLE_OBJECT_H_ |
OLD | NEW |