OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 * Connect set-up state machine for Me2Me and IT2Me | 7 * Connect set-up state machine for Me2Me and IT2Me |
8 */ | 8 */ |
9 | 9 |
10 'use strict'; | 10 'use strict'; |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 * @param {string} clientPairedSecret The shared secret issued by the host when | 134 * @param {string} clientPairedSecret The shared secret issued by the host when |
135 * this device was paired, if it is already paired. | 135 * this device was paired, if it is already paired. |
136 * @return {void} Nothing. | 136 * @return {void} Nothing. |
137 */ | 137 */ |
138 remoting.SessionConnectorImpl.prototype.connectMe2Me = | 138 remoting.SessionConnectorImpl.prototype.connectMe2Me = |
139 function(host, fetchPin, fetchThirdPartyToken, | 139 function(host, fetchPin, fetchThirdPartyToken, |
140 clientPairingId, clientPairedSecret) { | 140 clientPairingId, clientPairedSecret) { |
141 this.logHostOfflineErrors_ = false; | 141 this.logHostOfflineErrors_ = false; |
142 var credentialsProvider = new remoting.CredentialsProvider({ | 142 var credentialsProvider = new remoting.CredentialsProvider({ |
143 fetchPin: fetchPin, | 143 fetchPin: fetchPin, |
144 pairingInfo: { id: clientPairingId, secret: clientPairedSecret }, | 144 pairingInfo: {clientId: clientPairingId, sharedSecret: clientPairedSecret}, |
145 fetchThirdPartyToken: fetchThirdPartyToken | 145 fetchThirdPartyToken: fetchThirdPartyToken |
146 }); | 146 }); |
147 this.connect( | 147 this.connect( |
148 remoting.DesktopConnectedView.Mode.ME2ME, host, credentialsProvider); | 148 remoting.DesktopConnectedView.Mode.ME2ME, host, credentialsProvider); |
149 }; | 149 }; |
150 | 150 |
151 /** | 151 /** |
152 * Retry connecting to a Me2Me host after a connection failure. | 152 * Retry connecting to a Me2Me host after a connection failure. |
153 * | 153 * |
154 * This is the same as connectMe2Me except that is will log errors if the | 154 * This is the same as connectMe2Me except that is will log errors if the |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 | 187 |
188 /** | 188 /** |
189 * Update the pairing info so that the reconnect function will work correctly. | 189 * Update the pairing info so that the reconnect function will work correctly. |
190 * | 190 * |
191 * @param {string} clientId The paired client id. | 191 * @param {string} clientId The paired client id. |
192 * @param {string} sharedSecret The shared secret. | 192 * @param {string} sharedSecret The shared secret. |
193 */ | 193 */ |
194 remoting.SessionConnectorImpl.prototype.updatePairingInfo = | 194 remoting.SessionConnectorImpl.prototype.updatePairingInfo = |
195 function(clientId, sharedSecret) { | 195 function(clientId, sharedSecret) { |
196 var pairingInfo = this.credentialsProvider_.getPairingInfo(); | 196 var pairingInfo = this.credentialsProvider_.getPairingInfo(); |
197 pairingInfo.id = clientId; | 197 pairingInfo.clientId = clientId; |
198 pairingInfo.secret = sharedSecret; | 198 pairingInfo.sharedSecret = sharedSecret; |
199 }; | 199 }; |
200 | 200 |
201 /** | 201 /** |
202 * Initiates a connection. | 202 * Initiates a connection. |
203 * | 203 * |
204 * @param {remoting.DesktopConnectedView.Mode} mode | 204 * @param {remoting.DesktopConnectedView.Mode} mode |
205 * @param {remoting.Host} host the Host to connect to. | 205 * @param {remoting.Host} host the Host to connect to. |
206 * @param {remoting.CredentialsProvider} credentialsProvider | 206 * @param {remoting.CredentialsProvider} credentialsProvider |
207 * @return {void} Nothing. | 207 * @return {void} Nothing. |
208 * @private | 208 * @private |
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
554 function(clientContainer, onConnected, onError, | 554 function(clientContainer, onConnected, onError, |
555 appProtocolExtensionHandler, | 555 appProtocolExtensionHandler, |
556 onConnectionFailed, requiredCapabilities, defaultRemapKeys) { | 556 onConnectionFailed, requiredCapabilities, defaultRemapKeys) { |
557 return new remoting.SessionConnectorImpl(clientContainer, onConnected, | 557 return new remoting.SessionConnectorImpl(clientContainer, onConnected, |
558 onError, | 558 onError, |
559 appProtocolExtensionHandler, | 559 appProtocolExtensionHandler, |
560 onConnectionFailed, | 560 onConnectionFailed, |
561 requiredCapabilities, | 561 requiredCapabilities, |
562 defaultRemapKeys); | 562 defaultRemapKeys); |
563 }; | 563 }; |
OLD | NEW |