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 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
364 * @param {string} email | 364 * @param {string} email |
365 */ | 365 */ |
366 function connectSignalingWithTokenAndEmail(token, email) { | 366 function connectSignalingWithTokenAndEmail(token, email) { |
367 that.signalStrategy_.connect( | 367 that.signalStrategy_.connect( |
368 remoting.settings.XMPP_SERVER_ADDRESS, email, token); | 368 remoting.settings.XMPP_SERVER_ADDRESS, email, token); |
369 } | 369 } |
370 | 370 |
371 // Only use XMPP when TCP API is available and TLS support is enabled. That's | 371 // Only use XMPP when TCP API is available and TLS support is enabled. That's |
372 // not the case for V1 app (socket API is available only to platform apps) | 372 // not the case for V1 app (socket API is available only to platform apps) |
373 // and for Chrome releases before 38. | 373 // and for Chrome releases before 38. |
374 if (chrome.socket.secure) { | 374 if (chrome.socket && chrome.socket.secure) { |
375 this.signalStrategy_ = /** @type {remoting.SignalStrategy} */ | 375 this.signalStrategy_ = /** @type {remoting.SignalStrategy} */ |
376 (new remoting.XmppConnection(this.onSignalingState_.bind(this))); | 376 (new remoting.XmppConnection(this.onSignalingState_.bind(this))); |
377 } else { | 377 } else { |
378 this.signalStrategy_ = /** @type {remoting.SignalStrategy} */ | 378 this.signalStrategy_ = /** @type {remoting.SignalStrategy} */ |
379 (new remoting.WcsAdapter(this.onSignalingState_.bind(this))); | 379 (new remoting.WcsAdapter(this.onSignalingState_.bind(this))); |
380 } | 380 } |
381 | 381 |
382 remoting.identity.callWithToken(connectSignalingWithToken, this.onError_); | 382 remoting.identity.callWithToken(connectSignalingWithToken, this.onError_); |
383 }; | 383 }; |
384 | 384 |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
585 * Normalize the access code entered by the user. | 585 * Normalize the access code entered by the user. |
586 * | 586 * |
587 * @param {string} accessCode The access code, as entered by the user. | 587 * @param {string} accessCode The access code, as entered by the user. |
588 * @return {string} The normalized form of the code (whitespace removed). | 588 * @return {string} The normalized form of the code (whitespace removed). |
589 */ | 589 */ |
590 remoting.SessionConnector.prototype.normalizeAccessCode_ = | 590 remoting.SessionConnector.prototype.normalizeAccessCode_ = |
591 function(accessCode) { | 591 function(accessCode) { |
592 // Trim whitespace. | 592 // Trim whitespace. |
593 return accessCode.replace(/\s/g, ''); | 593 return accessCode.replace(/\s/g, ''); |
594 }; | 594 }; |
OLD | NEW |