OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 * Functions related to the 'client screen' for Chromoting. | 7 * Functions related to the 'client screen' for Chromoting. |
8 */ | 8 */ |
9 | 9 |
10 'use strict'; | 10 'use strict'; |
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
349 * @param {string} sharedSecret | 349 * @param {string} sharedSecret |
350 */ | 350 */ |
351 var onPairingComplete = function(clientId, sharedSecret) { | 351 var onPairingComplete = function(clientId, sharedSecret) { |
352 var pairingInfo = { | 352 var pairingInfo = { |
353 pairingInfo: { | 353 pairingInfo: { |
354 clientId: clientId, | 354 clientId: clientId, |
355 sharedSecret: sharedSecret | 355 sharedSecret: sharedSecret |
356 } | 356 } |
357 }; | 357 }; |
358 remoting.HostSettings.save(clientSession.hostId, pairingInfo); | 358 remoting.HostSettings.save(clientSession.hostId, pairingInfo); |
| 359 remoting.connector.updatePairingInfo(clientId, sharedSecret); |
359 }; | 360 }; |
360 // Use the platform name as a proxy for the local computer name. | 361 // Use the platform name as a proxy for the local computer name. |
361 // TODO(jamiewalch): Use a descriptive name for the local computer, for | 362 // TODO(jamiewalch): Use a descriptive name for the local computer, for |
362 // example, its Chrome Sync name. | 363 // example, its Chrome Sync name. |
363 var clientName = ''; | 364 var clientName = ''; |
364 if (navigator.platform.indexOf('Mac') != -1) { | 365 if (navigator.platform.indexOf('Mac') != -1) { |
365 clientName = 'Mac'; | 366 clientName = 'Mac'; |
366 } else if (navigator.platform.indexOf('Win32') != -1) { | 367 } else if (navigator.platform.indexOf('Win32') != -1) { |
367 clientName = 'Windows'; | 368 clientName = 'Windows'; |
368 } else if (navigator.userAgent.match(/\bCrOS\b/)) { | 369 } else if (navigator.userAgent.match(/\bCrOS\b/)) { |
369 clientName = 'ChromeOS'; | 370 clientName = 'ChromeOS'; |
370 } else if (navigator.platform.indexOf('Linux') != -1) { | 371 } else if (navigator.platform.indexOf('Linux') != -1) { |
371 clientName = 'Linux'; | 372 clientName = 'Linux'; |
372 } else { | 373 } else { |
373 console.log('Unrecognized client platform. Using navigator.platform.'); | 374 console.log('Unrecognized client platform. Using navigator.platform.'); |
374 clientName = navigator.platform; | 375 clientName = navigator.platform; |
375 } | 376 } |
376 clientSession.requestPairing(clientName, onPairingComplete); | 377 clientSession.requestPairing(clientName, onPairingComplete); |
377 } | 378 } |
378 }; | 379 }; |
OLD | NEW |