| 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 484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 495 console.log('Created plugin'); | 495 console.log('Created plugin'); |
| 496 break; | 496 break; |
| 497 | 497 |
| 498 case remoting.ClientSession.State.CONNECTING: | 498 case remoting.ClientSession.State.CONNECTING: |
| 499 remoting.identity.getEmail().then( | 499 remoting.identity.getEmail().then( |
| 500 function(/** string */ email) { | 500 function(/** string */ email) { |
| 501 console.log('Connecting as ' + email); | 501 console.log('Connecting as ' + email); |
| 502 }); | 502 }); |
| 503 break; | 503 break; |
| 504 | 504 |
| 505 case remoting.ClientSession.State.AUTHENTICATED: |
| 506 console.log('Connection authenticated'); |
| 507 break; |
| 508 |
| 505 case remoting.ClientSession.State.INITIALIZING: | 509 case remoting.ClientSession.State.INITIALIZING: |
| 506 console.log('Initializing connection'); | 510 console.log('Initializing connection'); |
| 507 break; | 511 break; |
| 508 | 512 |
| 509 case remoting.ClientSession.State.CLOSED: | 513 case remoting.ClientSession.State.CLOSED: |
| 510 // This class deregisters for state-change callbacks when the CONNECTED | 514 // This class deregisters for state-change callbacks when the CONNECTED |
| 511 // state is reached, so it only sees the CLOSED state in exceptional | 515 // state is reached, so it only sees the CLOSED state in exceptional |
| 512 // circumstances. For example, a CONNECTING -> CLOSED transition happens | 516 // circumstances. For example, a CONNECTING -> CLOSED transition happens |
| 513 // if the host closes the connection without an error message instead of | 517 // 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, | 518 // 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} | 557 * @return {remoting.SessionConnector} |
| 554 */ | 558 */ |
| 555 remoting.DefaultSessionConnectorFactory.prototype.createConnector = | 559 remoting.DefaultSessionConnectorFactory.prototype.createConnector = |
| 556 function(clientContainer, onConnected, onError, | 560 function(clientContainer, onConnected, onError, |
| 557 onConnectionFailed, requiredCapabilities) { | 561 onConnectionFailed, requiredCapabilities) { |
| 558 return new remoting.SessionConnectorImpl(clientContainer, onConnected, | 562 return new remoting.SessionConnectorImpl(clientContainer, onConnected, |
| 559 onError, | 563 onError, |
| 560 onConnectionFailed, | 564 onConnectionFailed, |
| 561 requiredCapabilities); | 565 requiredCapabilities); |
| 562 }; | 566 }; |
| OLD | NEW |