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

Unified Diff: remoting/webapp/remoting.js

Issue 15017006: Move test for enabling/disabling It2Me Share button (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix nit Created 7 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/webapp/main.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/webapp/remoting.js
diff --git a/remoting/webapp/remoting.js b/remoting/webapp/remoting.js
index 0989777bce319f6b04724dc4fb5262f1e1a1b95b..68928fe3bf66274a03000af0945e4559ff766e30 100644
--- a/remoting/webapp/remoting.js
+++ b/remoting/webapp/remoting.js
@@ -125,13 +125,27 @@ remoting.onEmail = function(email) {
};
/**
+ * Returns whether or not IT2Me is supported via the host NPAPI plugin.
+ *
+ * @return {boolean}
+ */
+function isIT2MeSupported_() {
+ var container = document.getElementById('host-plugin-container');
+ /** @type {remoting.HostPlugin} */
+ var plugin = remoting.HostSession.createPlugin();
+ container.appendChild(plugin);
+ var result = plugin.hasOwnProperty('REQUESTED_ACCESS_CODE');
+ container.removeChild(plugin);
+ return result;
+}
+
+/**
* initHomeScreenUi is called if the app is not starting up in session mode,
* and also if the user cancels pin entry or the connection in session mode.
*/
remoting.initHomeScreenUi = function() {
remoting.hostController = new remoting.HostController();
- document.getElementById('share-button').disabled =
- !remoting.hostController.isPluginSupported();
+ document.getElementById('share-button').disabled = !isIT2MeSupported_();
remoting.setMode(remoting.AppMode.HOME);
if (!remoting.oauth2.isAuthenticated()) {
document.getElementById('auth-dialog').hidden = false;
« no previous file with comments | « remoting/webapp/main.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698