| 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 * This class implements the functionality that is specific to desktop | 7 * This class implements the functionality that is specific to desktop |
| 8 * remoting ("Chromoting" or CRD). | 8 * remoting ("Chromoting" or CRD). |
| 9 */ | 9 */ |
| 10 | 10 |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 202 sessionConnector.registerProtocolExtension( | 202 sessionConnector.registerProtocolExtension( |
| 203 new remoting.GnubbyAuthHandler()); | 203 new remoting.GnubbyAuthHandler()); |
| 204 } | 204 } |
| 205 | 205 |
| 206 if (remoting.pairingRequested) { | 206 if (remoting.pairingRequested) { |
| 207 /** | 207 /** |
| 208 * @param {string} clientId | 208 * @param {string} clientId |
| 209 * @param {string} sharedSecret | 209 * @param {string} sharedSecret |
| 210 */ | 210 */ |
| 211 var onPairingComplete = function(clientId, sharedSecret) { | 211 var onPairingComplete = function(clientId, sharedSecret) { |
| 212 var pairingInfo = { | |
| 213 pairingInfo: { | |
| 214 clientId: clientId, | |
| 215 sharedSecret: sharedSecret | |
| 216 } | |
| 217 }; | |
| 218 var connector = remoting.app.getSessionConnector(); | 212 var connector = remoting.app.getSessionConnector(); |
| 219 remoting.HostSettings.save(connector.getHostId(), pairingInfo); | 213 var host = remoting.hostList.getHostForId(connector.getHostId()); |
| 214 host.options.pairingInfo.clientId = clientId; |
| 215 host.options.pairingInfo.sharedSecret = sharedSecret; |
| 216 host.options.save(); |
| 220 connector.updatePairingInfo(clientId, sharedSecret); | 217 connector.updatePairingInfo(clientId, sharedSecret); |
| 221 }; | 218 }; |
| 222 // Use the platform name as a proxy for the local computer name. | 219 // Use the platform name as a proxy for the local computer name. |
| 223 // TODO(jamiewalch): Use a descriptive name for the local computer, for | 220 // TODO(jamiewalch): Use a descriptive name for the local computer, for |
| 224 // example, its Chrome Sync name. | 221 // example, its Chrome Sync name. |
| 225 var clientName = ''; | 222 var clientName = ''; |
| 226 if (remoting.platformIsMac()) { | 223 if (remoting.platformIsMac()) { |
| 227 clientName = 'Mac'; | 224 clientName = 'Mac'; |
| 228 } else if (remoting.platformIsWindows()) { | 225 } else if (remoting.platformIsWindows()) { |
| 229 clientName = 'Windows'; | 226 clientName = 'Windows'; |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 335 } else { | 332 } else { |
| 336 remoting.setMode(remoting.AppMode.CLIENT_CONNECT_FAILED_ME2ME); | 333 remoting.setMode(remoting.AppMode.CLIENT_CONNECT_FAILED_ME2ME); |
| 337 } | 334 } |
| 338 }; | 335 }; |
| 339 | 336 |
| 340 /** | 337 /** |
| 341 * No cleanup required for desktop remoting. | 338 * No cleanup required for desktop remoting. |
| 342 */ | 339 */ |
| 343 remoting.DesktopRemoting.prototype.handleExit = function() { | 340 remoting.DesktopRemoting.prototype.handleExit = function() { |
| 344 }; | 341 }; |
| OLD | NEW |