Index: remoting/webapp/host_setup_dialog.js |
diff --git a/remoting/webapp/host_setup_dialog.js b/remoting/webapp/host_setup_dialog.js |
index eb52b7c14c06b775bc6bfc75e269e71698f56dbd..61e139f4b9ce7c63adca27023e0820df6644e6ab 100644 |
--- a/remoting/webapp/host_setup_dialog.js |
+++ b/remoting/webapp/host_setup_dialog.js |
@@ -27,7 +27,7 @@ remoting.HostSetupFlow.State = { |
// Dialog states. |
ASK_PIN: 1, |
- // Used on Mac OS X to prompt the user to manually install a .dmg package. |
+ // Prompts the user to install the host package. |
INSTALL_HOST: 2, |
// Processing states. |
@@ -231,9 +231,8 @@ remoting.HostSetupDialog.prototype.showForStartWithToken_ = |
state != remoting.HostController.State.NOT_INSTALLED && |
state != remoting.HostController.State.INSTALLING; |
- if (navigator.platform.indexOf('Mac') != -1 && !installed) { |
+ if (!installed) |
flow.unshift(remoting.HostSetupFlow.State.INSTALL_HOST); |
- } |
this.startNewFlow_(flow); |
}; |
@@ -325,8 +324,7 @@ remoting.HostSetupDialog.prototype.updateState_ = function() { |
remoting.setMode(remoting.AppMode.HOST_SETUP_ASK_PIN); |
} else if (state == remoting.HostSetupFlow.State.INSTALL_HOST) { |
remoting.setMode(remoting.AppMode.HOST_SETUP_INSTALL); |
- window.location = |
- 'https://dl.google.com/chrome-remote-desktop/chromeremotedesktop.dmg'; |
+ this.installHost_(); |
} else if (state == remoting.HostSetupFlow.State.STARTING_HOST) { |
showProcessingMessage(/*i18n-content*/'HOST_SETUP_STARTING'); |
this.startHost_(); |
@@ -356,6 +354,42 @@ remoting.HostSetupDialog.prototype.updateState_ = function() { |
} |
}; |
+/* |
+ * @returns {string} URL of the host package for the current platform or an |
Jamie
2014/01/31 18:39:15
This function doesn't return anything.
Sergey Ulanov
2014/01/31 23:34:17
Done.
|
+ * empty string if the platform is not supported |
+ */ |
+remoting.HostSetupDialog.prototype.installHost_ = function() { |
+ /** @type {remoting.HostSetupDialog} */ |
+ var that = this; |
+ /** @type {remoting.HostSetupFlow} */ |
+ var flow = this.flow_; |
+ |
+ var hostPackageUrl = ''; |
+ switch (navigator.platform) { |
+ case 'Win32': |
+ hostPackageUrl = 'http://dl.google.com/dl/edgedl/chrome-remote-desktop/chromeremotedesktophost.msi'; |
+ break; |
+ case 'MacIntel': |
+ hostPackageUrl = 'https://dl.google.com/chrome-remote-desktop/chromeremotedesktop.dmg'; |
+ break; |
+ case 'Linux x86_64': |
+ hostPackageUrl = 'https://dl.google.com/linux/direct/chrome-remote-desktop_current_amd64.deb'; |
+ break; |
+ case 'Linux i386': |
+ hostPackageUrl = 'https://dl.google.com/linux/direct/chrome-remote-desktop_current_i386.deb'; |
+ break; |
+ default: |
+ // We never expect to get in this state. Host controls should not be shown |
+ // on unsupported platform. |
+ flow.switchToErrorState(remoting.Error.UNEXPECTED); |
+ that.updateState_(); |
+ return; |
+ } |
+ |
+ // Start downloading the package. |
+ window.location = hostPackageUrl; |
Jamie
2014/01/31 18:39:15
This always assumes the Native Messaging case (ie,
Sergey Ulanov
2014/01/31 23:34:17
Good point. I've updated showForStartWithToken_()
|
+} |
+ |
/** |
* Registers and starts the host. |
*/ |