Chromium Code Reviews| 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; |