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 465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
476 new remoting.SmartReconnector(this, this.clientSession_); | 476 new remoting.SmartReconnector(this, this.clientSession_); |
477 } | 477 } |
478 this.onConnected_(this.clientSession_); | 478 this.onConnected_(this.clientSession_); |
479 break; | 479 break; |
480 | 480 |
481 case remoting.ClientSession.State.CREATED: | 481 case remoting.ClientSession.State.CREATED: |
482 console.log('Created plugin'); | 482 console.log('Created plugin'); |
483 break; | 483 break; |
484 | 484 |
485 case remoting.ClientSession.State.CONNECTING: | 485 case remoting.ClientSession.State.CONNECTING: |
486 console.log('Connecting as ' + remoting.identity.getCachedEmail()); | 486 remoting.identity.getEmail().then( |
| 487 function(/** string */ email) { |
| 488 console.log('Connecting as ' + email); |
| 489 }); |
487 break; | 490 break; |
488 | 491 |
489 case remoting.ClientSession.State.INITIALIZING: | 492 case remoting.ClientSession.State.INITIALIZING: |
490 console.log('Initializing connection'); | 493 console.log('Initializing connection'); |
491 break; | 494 break; |
492 | 495 |
493 case remoting.ClientSession.State.CLOSED: | 496 case remoting.ClientSession.State.CLOSED: |
494 // This class deregisters for state-change callbacks when the CONNECTED | 497 // This class deregisters for state-change callbacks when the CONNECTED |
495 // state is reached, so it only sees the CLOSED state in exceptional | 498 // state is reached, so it only sees the CLOSED state in exceptional |
496 // circumstances. For example, a CONNECTING -> CLOSED transition happens | 499 // circumstances. For example, a CONNECTING -> CLOSED transition happens |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
574 */ | 577 */ |
575 remoting.DefaultSessionConnectorFactory.prototype.createConnector = | 578 remoting.DefaultSessionConnectorFactory.prototype.createConnector = |
576 function(clientContainer, onConnected, onError, onExtensionMessage, | 579 function(clientContainer, onConnected, onError, onExtensionMessage, |
577 onConnectionFailed, requiredCapabilities, defaultRemapKeys) { | 580 onConnectionFailed, requiredCapabilities, defaultRemapKeys) { |
578 return new remoting.SessionConnectorImpl(clientContainer, onConnected, | 581 return new remoting.SessionConnectorImpl(clientContainer, onConnected, |
579 onError, onExtensionMessage, | 582 onError, onExtensionMessage, |
580 onConnectionFailed, | 583 onConnectionFailed, |
581 requiredCapabilities, | 584 requiredCapabilities, |
582 defaultRemapKeys); | 585 defaultRemapKeys); |
583 }; | 586 }; |
OLD | NEW |