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

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

Issue 874683002: Fix host installation on i686 Linux. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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
« remoting/webapp/crd/js/crd_main.js ('K') | « remoting/webapp/crd/js/crd_main.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/host_installer.js
diff --git a/remoting/webapp/crd/js/host_installer.js b/remoting/webapp/crd/js/host_installer.js
index 8ae9b36b659c14631339de4fb9eff37ed88d4ff8..36b8d928b3e6669bfadbb93a5516e03cad4c9dee 100644
--- a/remoting/webapp/crd/js/host_installer.js
+++ b/remoting/webapp/crd/js/host_installer.js
@@ -78,28 +78,40 @@ remoting.HostInstaller.prototype.isInstalled = function() {
});
};
+/** @type {Object.<string,string>} */
+remoting.HostInstaller.HOST_DOWNLOAD_URLS = {
kelvinp 2015/01/23 21:15:33 With the new JS Compiler, you can make this truly
Sergey Ulanov 2015/01/23 21:26:19 Done.
+ 'Win32': 'http://dl.google.com/dl/edgedl/chrome-remote-desktop/' +
+ 'chromeremotedesktophost.msi',
+ 'Win64': 'http://dl.google.com/dl/edgedl/chrome-remote-desktop/' +
+ 'chromeremotedesktophost.msi',
+ 'MacIntel': 'https://dl.google.com/chrome-remote-desktop/' +
+ 'chromeremotedesktop.dmg',
+ 'Linux x86_64': 'https://dl.google.com/linux/direct/' +
+ 'chrome-remote-desktop_current_amd64.deb',
+ 'Linux i386': 'https://dl.google.com/linux/direct/' +
+ 'chrome-remote-desktop_current_i386.deb',
+ 'Linux i686': 'https://dl.google.com/linux/direct/' +
+ 'chrome-remote-desktop_current_i386.deb'
+};
+
+/**
+ * Returns true if the host is installable on the current platform.
+ * @returns {boolean}
+ */
+remoting.HostInstaller.canInstall = function() {
+ return !!remoting.HostInstaller.HOST_DOWNLOAD_URLS[navigator.platform];
+};
+
/**
* @throws {Error} Throws if there is no matching host binary for the current
* platform.
*/
remoting.HostInstaller.prototype.download = function() {
- /** @type {Object.<string,string>} */
- var hostDownloadUrls = {
- 'Win32' : 'http://dl.google.com/dl/edgedl/chrome-remote-desktop/' +
- 'chromeremotedesktophost.msi',
- 'Win64' : 'http://dl.google.com/dl/edgedl/chrome-remote-desktop/' +
- 'chromeremotedesktophost.msi',
- 'MacIntel' : 'https://dl.google.com/chrome-remote-desktop/' +
- 'chromeremotedesktop.dmg',
- 'Linux x86_64' : 'https://dl.google.com/linux/direct/' +
- 'chrome-remote-desktop_current_amd64.deb',
- 'Linux i386' : 'https://dl.google.com/linux/direct/' +
- 'chrome-remote-desktop_current_i386.deb'
- };
-
- var hostPackageUrl = hostDownloadUrls[navigator.platform];
+ var hostPackageUrl =
+ remoting.HostInstaller.HOST_DOWNLOAD_URLS[navigator.platform];
if (hostPackageUrl === undefined) {
- throw new Error(remoting.Error.CANCELLED);
+ console.error("Tried to install host on " + navigator.platform);
+ throw new Error(remoting.Error.UNEXPECTED);
}
// Start downloading the package.
« remoting/webapp/crd/js/crd_main.js ('K') | « remoting/webapp/crd/js/crd_main.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698