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

Side by Side Diff: remoting/webapp/crd/js/local_host_section.js

Issue 1020743002: [Chromoting] Move app-specific code out of remoting.js (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update sessionConnector check Created 5 years, 9 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 unified diff | Download patch
« no previous file with comments | « remoting/webapp/crd/js/host_setup_dialog.js ('k') | remoting/webapp/crd/js/remoting.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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}
kelvinp 2015/03/19 23:25:20 Make private please.
garykac 2015/03/19 23:49:06 Done.
117 */
118 remoting.LocalHostSection.prototype.isMe2MeInstallable = function() {
119 // The chromoting host is currently not installable on ChromeOS.
120 // For Linux, we have a install package for Ubuntu but not other distros.
121 // Since we cannot tell from javascript alone the Linux distro the client is
122 // on, we don't show the daemon-control UI for Linux unless the host is
123 // installed.
124 return remoting.platformIsWindows() || remoting.platformIsMac();
125 }
126
110 /** @private */ 127 /** @private */
111 remoting.LocalHostSection.prototype.updateUI_ = function() { 128 remoting.LocalHostSection.prototype.updateUI_ = function() {
112 this.hostTableEntry_.setHost(this.host_); 129 this.hostTableEntry_.setHost(this.host_);
113 130
114 // Disable elements. 131 // Disable elements.
115 var enabled = this.isEnabled_(); 132 var enabled = this.isEnabled_();
116 var canChangeLocalHostState = this.canChangeState(); 133 var canChangeLocalHostState = this.canChangeState();
117 var daemonState = ''; 134 var daemonState = '';
118 if (!enabled) { 135 if (!enabled) {
119 daemonState = 'disabled'; 136 daemonState = 'disabled';
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 this.setupDialog_.showForPin(); 170 this.setupDialog_.showForPin();
154 }; 171 };
155 172
156 /** @param {remoting.HostTableEntry} host */ 173 /** @param {remoting.HostTableEntry} host */
157 remoting.LocalHostSection.Controller.prototype.rename = function(host) { 174 remoting.LocalHostSection.Controller.prototype.rename = function(host) {
158 this.hostList_.renameHost(host); 175 this.hostList_.renameHost(host);
159 }; 176 };
160 177
161 }()); 178 }());
162 179
OLDNEW
« no previous file with comments | « remoting/webapp/crd/js/host_setup_dialog.js ('k') | remoting/webapp/crd/js/remoting.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698