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 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
430 * @return {void} Nothing. | 430 * @return {void} Nothing. |
431 * @private | 431 * @private |
432 */ | 432 */ |
433 remoting.SessionConnectorImpl.prototype.connectIT2MeWithToken_ = | 433 remoting.SessionConnectorImpl.prototype.connectIT2MeWithToken_ = |
434 function(hostId, token) { | 434 function(hostId, token) { |
435 // Resolve the host id to get the host JID. | 435 // Resolve the host id to get the host JID. |
436 this.pendingXhr_ = remoting.xhr.start({ | 436 this.pendingXhr_ = remoting.xhr.start({ |
437 method: 'GET', | 437 method: 'GET', |
438 url: remoting.settings.DIRECTORY_API_BASE_URL + '/support-hosts/' + | 438 url: remoting.settings.DIRECTORY_API_BASE_URL + '/support-hosts/' + |
439 encodeURIComponent(hostId), | 439 encodeURIComponent(hostId), |
440 onDone: this.onIT2MeHostInfo_.bind(this), | 440 onDone: this.onIT2MeHostInfo_.bind(this, hostId), |
441 oauthToken: token | 441 oauthToken: token |
442 }); | 442 }); |
443 }; | 443 }; |
444 | 444 |
445 /** | 445 /** |
446 * Continue an IT2Me connection once the host JID has been looked up. | 446 * Continue an IT2Me connection once the host JID has been looked up. |
447 * | 447 * |
448 * @param {string} hostId | 448 * @param {string} hostId |
449 * @param {XMLHttpRequest} xhr The server response to the support-hosts query. | 449 * @param {XMLHttpRequest} xhr The server response to the support-hosts query. |
450 * @return {void} Nothing. | 450 * @return {void} Nothing. |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
624 */ | 624 */ |
625 remoting.DefaultSessionConnectorFactory.prototype.createConnector = | 625 remoting.DefaultSessionConnectorFactory.prototype.createConnector = |
626 function(clientContainer, onConnected, onError, onExtensionMessage, | 626 function(clientContainer, onConnected, onError, onExtensionMessage, |
627 onConnectionFailed, requiredCapabilities, defaultRemapKeys) { | 627 onConnectionFailed, requiredCapabilities, defaultRemapKeys) { |
628 return new remoting.SessionConnectorImpl(clientContainer, onConnected, | 628 return new remoting.SessionConnectorImpl(clientContainer, onConnected, |
629 onError, onExtensionMessage, | 629 onError, onExtensionMessage, |
630 onConnectionFailed, | 630 onConnectionFailed, |
631 requiredCapabilities, | 631 requiredCapabilities, |
632 defaultRemapKeys); | 632 defaultRemapKeys); |
633 }; | 633 }; |
OLD | NEW |