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 // // Dimension of the desktop area. | 10 // // Dimension of the desktop area. |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 70 // // This function will be called multiple times until login was successful | 70 // // This function will be called multiple times until login was successful |
| 71 // // or the maximum number of login attempts has been reached. In the | 71 // // or the maximum number of login attempts has been reached. In the |
| 72 // // later case |connection_status| is changed to STATUS_FAILED. | 72 // // later case |connection_status| is changed to STATUS_FAILED. |
| 73 // attribute Function loginChallenge; | 73 // attribute Function loginChallenge; |
| 74 // | 74 // |
| 75 // // Methods for establishing a Chromoting connection. | 75 // // Methods for establishing a Chromoting connection. |
| 76 // // | 76 // // |
| 77 // // Either use connect() or connectSandboxed(), not both. If using | 77 // // Either use connect() or connectSandboxed(), not both. If using |
| 78 // // connectSandboxed(), sendIq must be set, and responses to calls on | 78 // // connectSandboxed(), sendIq must be set, and responses to calls on |
| 79 // // sendIq must be piped back into onIq(). | 79 // // sendIq must be piped back into onIq(). |
| 80 // void connect(string username, string host_jid, string auth_token, | 80 // void connect(string username, string host_jid, string auth_token); |
| 81 // string nonce); | 81 // void connectNonce(string username, string host_jid, string auth_token, |
|
Jamie
2011/05/19 00:16:52
Can you clean up some of the terminology to refer
garykac
2011/05/20 01:33:02
Switched to using |access_code|.
| |
| 82 // void connectSandboxed(string your_jid, string host_jid, string nonce); | 82 // string nonce); |
| 83 // void connectSandboxed(string your_jid, string host_jid); | |
| 84 // void connectSandboxedNonce(string your_jid, string host_jid, string nonce); | |
| 83 // void disconnect(); | 85 // void disconnect(); |
| 84 // | 86 // |
| 85 // // Method for submitting login information. | 87 // // Method for submitting login information. |
| 86 // void submitLoginInfo(string username, string password); | 88 // void submitLoginInfo(string username, string password); |
| 87 // | 89 // |
| 88 // // Method for setting scale-to-fit. | 90 // // Method for setting scale-to-fit. |
| 89 // void setScaleToFit(bool scale_to_fit); | 91 // void setScaleToFit(bool scale_to_fit); |
| 90 // } | 92 // } |
| 91 | 93 |
| 92 #ifndef REMOTING_CLIENT_PLUGIN_CHROMOTING_SCRIPTABLE_OBJECT_H_ | 94 #ifndef REMOTING_CLIENT_PLUGIN_CHROMOTING_SCRIPTABLE_OBJECT_H_ |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 186 void AddMethod(const std::string& name, MethodHandler handler); | 188 void AddMethod(const std::string& name, MethodHandler handler); |
| 187 | 189 |
| 188 // This should be called to signal the JS code that the connection status has | 190 // This should be called to signal the JS code that the connection status has |
| 189 // changed. | 191 // changed. |
| 190 void SignalConnectionInfoChange(); | 192 void SignalConnectionInfoChange(); |
| 191 | 193 |
| 192 // Signal the JS code that the desktop size has changed. | 194 // Signal the JS code that the desktop size has changed. |
| 193 void SignalDesktopSizeChange(); | 195 void SignalDesktopSizeChange(); |
| 194 | 196 |
| 195 pp::Var DoConnect(const std::vector<pp::Var>& args, pp::Var* exception); | 197 pp::Var DoConnect(const std::vector<pp::Var>& args, pp::Var* exception); |
| 198 pp::Var DoConnectNonce(const std::vector<pp::Var>& args, pp::Var* exception); | |
| 199 pp::Var DoConnect_(const std::vector<pp::Var>& args, | |
|
awong
2011/05/19 00:13:31
This trailing _ seems odd. Can we rename it somet
garykac
2011/05/20 01:33:02
Oh sure, Jamie can get away with naming things lik
| |
| 200 pp::Var* exception, | |
| 201 bool require_nonce); | |
| 202 | |
| 196 pp::Var DoConnectSandboxed(const std::vector<pp::Var>& args, | 203 pp::Var DoConnectSandboxed(const std::vector<pp::Var>& args, |
| 197 pp::Var* exception); | 204 pp::Var* exception); |
| 205 pp::Var DoConnectSandboxedNonce(const std::vector<pp::Var>& args, | |
| 206 pp::Var* exception); | |
| 207 pp::Var DoConnectSandboxed_(const std::vector<pp::Var>& args, | |
|
awong
2011/05/19 00:13:31
Same here. Also indentation.
garykac
2011/05/20 01:33:02
Done.
| |
| 208 pp::Var* exception, | |
| 209 bool require_nonce); | |
| 210 | |
| 198 pp::Var DoDisconnect(const std::vector<pp::Var>& args, pp::Var* exception); | 211 pp::Var DoDisconnect(const std::vector<pp::Var>& args, pp::Var* exception); |
| 199 | 212 |
| 200 // This method is called by JS to provide login information. | 213 // This method is called by JS to provide login information. |
| 201 pp::Var DoSubmitLogin(const std::vector<pp::Var>& args, pp::Var* exception); | 214 pp::Var DoSubmitLogin(const std::vector<pp::Var>& args, pp::Var* exception); |
| 202 | 215 |
| 203 // This method is called by JS to set scale-to-fit. | 216 // This method is called by JS to set scale-to-fit. |
| 204 pp::Var DoSetScaleToFit(const std::vector<pp::Var>& args, pp::Var* exception); | 217 pp::Var DoSetScaleToFit(const std::vector<pp::Var>& args, pp::Var* exception); |
| 205 | 218 |
| 206 // This method is caleld by Javascript to provide responses to sendIq() | 219 // This method is caleld by Javascript to provide responses to sendIq() |
| 207 // requests when establishing a sandboxed Chromoting connection. | 220 // requests when establishing a sandboxed Chromoting connection. |
| 208 pp::Var DoOnIq(const std::vector<pp::Var>& args, pp::Var* exception); | 221 pp::Var DoOnIq(const std::vector<pp::Var>& args, pp::Var* exception); |
| 209 | 222 |
| 210 PropertyNameMap property_names_; | 223 PropertyNameMap property_names_; |
| 211 std::vector<PropertyDescriptor> properties_; | 224 std::vector<PropertyDescriptor> properties_; |
| 212 scoped_refptr<PepperXmppProxy> xmpp_proxy_; | 225 scoped_refptr<PepperXmppProxy> xmpp_proxy_; |
| 213 | 226 |
| 214 ChromotingInstance* instance_; | 227 ChromotingInstance* instance_; |
| 215 }; | 228 }; |
| 216 | 229 |
| 217 } // namespace remoting | 230 } // namespace remoting |
| 218 | 231 |
| 219 #endif // REMOTING_CLIENT_PLUGIN_CHROMOTING_SCRIPTABLE_OBJECT_H_ | 232 #endif // REMOTING_CLIENT_PLUGIN_CHROMOTING_SCRIPTABLE_OBJECT_H_ |
| OLD | NEW |