| 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 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 345 onConfigUpdated, remoting.Error.handler(onError)); | 345 onConfigUpdated, remoting.Error.handler(onError)); |
| 346 } | 346 } |
| 347 | 347 |
| 348 /** @param {Object} config */ | 348 /** @param {Object} config */ |
| 349 function onConfig(config) { | 349 function onConfig(config) { |
| 350 if (!isHostConfigValid_(config)) { | 350 if (!isHostConfigValid_(config)) { |
| 351 onError(remoting.Error.unexpected()); | 351 onError(remoting.Error.unexpected()); |
| 352 return; | 352 return; |
| 353 } | 353 } |
| 354 /** @type {string} */ | 354 /** @type {string} */ |
| 355 var hostId = config['host_id']; | 355 var hostId = base.getStringAttr(config, 'host_id'); |
| 356 that.hostDaemonFacade_.getPinHash(hostId, newPin).then( | 356 that.hostDaemonFacade_.getPinHash(hostId, newPin).then( |
| 357 updateDaemonConfigWithHash, remoting.Error.handler(onError)); | 357 updateDaemonConfigWithHash, remoting.Error.handler(onError)); |
| 358 } | 358 } |
| 359 | 359 |
| 360 // TODO(sergeyu): When crbug.com/121518 is fixed: replace this call | 360 // TODO(sergeyu): When crbug.com/121518 is fixed: replace this call |
| 361 // with an unprivileged version if that is necessary. | 361 // with an unprivileged version if that is necessary. |
| 362 this.hostDaemonFacade_.getDaemonConfig().then( | 362 this.hostDaemonFacade_.getDaemonConfig().then( |
| 363 onConfig, remoting.Error.handler(onError)); | 363 onConfig, remoting.Error.handler(onError)); |
| 364 }; | 364 }; |
| 365 | 365 |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 492 emailPromise.then(function(/** string */ email) { | 492 emailPromise.then(function(/** string */ email) { |
| 493 signalStrategy.connect(remoting.settings.XMPP_SERVER, email, token); | 493 signalStrategy.connect(remoting.settings.XMPP_SERVER, email, token); |
| 494 }); | 494 }); |
| 495 }); | 495 }); |
| 496 | 496 |
| 497 return result; | 497 return result; |
| 498 }; | 498 }; |
| 499 | 499 |
| 500 /** @type {remoting.HostController} */ | 500 /** @type {remoting.HostController} */ |
| 501 remoting.hostController = null; | 501 remoting.hostController = null; |
| OLD | NEW |