Chromium Code Reviews| 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. They |
| 218 // corresponding Signal*() methods. They actually call JavaScript | 218 // actually call JavaScript code. This is necessary becase |
| 219 // code. This is necessary becase JavaScript needs to be called with | 219 // JavaScript needs to be called with clean stack - JavaScript event |
| 220 // clean stack - JavaScript event handlers may destroy the plugin. | 220 // handlers may destroy the plugin. |
|
Wez
2011/08/24 20:44:45
This comment says something is necessary, but does
Sergey Ulanov
2011/08/24 22:42:22
Done.
| |
| 221 void DoSignalConnectionInfoChange(); | 221 void DoSignalConnectionInfoChange(); |
| 222 void DoSignalDesktopSizeChange(); | 222 void DoSignalDesktopSizeChange(); |
| 223 void DoSignalLoginChallenge(); | 223 void DoSignalLoginChallenge(); |
| 224 void DoSendIq(const std::string& message_xml); | |
| 224 | 225 |
| 225 pp::Var DoConnect(const std::vector<pp::Var>& args, pp::Var* exception); | 226 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); | 227 pp::Var DoDisconnect(const std::vector<pp::Var>& args, pp::Var* exception); |
| 227 | 228 |
| 228 // This method is called by JS to provide login information. | 229 // This method is called by JS to provide login information. |
| 229 pp::Var DoSubmitLogin(const std::vector<pp::Var>& args, pp::Var* exception); | 230 pp::Var DoSubmitLogin(const std::vector<pp::Var>& args, pp::Var* exception); |
| 230 | 231 |
| 231 // This method is called by JS to set scale-to-fit. | 232 // This method is called by JS to set scale-to-fit. |
| 232 pp::Var DoSetScaleToFit(const std::vector<pp::Var>& args, pp::Var* exception); | 233 pp::Var DoSetScaleToFit(const std::vector<pp::Var>& args, pp::Var* exception); |
| 233 | 234 |
| (...skipping 14 matching lines...) Expand all Loading... | |
| 248 | 249 |
| 249 scoped_refptr<base::MessageLoopProxy> plugin_message_loop_; | 250 scoped_refptr<base::MessageLoopProxy> plugin_message_loop_; |
| 250 ScopedRunnableMethodFactory<ChromotingScriptableObject> task_factory_; | 251 ScopedRunnableMethodFactory<ChromotingScriptableObject> task_factory_; |
| 251 | 252 |
| 252 DISALLOW_COPY_AND_ASSIGN(ChromotingScriptableObject); | 253 DISALLOW_COPY_AND_ASSIGN(ChromotingScriptableObject); |
| 253 }; | 254 }; |
| 254 | 255 |
| 255 } // namespace remoting | 256 } // namespace remoting |
| 256 | 257 |
| 257 #endif // REMOTING_CLIENT_PLUGIN_CHROMOTING_SCRIPTABLE_OBJECT_H_ | 258 #endif // REMOTING_CLIENT_PLUGIN_CHROMOTING_SCRIPTABLE_OBJECT_H_ |
| OLD | NEW |