Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1675)

Unified Diff: remoting/webapp/host_controller.js

Issue 10703034: Remove 'Enable' button on unsupported platforms. Added 'No hosts' message. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Updated after UX input. Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/webapp/_locales/en/messages.json ('k') | remoting/webapp/host_list.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/webapp/host_controller.js
diff --git a/remoting/webapp/host_controller.js b/remoting/webapp/host_controller.js
index 08f3f2e47687fdd077c43c3738e60295c361df8b..8fd69a69da9d40632d6f24d7fe4bd0f9e173aaea 100644
--- a/remoting/webapp/host_controller.js
+++ b/remoting/webapp/host_controller.js
@@ -80,21 +80,14 @@ remoting.HostController.prototype.getConsent = function(callback) {
remoting.HostController.prototype.updateDom = function() {
var match = '';
var state = this.state();
- switch (state) {
- case remoting.HostController.State.STARTED:
- remoting.updateModalUi('enabled', 'data-daemon-state');
- break;
- case remoting.HostController.State.NOT_IMPLEMENTED:
- document.getElementById('start-daemon').disabled = true;
- document.getElementById('start-daemon-message').innerText =
- chrome.i18n.getMessage(
- /*i18n-content*/'HOME_DAEMON_DISABLED_MESSAGE');
- // No break;
- case remoting.HostController.State.STOPPED:
- case remoting.HostController.State.NOT_INSTALLED:
- remoting.updateModalUi('disabled', 'data-daemon-state');
- break;
- }
+ var enabled = (state == remoting.HostController.State.STARTED);
+ var supported = (state != remoting.HostController.State.NOT_IMPLEMENTED);
+ 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;
+ element = document.getElementById('host-list-empty-hosting-unsupported');
+ element.hidden = supported;
};
/**
« no previous file with comments | « remoting/webapp/_locales/en/messages.json ('k') | remoting/webapp/host_list.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698