| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 * Functions related to the 'client screen' for Chromoting. | 7 * Functions related to the 'client screen' for Chromoting. |
| 8 */ | 8 */ |
| 9 | 9 |
| 10 'use strict'; | 10 'use strict'; |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 * @param {remoting.Host} host The Me2Me host to which to connect. | 71 * @param {remoting.Host} host The Me2Me host to which to connect. |
| 72 * @return {void} Nothing. | 72 * @return {void} Nothing. |
| 73 */ | 73 */ |
| 74 remoting.connectMe2MeHostVersionAcknowledged_ = function(host) { | 74 remoting.connectMe2MeHostVersionAcknowledged_ = function(host) { |
| 75 /** @type {remoting.SessionConnector} */ | 75 /** @type {remoting.SessionConnector} */ |
| 76 var connector = remoting.app.getSessionConnector(); | 76 var connector = remoting.app.getSessionConnector(); |
| 77 remoting.setMode(remoting.AppMode.CLIENT_CONNECTING); | 77 remoting.setMode(remoting.AppMode.CLIENT_CONNECTING); |
| 78 | 78 |
| 79 /** | 79 /** |
| 80 * @param {string} tokenUrl Token-issue URL received from the host. | 80 * @param {string} tokenUrl Token-issue URL received from the host. |
| 81 * @param {string} hostPublicKey Host public key (DER and Base64 encoded). |
| 81 * @param {string} scope OAuth scope to request the token for. | 82 * @param {string} scope OAuth scope to request the token for. |
| 82 * @param {string} hostPublicKey Host public key (DER and Base64 encoded). | |
| 83 * @param {function(string, string):void} onThirdPartyTokenFetched Callback. | 83 * @param {function(string, string):void} onThirdPartyTokenFetched Callback. |
| 84 */ | 84 */ |
| 85 var fetchThirdPartyToken = function( | 85 var fetchThirdPartyToken = function( |
| 86 tokenUrl, hostPublicKey, scope, onThirdPartyTokenFetched) { | 86 tokenUrl, hostPublicKey, scope, onThirdPartyTokenFetched) { |
| 87 var thirdPartyTokenFetcher = new remoting.ThirdPartyTokenFetcher( | 87 var thirdPartyTokenFetcher = new remoting.ThirdPartyTokenFetcher( |
| 88 tokenUrl, hostPublicKey, scope, host.tokenUrlPatterns, | 88 tokenUrl, hostPublicKey, scope, host.tokenUrlPatterns, |
| 89 onThirdPartyTokenFetched); | 89 onThirdPartyTokenFetched); |
| 90 thirdPartyTokenFetcher.fetchToken(); | 90 thirdPartyTokenFetcher.fetchToken(); |
| 91 }; | 91 }; |
| 92 | 92 |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 if (pairingInfo) { | 154 if (pairingInfo) { |
| 155 clientId = /** @type {string} */ (pairingInfo['clientId']); | 155 clientId = /** @type {string} */ (pairingInfo['clientId']); |
| 156 sharedSecret = /** @type {string} */ (pairingInfo['sharedSecret']); | 156 sharedSecret = /** @type {string} */ (pairingInfo['sharedSecret']); |
| 157 } | 157 } |
| 158 connector.connectMe2Me(host, requestPin, fetchThirdPartyToken, | 158 connector.connectMe2Me(host, requestPin, fetchThirdPartyToken, |
| 159 clientId, sharedSecret); | 159 clientId, sharedSecret); |
| 160 } | 160 } |
| 161 | 161 |
| 162 remoting.HostSettings.load(host.hostId, connectMe2MeHostSettingsRetrieved); | 162 remoting.HostSettings.load(host.hostId, connectMe2MeHostSettingsRetrieved); |
| 163 }; | 163 }; |
| OLD | NEW |