| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 /** | 5 /** |
| 6 * @fileoverview | 6 * @fileoverview |
| 7 * Class to communicate with the It2me Host component via Native Messaging. | 7 * Class to communicate with the It2me Host component via Native Messaging. |
| 8 */ | 8 */ |
| 9 | 9 |
| 10 /** @suppress {duplicate} */ | 10 /** @suppress {duplicate} */ |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 | 45 |
| 46 /** | 46 /** |
| 47 * Called if Native Messaging host has failed to start. | 47 * Called if Native Messaging host has failed to start. |
| 48 * @private | 48 * @private |
| 49 * */ | 49 * */ |
| 50 this.onInitializationFailed_ = function() {}; | 50 this.onInitializationFailed_ = function() {}; |
| 51 | 51 |
| 52 /** | 52 /** |
| 53 * Called if the It2Me Native Messaging host sends a malformed message: | 53 * Called if the It2Me Native Messaging host sends a malformed message: |
| 54 * missing required attributes, attributes with incorrect types, etc. | 54 * missing required attributes, attributes with incorrect types, etc. |
| 55 * @private {?function(remoting.Error):void} | 55 * @private {?function(!remoting.Error):void} |
| 56 */ | 56 */ |
| 57 this.onError_ = function(error) {}; | 57 this.onError_ = function(error) {}; |
| 58 | 58 |
| 59 /** @private {?function(remoting.HostSession.State):void} */ | 59 /** @private {?function(remoting.HostSession.State):void} */ |
| 60 this.onStateChanged_ = function() {}; | 60 this.onStateChanged_ = function() {}; |
| 61 | 61 |
| 62 /** @private {?function(boolean):void} */ | 62 /** @private {?function(boolean):void} */ |
| 63 this.onNatPolicyChanged_ = function() {}; | 63 this.onNatPolicyChanged_ = function() {}; |
| 64 }; | 64 }; |
| 65 | 65 |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 * @param {function(boolean):void} onNatPolicyChanged Callback to invoke when | 114 * @param {function(boolean):void} onNatPolicyChanged Callback to invoke when |
| 115 * the nat traversal policy changes. | 115 * the nat traversal policy changes. |
| 116 * @param {function(string):void} logDebugInfo Callback allowing the plugin | 116 * @param {function(string):void} logDebugInfo Callback allowing the plugin |
| 117 * to log messages to the debug log. | 117 * to log messages to the debug log. |
| 118 * @param {string} xmppServerAddress XMPP server host name (or IP address) and | 118 * @param {string} xmppServerAddress XMPP server host name (or IP address) and |
| 119 * port. | 119 * port. |
| 120 * @param {boolean} xmppServerUseTls Whether to use TLS on connections to the | 120 * @param {boolean} xmppServerUseTls Whether to use TLS on connections to the |
| 121 * XMPP server | 121 * XMPP server |
| 122 * @param {string} directoryBotJid XMPP JID for the remoting directory server | 122 * @param {string} directoryBotJid XMPP JID for the remoting directory server |
| 123 * bot. | 123 * bot. |
| 124 * @param {function(remoting.Error):void} onError Callback to invoke in case of | 124 * @param {function(!remoting.Error):void} onError Callback to invoke in case of |
| 125 * an error. | 125 * an error. |
| 126 * @return {void} | 126 * @return {void} |
| 127 */ | 127 */ |
| 128 remoting.It2MeHostFacade.prototype.connect = | 128 remoting.It2MeHostFacade.prototype.connect = |
| 129 function(email, authServiceWithToken, onStateChanged, onNatPolicyChanged, | 129 function(email, authServiceWithToken, onStateChanged, onNatPolicyChanged, |
| 130 logDebugInfo, xmppServerAddress, xmppServerUseTls, directoryBotJid, | 130 logDebugInfo, xmppServerAddress, xmppServerUseTls, directoryBotJid, |
| 131 onError) { | 131 onError) { |
| 132 if (!this.port_) { | 132 if (!this.port_) { |
| 133 console.error( | 133 console.error( |
| 134 'remoting.It2MeHostFacade.connect() without initialization.'); | 134 'remoting.It2MeHostFacade.connect() without initialization.'); |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 314 chrome.runtime.lastError.message); | 314 chrome.runtime.lastError.message); |
| 315 this.onInitializationFailed_(); | 315 this.onInitializationFailed_(); |
| 316 } else { | 316 } else { |
| 317 console.error('Native Messaging port disconnected.'); | 317 console.error('Native Messaging port disconnected.'); |
| 318 this.port_ = null; | 318 this.port_ = null; |
| 319 this.onError_(remoting.Error.UNEXPECTED); | 319 this.onError_(remoting.Error.UNEXPECTED); |
| 320 } | 320 } |
| 321 }; | 321 }; |
| 322 | 322 |
| 323 })(); | 323 })(); |
| OLD | NEW |