| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 'use strict'; | 5 'use strict'; |
| 6 | 6 |
| 7 /** @suppress {duplicate} */ | 7 /** @suppress {duplicate} */ |
| 8 var remoting = remoting || {}; | 8 var remoting = remoting || {}; |
| 9 | 9 |
| 10 /** @constructor */ | 10 /** @constructor */ |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 202 result['data']['authorizationCode'], | 202 result['data']['authorizationCode'], |
| 203 onServiceAccountCredentials.bind( | 203 onServiceAccountCredentials.bind( |
| 204 null, hostName, publicKey, privateKey), | 204 null, hostName, publicKey, privateKey), |
| 205 onError); | 205 onError); |
| 206 } else { | 206 } else { |
| 207 // No authorization code returned, use regular user credential flow. | 207 // No authorization code returned, use regular user credential flow. |
| 208 that.hostDispatcher_.getPinHash( | 208 that.hostDispatcher_.getPinHash( |
| 209 newHostId, hostPin, startHostWithHash.bind( | 209 newHostId, hostPin, startHostWithHash.bind( |
| 210 null, hostName, publicKey, privateKey, | 210 null, hostName, publicKey, privateKey, |
| 211 remoting.identity.getCachedEmail(), | 211 remoting.identity.getCachedEmail(), |
| 212 remoting.oauth2.exportRefreshToken()), | 212 remoting.oauth2.getRefreshToken()), |
| 213 onError); | 213 onError); |
| 214 } | 214 } |
| 215 } else { | 215 } else { |
| 216 console.log('Failed to register the host. Status: ' + xhr.status + | 216 console.log('Failed to register the host. Status: ' + xhr.status + |
| 217 ' response: ' + xhr.responseText); | 217 ' response: ' + xhr.responseText); |
| 218 onError(remoting.Error.REGISTRATION_FAILED); | 218 onError(remoting.Error.REGISTRATION_FAILED); |
| 219 } | 219 } |
| 220 } | 220 } |
| 221 | 221 |
| 222 /** | 222 /** |
| (...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 467 * @param {function(remoting.Error):void} onError Error callback. | 467 * @param {function(remoting.Error):void} onError Error callback. |
| 468 * @return {void} | 468 * @return {void} |
| 469 */ | 469 */ |
| 470 remoting.HostController.prototype.clearPairedClients = function( | 470 remoting.HostController.prototype.clearPairedClients = function( |
| 471 onDone, onError) { | 471 onDone, onError) { |
| 472 this.hostDispatcher_.clearPairedClients(onDone, onError); | 472 this.hostDispatcher_.clearPairedClients(onDone, onError); |
| 473 }; | 473 }; |
| 474 | 474 |
| 475 /** @type {remoting.HostController} */ | 475 /** @type {remoting.HostController} */ |
| 476 remoting.hostController = null; | 476 remoting.hostController = null; |
| OLD | NEW |