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

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: 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..8e9f6d4b6439ecbb96e56b6e842a70f369576622 100644
--- a/remoting/webapp/remoting.js
+++ b/remoting/webapp/remoting.js
@@ -125,13 +125,28 @@ remoting.onEmail = function(email) {
};
/**
+ * Returns whether or not IT2Me is supported via the host NPAPI plugin.
+ *
+ * @return {boolean}
+ */
+function isIt2MeSupported_() {
Jamie 2013/05/07 19:39:23 Nit: IT should be capitalized.
Lambros 2013/05/07 21:59:32 Done.
+ 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