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 473 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
484 new remoting.SmartReconnector(this, this.clientSession_); | 484 new remoting.SmartReconnector(this, this.clientSession_); |
485 } | 485 } |
486 var connectionInfo = new remoting.ConnectionInfo( | 486 var connectionInfo = new remoting.ConnectionInfo( |
487 this.host_, this.credentialsProvider_, this.clientSession_, | 487 this.host_, this.credentialsProvider_, this.clientSession_, |
488 this.plugin_, this.connectionMode_); | 488 this.plugin_, this.connectionMode_); |
489 this.onConnected_(connectionInfo); | 489 this.onConnected_(connectionInfo); |
490 // Initialize any protocol extensions that may have been added by the app. | 490 // Initialize any protocol extensions that may have been added by the app. |
491 this.initProtocolExtensions_(); | 491 this.initProtocolExtensions_(); |
492 break; | 492 break; |
493 | 493 |
494 case remoting.ClientSession.State.CREATED: | |
495 console.log('Created plugin'); | |
496 break; | |
497 | |
498 case remoting.ClientSession.State.CONNECTING: | 494 case remoting.ClientSession.State.CONNECTING: |
499 remoting.identity.getEmail().then( | 495 remoting.identity.getEmail().then( |
500 function(/** string */ email) { | 496 function(/** string */ email) { |
501 console.log('Connecting as ' + email); | 497 console.log('Connecting as ' + email); |
502 }); | 498 }); |
503 break; | 499 break; |
504 | 500 |
| 501 case remoting.ClientSession.State.AUTHENTICATED: |
| 502 console.log('Connection authenticated'); |
| 503 break; |
| 504 |
505 case remoting.ClientSession.State.INITIALIZING: | 505 case remoting.ClientSession.State.INITIALIZING: |
506 console.log('Initializing connection'); | 506 console.log('Initializing connection'); |
507 break; | 507 break; |
508 | 508 |
509 case remoting.ClientSession.State.CLOSED: | 509 case remoting.ClientSession.State.CLOSED: |
510 // This class deregisters for state-change callbacks when the CONNECTED | 510 // This class deregisters for state-change callbacks when the CONNECTED |
511 // state is reached, so it only sees the CLOSED state in exceptional | 511 // state is reached, so it only sees the CLOSED state in exceptional |
512 // circumstances. For example, a CONNECTING -> CLOSED transition happens | 512 // circumstances. For example, a CONNECTING -> CLOSED transition happens |
513 // if the host closes the connection without an error message instead of | 513 // if the host closes the connection without an error message instead of |
514 // accepting it. Since there's no way of knowing exactly what went wrong, | 514 // accepting it. Since there's no way of knowing exactly what went wrong, |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
553 * @return {remoting.SessionConnector} | 553 * @return {remoting.SessionConnector} |
554 */ | 554 */ |
555 remoting.DefaultSessionConnectorFactory.prototype.createConnector = | 555 remoting.DefaultSessionConnectorFactory.prototype.createConnector = |
556 function(clientContainer, onConnected, onError, | 556 function(clientContainer, onConnected, onError, |
557 onConnectionFailed, requiredCapabilities) { | 557 onConnectionFailed, requiredCapabilities) { |
558 return new remoting.SessionConnectorImpl(clientContainer, onConnected, | 558 return new remoting.SessionConnectorImpl(clientContainer, onConnected, |
559 onError, | 559 onError, |
560 onConnectionFailed, | 560 onConnectionFailed, |
561 requiredCapabilities); | 561 requiredCapabilities); |
562 }; | 562 }; |
OLD | NEW |