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

Unified Diff: remoting/webapp/crd/js/remoting.js

Issue 695363002: Remote assistance on Chrome OS Part VI - Enable It2me on ChromeOS in the webapp (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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/crd/js/client_session.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/webapp/crd/js/remoting.js
diff --git a/remoting/webapp/crd/js/remoting.js b/remoting/webapp/crd/js/remoting.js
index 50ff475e495cc337a4e1365a6a2951c07c050c12..4a843c9938ae335b7da0e5e57c295354ee492938 100644
--- a/remoting/webapp/crd/js/remoting.js
+++ b/remoting/webapp/crd/js/remoting.js
@@ -117,13 +117,17 @@ remoting.init = function() {
remoting.initModalDialogs();
- if (isHostModeSupported_()) {
- var noShare = document.getElementById('chrome-os-no-share');
- noShare.parentNode.removeChild(noShare);
- } else {
- var button = document.getElementById('share-button');
- button.disabled = true;
- }
+ isHostModeSupported_().then(
+ /** @param {Boolean} supported */
+ function(supported){
+ if (supported) {
Jamie 2014/11/03 19:41:34 Part of the responsibility of the init method is t
Jamie 2014/11/03 23:15:11 Given the difficulty in fixing this, the relative
+ var noShare = document.getElementById('chrome-os-no-share');
+ noShare.parentNode.removeChild(noShare);
+ } else {
+ var button = document.getElementById('share-button');
+ button.disabled = true;
+ }
+ });
/**
* @return {Promise} A promise that resolves to the id of the current
@@ -204,16 +208,6 @@ remoting.init = function() {
};
/**
- * Returns whether or not IT2Me is supported via the host NPAPI plugin.
- *
- * @return {boolean}
- */
-function isIT2MeSupported_() {
- // Currently, IT2Me on Chromebooks is not supported.
- return !remoting.runningOnChromeOS();
-}
-
-/**
* Returns true if the current platform is fully supported. It's only used when
* we detect that host native messaging components are not installed. In that
* case the result of this function determines if the webapp should show the
@@ -249,7 +243,6 @@ remoting.onEmail = function(email) {
*/
remoting.initHomeScreenUi = function() {
remoting.hostController = new remoting.HostController();
- document.getElementById('share-button').disabled = !isIT2MeSupported_();
remoting.setMode(remoting.AppMode.HOME);
remoting.hostSetupDialog =
new remoting.HostSetupDialog(remoting.hostController);
@@ -401,13 +394,18 @@ function pluginGotCopy_(eventUncast) {
}
/**
- * Returns whether Host mode is supported on this platform.
+ * Returns whether Host mode is supported on this platform for It2me.
*
- * @return {boolean} True if Host mode is supported.
+ * @return {Promise} Resolves to true if Host mode is supported.
*/
function isHostModeSupported_() {
- // Currently, sharing on Chromebooks is not supported.
- return !remoting.runningOnChromeOS();
+ if (!remoting.platformIsChromeOS()) {
+ return Promise.resolve(true);
+ }
+ // Sharing on Chrome OS is currently behind a flag.
+ // isInstalled() will return false if the flag is disabled.
+ var hostInstaller = new remoting.HostInstaller();
+ return hostInstaller.isInstalled();
}
/**
« no previous file with comments | « remoting/webapp/crd/js/client_session.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698