summaryrefslogtreecommitdiffstats
path: root/remoting/webapp/remoting.js
diff options
context:
space:
mode:
authorsergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-29 00:37:21 +0000
committersergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-29 00:37:21 +0000
commit2febe2d379df617daa59950de45105700d8a6518 (patch)
tree42096318a56e9c25752ed67cc0559338ebf636a0 /remoting/webapp/remoting.js
parentceefd7fdfd72ac1d845a053391601302af4d1f4d (diff)
downloadchromium_src-2febe2d379df617daa59950de45105700d8a6518.zip
chromium_src-2febe2d379df617daa59950de45105700d8a6518.tar.gz
chromium_src-2febe2d379df617daa59950de45105700d8a6518.tar.bz2
Remove remoting.HostController.state()
In future, when we remove NPAPI we'll be getting host state asynchronously. This change removes state() method from HostController class. Now the getLocalHostStateAndId() should be used to get host state. There is still isInstalled() used by the HostSetupDialog, but it the future it will need to be removed as well. Review URL: https://codereview.chromium.org/11418207 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@170106 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/webapp/remoting.js')
-rw-r--r--remoting/webapp/remoting.js33
1 files changed, 9 insertions, 24 deletions
diff --git a/remoting/webapp/remoting.js b/remoting/webapp/remoting.js
index 11e20a8..3b58eeb 100644
--- a/remoting/webapp/remoting.js
+++ b/remoting/webapp/remoting.js
@@ -110,38 +110,23 @@ remoting.initDaemonUi = function () {
remoting.hostSetupDialog =
new remoting.HostSetupDialog(remoting.hostController);
// Display the cached host list, then asynchronously update and re-display it.
- remoting.extractThisHostAndDisplay(true);
- remoting.hostList.refresh(remoting.extractThisHostAndDisplay);
-};
-
-/**
- * Extract the remoting.Host object corresponding to this host (if any) and
- * display the list.
- *
- * @param {boolean} success True if the host list refresh was successful.
- * @return {void} Nothing.
- */
-remoting.extractThisHostAndDisplay = function(success) {
- if (success) {
- remoting.updateLocalHostState();
- } else {
- remoting.hostList.setLocalHostStateAndId(
- remoting.hostController.state(), null);
- remoting.hostList.display();
- }
+ remoting.updateLocalHostState();
+ remoting.hostList.refresh(remoting.updateLocalHostState);
};
/**
* Fetches local host state and updates host list accordingly.
*/
remoting.updateLocalHostState = function() {
- /** @param {string?} localHostId */
- var onHostId = function(localHostId) {
- remoting.hostList.setLocalHostStateAndId(
- remoting.hostController.state(), localHostId);
+ /**
+ * @param {remoting.HostController.State} state Host state.
+ * @param {string?} localHostId
+ */
+ var onHostState = function(state, localHostId) {
+ remoting.hostList.setLocalHostStateAndId(state, localHostId);
remoting.hostList.display();
};
- remoting.hostController.getLocalHostId(onHostId);
+ remoting.hostController.getLocalHostStateAndId(onHostState);
}
/**