summaryrefslogtreecommitdiffstats
path: root/remoting
diff options
context:
space:
mode:
authorjamiewalch@google.com <jamiewalch@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2012-12-21 19:46:30 +0000
committerjamiewalch@google.com <jamiewalch@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2012-12-21 19:46:30 +0000
commitaa642faa3e78f0db0c5161e12ed3bcc58018edc2 (patch)
tree70c1569e9d3702a0e76fe0f4f5bc6595b5446957 /remoting
parent24ace8fe9c96bc77511d70c48d54098108f2556c (diff)
downloadchromium_src-aa642faa3e78f0db0c5161e12ed3bcc58018edc2.zip
chromium_src-aa642faa3e78f0db0c5161e12ed3bcc58018edc2.tar.gz
chromium_src-aa642faa3e78f0db0c5161e12ed3bcc58018edc2.tar.bz2
Disable Share button if the host plugin isn't supported.
BUG=155072 Review URL: https://codereview.chromium.org/11663009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@174435 0039d316-1c4b-4281-b951-d872f2087c98
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);