| 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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 this.plugin_.getUsageStatsConsent(callback); | 73 this.plugin_.getUsageStatsConsent(callback); |
| 74 }; | 74 }; |
| 75 | 75 |
| 76 /** | 76 /** |
| 77 * Show or hide daemon-specific parts of the UI. | 77 * Show or hide daemon-specific parts of the UI. |
| 78 * @return {void} Nothing. | 78 * @return {void} Nothing. |
| 79 */ | 79 */ |
| 80 remoting.HostController.prototype.updateDom = function() { | 80 remoting.HostController.prototype.updateDom = function() { |
| 81 var match = ''; | 81 var match = ''; |
| 82 var state = this.state(); | 82 var state = this.state(); |
| 83 switch (state) { | 83 var enabled = (state == remoting.HostController.State.STARTED); |
| 84 case remoting.HostController.State.STARTED: | 84 var supported = (state != remoting.HostController.State.NOT_IMPLEMENTED); |
| 85 remoting.updateModalUi('enabled', 'data-daemon-state'); | 85 remoting.updateModalUi(enabled ? 'enabled' : 'disabled', 'data-daemon-state'); |
| 86 break; | 86 document.getElementById('daemon-control').hidden = !supported; |
| 87 case remoting.HostController.State.NOT_IMPLEMENTED: | 87 var element = document.getElementById('host-list-empty-hosting-supported'); |
| 88 document.getElementById('start-daemon').disabled = true; | 88 element.hidden = !supported; |
| 89 document.getElementById('start-daemon-message').innerText = | 89 element = document.getElementById('host-list-empty-hosting-unsupported'); |
| 90 chrome.i18n.getMessage( | 90 element.hidden = supported; |
| 91 /*i18n-content*/'HOME_DAEMON_DISABLED_MESSAGE'); | |
| 92 // No break; | |
| 93 case remoting.HostController.State.STOPPED: | |
| 94 case remoting.HostController.State.NOT_INSTALLED: | |
| 95 remoting.updateModalUi('disabled', 'data-daemon-state'); | |
| 96 break; | |
| 97 } | |
| 98 }; | 91 }; |
| 99 | 92 |
| 100 /** | 93 /** |
| 101 * Set tool-tips for the 'connect' action. We can't just set this on the | 94 * Set tool-tips for the 'connect' action. We can't just set this on the |
| 102 * parent element because the button has no tool-tip, and therefore would | 95 * parent element because the button has no tool-tip, and therefore would |
| 103 * inherit connectStr. | 96 * inherit connectStr. |
| 104 * | 97 * |
| 105 * return {void} Nothing. | 98 * return {void} Nothing. |
| 106 */ | 99 */ |
| 107 remoting.HostController.prototype.setTooltips = function() { | 100 remoting.HostController.prototype.setTooltips = function() { |
| (...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 374 try { | 367 try { |
| 375 this.plugin_.getDaemonConfig(onConfig); | 368 this.plugin_.getDaemonConfig(onConfig); |
| 376 } catch (err) { | 369 } catch (err) { |
| 377 this.setHost(null); | 370 this.setHost(null); |
| 378 onDone(); | 371 onDone(); |
| 379 } | 372 } |
| 380 }; | 373 }; |
| 381 | 374 |
| 382 /** @type {remoting.HostController} */ | 375 /** @type {remoting.HostController} */ |
| 383 remoting.hostController = null; | 376 remoting.hostController = null; |
| OLD | NEW |