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 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
421 */ | 421 */ |
422 remoting.SessionConnectorImpl.prototype.onIT2MeHostInfo_ = function(xhr) { | 422 remoting.SessionConnectorImpl.prototype.onIT2MeHostInfo_ = function(xhr) { |
423 this.pendingXhr_ = null; | 423 this.pendingXhr_ = null; |
424 if (xhr.status == 200) { | 424 if (xhr.status == 200) { |
425 var host = /** @type {{data: {jabberId: string, publicKey: string}}} */ | 425 var host = /** @type {{data: {jabberId: string, publicKey: string}}} */ |
426 jsonParseSafe(xhr.responseText); | 426 jsonParseSafe(xhr.responseText); |
427 if (host && host.data && host.data.jabberId && host.data.publicKey) { | 427 if (host && host.data && host.data.jabberId && host.data.publicKey) { |
428 this.hostJid_ = host.data.jabberId; | 428 this.hostJid_ = host.data.jabberId; |
429 this.hostPublicKey_ = host.data.publicKey; | 429 this.hostPublicKey_ = host.data.publicKey; |
430 this.hostDisplayName_ = this.hostJid_.split('/')[0]; | 430 this.hostDisplayName_ = this.hostJid_.split('/')[0]; |
431 this.createSession_(); | 431 this.connectSignaling_(); |
432 return; | 432 return; |
433 } else { | 433 } else { |
434 console.error('Invalid "support-hosts" response from server.'); | 434 console.error('Invalid "support-hosts" response from server.'); |
435 } | 435 } |
436 } else { | 436 } else { |
437 this.onError_(this.translateSupportHostsError_(xhr.status)); | 437 this.onError_(this.translateSupportHostsError_(xhr.status)); |
438 } | 438 } |
439 }; | 439 }; |
440 | 440 |
441 /** | 441 /** |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
603 * @param {function(remoting.Error):void} onError Callback on error. | 603 * @param {function(remoting.Error):void} onError Callback on error. |
604 * @param {function(string, string):boolean} onExtensionMessage The handler for | 604 * @param {function(string, string):boolean} onExtensionMessage The handler for |
605 * protocol extension messages. Returns true if a message is recognized; | 605 * protocol extension messages. Returns true if a message is recognized; |
606 * false otherwise. | 606 * false otherwise. |
607 */ | 607 */ |
608 remoting.DefaultSessionConnectorFactory.prototype.createConnector = | 608 remoting.DefaultSessionConnectorFactory.prototype.createConnector = |
609 function(clientContainer, onConnected, onError, onExtensionMessage) { | 609 function(clientContainer, onConnected, onError, onExtensionMessage) { |
610 return new remoting.SessionConnectorImpl( | 610 return new remoting.SessionConnectorImpl( |
611 clientContainer, onConnected, onError, onExtensionMessage); | 611 clientContainer, onConnected, onError, onExtensionMessage); |
612 }; | 612 }; |
OLD | NEW |