summaryrefslogtreecommitdiffstats
path: root/remoting
diff options
context:
space:
mode:
Diffstat (limited to 'remoting')
-rw-r--r--remoting/webapp/host_controller.js12
-rw-r--r--remoting/webapp/remoting.js2
2 files changed, 14 insertions, 0 deletions
diff --git a/remoting/webapp/host_controller.js b/remoting/webapp/host_controller.js
index 53e332e..68e538d 100644
--- a/remoting/webapp/host_controller.js
+++ b/remoting/webapp/host_controller.js
@@ -24,10 +24,13 @@ remoting.HostController = function() {
console.log('Host version: ' + version);
}
};
+ /** @type {boolean} @private */
+ this.pluginSupported_ = true;
try {
this.plugin_.getDaemonVersion(printVersion);
} catch (err) {
console.log('Host version not available.');
+ this.pluginSupported_ = false;
}
};
@@ -68,6 +71,15 @@ remoting.HostController.prototype.isInstalled = function() {
state != remoting.HostController.State.INSTALLING;
}
+/**
+ * Checks whether or not the host plugin is valid.
+ *
+ * @return {boolean} True if the plugin is supported and loaded; false
+ * otherwise.
+ */
+remoting.HostController.prototype.isPluginSupported = function() {
+ return this.pluginSupported_;
+};
/**
* @param {function(boolean, boolean, boolean):void} callback Callback to be
diff --git a/remoting/webapp/remoting.js b/remoting/webapp/remoting.js
index 83ce05d..feda0ff 100644
--- a/remoting/webapp/remoting.js
+++ b/remoting/webapp/remoting.js
@@ -111,6 +111,8 @@ remoting.onEmail = function(email) {
// also if the user cancels pin entry or the connection in session mode.
remoting.initDaemonUi = function () {
remoting.hostController = new remoting.HostController();
+ document.getElementById('share-button').disabled =
+ !remoting.hostController.isPluginSupported();
remoting.setMode(getAppStartupMode_());
remoting.hostSetupDialog =
new remoting.HostSetupDialog(remoting.hostController);