diff options
author | jamiewalch@chromium.org <jamiewalch@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-03-12 03:46:17 +0000 |
---|---|---|
committer | jamiewalch@chromium.org <jamiewalch@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-03-12 03:46:17 +0000 |
commit | 592b2407313c2b515c17c6e3d6523b1afb5ceac9 (patch) | |
tree | 3aef0463b97e534a346b1398add4870cb0969388 | |
parent | 68d5122119611caaa5869edf7ea6cfeb9d425b6f (diff) | |
download | chromium_src-592b2407313c2b515c17c6e3d6523b1afb5ceac9.zip chromium_src-592b2407313c2b515c17c6e3d6523b1afb5ceac9.tar.gz chromium_src-592b2407313c2b515c17c6e3d6523b1afb5ceac9.tar.bz2 |
Don't display the 'start-host' UI if there was an error fetching the host list.
BUG=175241
Review URL: https://chromiumcodereview.appspot.com/12408017
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@187475 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | remoting/webapp/host_list.js | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/remoting/webapp/host_list.js b/remoting/webapp/host_list.js index 2cd2f91..f1282d5 100644 --- a/remoting/webapp/host_list.js +++ b/remoting/webapp/host_list.js @@ -252,16 +252,25 @@ remoting.HostList.prototype.display = function() { this.errorMsg_.parentNode.hidden = (this.lastError_ == ''); + // The local host cannot be stopped or started if the host controller is not + // implemented for this platform. Additionally, it cannot be started if there + // is an error (in many error states, the start operation will fail anyway, + // but even if it succeeds, the chance of a related but hard-to-diagnose + // future error is high). var state = this.localHostState_; var enabled = (state == remoting.HostController.State.STARTING) || (state == remoting.HostController.State.STARTED); - var supported = (state != remoting.HostController.State.NOT_IMPLEMENTED); + var canChangeLocalHostState = + (state != remoting.HostController.State.NOT_IMPLEMENTED) && + (enabled || this.lastError_ == ''); + remoting.updateModalUi(enabled ? 'enabled' : 'disabled', 'data-daemon-state'); - document.getElementById('daemon-control').hidden = !supported; - var element = document.getElementById('host-list-empty-hosting-supported'); - element.hidden = !supported; + var element = document.getElementById('daemon-control'); + element.hidden = !canChangeLocalHostState; + element = document.getElementById('host-list-empty-hosting-supported'); + element.hidden = !canChangeLocalHostState; element = document.getElementById('host-list-empty-hosting-unsupported'); - element.hidden = supported; + element.hidden = canChangeLocalHostState; }; /** |