| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 var remoting = remoting || {}; | 5 var remoting = remoting || {}; |
| 6 | 6 |
| 7 (function() { | 7 (function() { |
| 8 | 8 |
| 9 'use strict'; | 9 'use strict'; |
| 10 | 10 |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 // implemented for this platform. | 89 // implemented for this platform. |
| 90 var state = this.state_; | 90 var state = this.state_; |
| 91 if (state === remoting.HostController.State.NOT_IMPLEMENTED || | 91 if (state === remoting.HostController.State.NOT_IMPLEMENTED || |
| 92 state === remoting.HostController.State.UNKNOWN) { | 92 state === remoting.HostController.State.UNKNOWN) { |
| 93 return false; | 93 return false; |
| 94 } | 94 } |
| 95 | 95 |
| 96 // Return false if the host is uninstallable. The NOT_INSTALLED check is | 96 // Return false if the host is uninstallable. The NOT_INSTALLED check is |
| 97 // required to handle the special case for Ubuntu, as we report the host as | 97 // required to handle the special case for Ubuntu, as we report the host as |
| 98 // uninstallable on Linux. | 98 // uninstallable on Linux. |
| 99 if (!remoting.isMe2MeInstallable() && | 99 if (!this.isMe2MeInstallable_() && |
| 100 state === remoting.HostController.State.NOT_INSTALLED) { | 100 state === remoting.HostController.State.NOT_INSTALLED) { |
| 101 return false; | 101 return false; |
| 102 } | 102 } |
| 103 | 103 |
| 104 // In addition, it cannot be started if there is an error (in many error | 104 // In addition, it cannot be started if there is an error (in many error |
| 105 // states, the start operation will fail anyway, but even if it succeeds, the | 105 // states, the start operation will fail anyway, but even if it succeeds, the |
| 106 // chance of a related but hard-to-diagnose future error is high). | 106 // chance of a related but hard-to-diagnose future error is high). |
| 107 return this.isEnabled_() || !this.hasError_; | 107 return this.isEnabled_() || !this.hasError_; |
| 108 }; | 108 }; |
| 109 | 109 |
| 110 /** |
| 111 * Returns true if the current platform is fully supported. It's only used when |
| 112 * we detect that host native messaging components are not installed. In that |
| 113 * case the result of this function determines if the webapp should show the |
| 114 * controls that allow to install and enable Me2Me host. |
| 115 * |
| 116 * @return {boolean} |
| 117 * @private |
| 118 */ |
| 119 remoting.LocalHostSection.prototype.isMe2MeInstallable_ = function() { |
| 120 // The chromoting host is currently not installable on ChromeOS. |
| 121 // For Linux, we have a install package for Ubuntu but not other distros. |
| 122 // Since we cannot tell from javascript alone the Linux distro the client is |
| 123 // on, we don't show the daemon-control UI for Linux unless the host is |
| 124 // installed. |
| 125 return remoting.platformIsWindows() || remoting.platformIsMac(); |
| 126 } |
| 127 |
| 110 /** @private */ | 128 /** @private */ |
| 111 remoting.LocalHostSection.prototype.updateUI_ = function() { | 129 remoting.LocalHostSection.prototype.updateUI_ = function() { |
| 112 this.hostTableEntry_.setHost(this.host_); | 130 this.hostTableEntry_.setHost(this.host_); |
| 113 | 131 |
| 114 // Disable elements. | 132 // Disable elements. |
| 115 var enabled = this.isEnabled_(); | 133 var enabled = this.isEnabled_(); |
| 116 var canChangeLocalHostState = this.canChangeState(); | 134 var canChangeLocalHostState = this.canChangeState(); |
| 117 var daemonState = ''; | 135 var daemonState = ''; |
| 118 if (!enabled) { | 136 if (!enabled) { |
| 119 daemonState = 'disabled'; | 137 daemonState = 'disabled'; |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 this.setupDialog_.showForPin(); | 171 this.setupDialog_.showForPin(); |
| 154 }; | 172 }; |
| 155 | 173 |
| 156 /** @param {remoting.HostTableEntry} host */ | 174 /** @param {remoting.HostTableEntry} host */ |
| 157 remoting.LocalHostSection.Controller.prototype.rename = function(host) { | 175 remoting.LocalHostSection.Controller.prototype.rename = function(host) { |
| 158 this.hostList_.renameHost(host); | 176 this.hostList_.renameHost(host); |
| 159 }; | 177 }; |
| 160 | 178 |
| 161 }()); | 179 }()); |
| 162 | 180 |
| OLD | NEW |