| 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 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 424 this.hostDaemonFacade_.getDaemonConfig(onConfig, onError); | 424 this.hostDaemonFacade_.getDaemonConfig(onConfig, onError); |
| 425 }; | 425 }; |
| 426 | 426 |
| 427 /** | 427 /** |
| 428 * Get the state of the local host. | 428 * Get the state of the local host. |
| 429 * | 429 * |
| 430 * @param {function(remoting.HostController.State):void} onDone Completion | 430 * @param {function(remoting.HostController.State):void} onDone Completion |
| 431 * callback. | 431 * callback. |
| 432 */ | 432 */ |
| 433 remoting.HostController.prototype.getLocalHostState = function(onDone) { | 433 remoting.HostController.prototype.getLocalHostState = function(onDone) { |
| 434 this.hostDaemonFacade_.getDaemonState(onDone, function(error) { | 434 /** @param {remoting.Error} error */ |
| 435 onDone(remoting.HostController.State.UNKNOWN); | 435 function onError(error) { |
| 436 }); | 436 onDone((error == remoting.Error.MISSING_PLUGIN) ? |
| 437 remoting.HostController.State.NOT_INSTALLED : |
| 438 remoting.HostController.State.UNKNOWN); |
| 439 } |
| 440 this.hostDaemonFacade_.getDaemonState(onDone, onError); |
| 437 }; | 441 }; |
| 438 | 442 |
| 439 /** | 443 /** |
| 440 * Get the id of the local host, or null if it is not registered. | 444 * Get the id of the local host, or null if it is not registered. |
| 441 * | 445 * |
| 442 * @param {function(string?):void} onDone Completion callback. | 446 * @param {function(string?):void} onDone Completion callback. |
| 443 */ | 447 */ |
| 444 remoting.HostController.prototype.getLocalHostId = function(onDone) { | 448 remoting.HostController.prototype.getLocalHostId = function(onDone) { |
| 445 /** @type {remoting.HostController} */ | 449 /** @type {remoting.HostController} */ |
| 446 var that = this; | 450 var that = this; |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 490 * @param {function(remoting.Error):void} onError Error callback. | 494 * @param {function(remoting.Error):void} onError Error callback. |
| 491 * @return {void} | 495 * @return {void} |
| 492 */ | 496 */ |
| 493 remoting.HostController.prototype.clearPairedClients = function( | 497 remoting.HostController.prototype.clearPairedClients = function( |
| 494 onDone, onError) { | 498 onDone, onError) { |
| 495 this.hostDaemonFacade_.clearPairedClients(onDone, onError); | 499 this.hostDaemonFacade_.clearPairedClients(onDone, onError); |
| 496 }; | 500 }; |
| 497 | 501 |
| 498 /** @type {remoting.HostController} */ | 502 /** @type {remoting.HostController} */ |
| 499 remoting.hostController = null; | 503 remoting.hostController = null; |
| OLD | NEW |