Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(74)

Side by Side Diff: remoting/webapp/session_connector_impl.js

Issue 592163002: Fix IT2Me. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
267 * @return {void} Nothing. 267 * @return {void} Nothing.
268 */ 268 */
269 remoting.SessionConnectorImpl.prototype.connectIT2Me = function(accessCode) { 269 remoting.SessionConnectorImpl.prototype.connectIT2Me = function(accessCode) {
270 var kSupportIdLen = 7; 270 var kSupportIdLen = 7;
271 var kHostSecretLen = 5; 271 var kHostSecretLen = 5;
272 var kAccessCodeLen = kSupportIdLen + kHostSecretLen; 272 var kAccessCodeLen = kSupportIdLen + kHostSecretLen;
273 273
274 // Cancel any existing connect operation. 274 // Cancel any existing connect operation.
275 this.cancel(); 275 this.cancel();
276 276
277 this.connectSignaling_();
Sergey Ulanov 2014/09/22 18:11:51 connectSignaling_() connects signaling and then st
Jamie 2014/09/22 18:40:05 Acknowledged.
278
277 var normalizedAccessCode = this.normalizeAccessCode_(accessCode); 279 var normalizedAccessCode = this.normalizeAccessCode_(accessCode);
278 if (normalizedAccessCode.length != kAccessCodeLen) { 280 if (normalizedAccessCode.length != kAccessCodeLen) {
279 this.onError_(remoting.Error.INVALID_ACCESS_CODE); 281 this.onError_(remoting.Error.INVALID_ACCESS_CODE);
280 return; 282 return;
281 } 283 }
282 284
283 this.hostId_ = normalizedAccessCode.substring(0, kSupportIdLen); 285 this.hostId_ = normalizedAccessCode.substring(0, kSupportIdLen);
284 this.passPhrase_ = normalizedAccessCode; 286 this.passPhrase_ = normalizedAccessCode;
285 this.connectionMode_ = remoting.ClientSession.Mode.IT2ME; 287 this.connectionMode_ = remoting.ClientSession.Mode.IT2ME;
286 remoting.identity.callWithToken(this.connectIT2MeWithToken_.bind(this), 288 remoting.identity.callWithToken(this.connectIT2MeWithToken_.bind(this),
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
421 */ 423 */
422 remoting.SessionConnectorImpl.prototype.onIT2MeHostInfo_ = function(xhr) { 424 remoting.SessionConnectorImpl.prototype.onIT2MeHostInfo_ = function(xhr) {
423 this.pendingXhr_ = null; 425 this.pendingXhr_ = null;
424 if (xhr.status == 200) { 426 if (xhr.status == 200) {
425 var host = /** @type {{data: {jabberId: string, publicKey: string}}} */ 427 var host = /** @type {{data: {jabberId: string, publicKey: string}}} */
426 jsonParseSafe(xhr.responseText); 428 jsonParseSafe(xhr.responseText);
427 if (host && host.data && host.data.jabberId && host.data.publicKey) { 429 if (host && host.data && host.data.jabberId && host.data.publicKey) {
428 this.hostJid_ = host.data.jabberId; 430 this.hostJid_ = host.data.jabberId;
429 this.hostPublicKey_ = host.data.publicKey; 431 this.hostPublicKey_ = host.data.publicKey;
430 this.hostDisplayName_ = this.hostJid_.split('/')[0]; 432 this.hostDisplayName_ = this.hostJid_.split('/')[0];
431 this.createSession_(); 433 this.createSession_();
Sergey Ulanov 2014/09/22 18:11:51 I think you just need to replace this line with "t
Jamie 2014/09/22 18:40:05 Done
432 return; 434 return;
433 } else { 435 } else {
434 console.error('Invalid "support-hosts" response from server.'); 436 console.error('Invalid "support-hosts" response from server.');
435 } 437 }
436 } else { 438 } else {
437 this.onError_(this.translateSupportHostsError_(xhr.status)); 439 this.onError_(this.translateSupportHostsError_(xhr.status));
438 } 440 }
439 }; 441 };
440 442
441 /** 443 /**
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
603 * @param {function(remoting.Error):void} onError Callback on error. 605 * @param {function(remoting.Error):void} onError Callback on error.
604 * @param {function(string, string):boolean} onExtensionMessage The handler for 606 * @param {function(string, string):boolean} onExtensionMessage The handler for
605 * protocol extension messages. Returns true if a message is recognized; 607 * protocol extension messages. Returns true if a message is recognized;
606 * false otherwise. 608 * false otherwise.
607 */ 609 */
608 remoting.DefaultSessionConnectorFactory.prototype.createConnector = 610 remoting.DefaultSessionConnectorFactory.prototype.createConnector =
609 function(clientContainer, onConnected, onError, onExtensionMessage) { 611 function(clientContainer, onConnected, onError, onExtensionMessage) {
610 return new remoting.SessionConnectorImpl( 612 return new remoting.SessionConnectorImpl(
611 clientContainer, onConnected, onError, onExtensionMessage); 613 clientContainer, onConnected, onError, onExtensionMessage);
612 }; 614 };
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698