diff options
author | lambroslambrou@chromium.org <lambroslambrou@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-04-05 01:11:47 +0000 |
---|---|---|
committer | lambroslambrou@chromium.org <lambroslambrou@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-04-05 01:11:47 +0000 |
commit | 3559d3b7545cd5219eb99b895c848517d565a57a (patch) | |
tree | e692808a7249e986ae51e0a0345e21f780dec4f4 /remoting/webapp | |
parent | e2557dfcf24d59cfab0fca0580926b708122e180 (diff) | |
download | chromium_src-3559d3b7545cd5219eb99b895c848517d565a57a.zip chromium_src-3559d3b7545cd5219eb99b895c848517d565a57a.tar.gz chromium_src-3559d3b7545cd5219eb99b895c848517d565a57a.tar.bz2 |
Chromoting Me2Me installation flow for Mac.
BUG=None
TEST=Manual
Review URL: https://chromiumcodereview.appspot.com/9979023
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@130800 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/webapp')
-rw-r--r-- | remoting/webapp/_locales/en/messages.json | 8 | ||||
-rw-r--r-- | remoting/webapp/event_handlers.js | 8 | ||||
-rw-r--r-- | remoting/webapp/host_setup_dialog.js | 68 | ||||
-rw-r--r-- | remoting/webapp/main.html | 21 | ||||
-rw-r--r-- | remoting/webapp/ui_mode.js | 2 |
5 files changed, 88 insertions, 19 deletions
diff --git a/remoting/webapp/_locales/en/messages.json b/remoting/webapp/_locales/en/messages.json index 2c7458a..dd8f968 100644 --- a/remoting/webapp/_locales/en/messages.json +++ b/remoting/webapp/_locales/en/messages.json @@ -230,6 +230,14 @@ "message": "Failed to start remote access service.", "description": "Message shown when host service fails to start when enabling the host on local computer." }, + "HOST_SETUP_INSTALL": { + "message": "Chrome is downloading the Chrome Remote Desktop Host installer. Once the download is complete, please run the installer before continuing.", + "description": "Message shown when user is asked to manually install the Host components." + }, + "HOST_SETUP_INSTALL_PENDING": { + "message": "Please run the installer before continuing.", + "description": "Message shown when user has attempted to continue past the manual install dialog, but the Host components are not yet installed." + }, "HOST_SETUP_REGISTRATION_FAILED": { "message": "Failed to register this computer.", "description": "Message shown when host registration fails when enabling the host on local computer." diff --git a/remoting/webapp/event_handlers.js b/remoting/webapp/event_handlers.js index e8e8d04..1fe85ea 100644 --- a/remoting/webapp/event_handlers.js +++ b/remoting/webapp/event_handlers.js @@ -77,7 +77,13 @@ function onLoad() { { event: 'click', id: 'host-config-done-dismiss', fn: function() { remoting.setMode(remoting.AppMode.HOME); } }, { event: 'click', id: 'host-config-error-dismiss', - fn: function() { remoting.setMode(remoting.AppMode.HOME); } } + fn: function() { remoting.setMode(remoting.AppMode.HOME); } }, + { event: 'click', id: 'host-config-install-continue', + fn: function() { remoting.hostSetupDialog.onInstallDialogOk(); } }, + { event: 'click', id: 'host-config-install-dismiss', + fn: function() { remoting.hostSetupDialog.hide(); } }, + { event: 'click', id: 'host-config-install-retry', fn: function() { + remoting.hostSetupDialog.onInstallDialogRetry(); } } ]; for (var i = 0; i < actions.length; ++i) { diff --git a/remoting/webapp/host_setup_dialog.js b/remoting/webapp/host_setup_dialog.js index 0ba2cae..35b60c3 100644 --- a/remoting/webapp/host_setup_dialog.js +++ b/remoting/webapp/host_setup_dialog.js @@ -9,7 +9,7 @@ var remoting = remoting || {}; /** * @param {Array.<remoting.HostSetupFlow.State>} sequence Sequence of - * steps for the flow. + * steps for the flow. * @constructor */ remoting.HostSetupFlow = function(sequence) { @@ -28,22 +28,25 @@ remoting.HostSetupFlow.State = { // Dialog states. ASK_PIN: 1, + // Used on Mac OS X to prompt the user to manually install a .dmg package. + INSTALL_HOST: 2, + // Processing states. - REGISTERING_HOST: 2, - STARTING_HOST: 3, - UPDATING_PIN: 4, - STOPPING_HOST: 5, + REGISTERING_HOST: 3, + STARTING_HOST: 4, + UPDATING_PIN: 5, + STOPPING_HOST: 6, // Done states. - HOST_STARTED: 6, - UPDATED_PIN: 7, - HOST_STOPPED: 8, + HOST_STARTED: 7, + UPDATED_PIN: 8, + HOST_STOPPED: 9, // Failure states. - REGISTRATION_FAILED: 9, - START_HOST_FAILED: 10, - UPDATE_PIN_FAILED: 11, - STOP_HOST_FAILED: 12 + REGISTRATION_FAILED: 10, + START_HOST_FAILED: 11, + UPDATE_PIN_FAILED: 12, + STOP_HOST_FAILED: 13 }; /** @return {remoting.HostSetupFlow.State} Current state of the flow. */ @@ -130,11 +133,18 @@ remoting.HostSetupDialog = function(daemon) { * @return {void} Nothing. */ remoting.HostSetupDialog.prototype.showForStart = function() { - this.startNewFlow_( - [remoting.HostSetupFlow.State.ASK_PIN, - remoting.HostSetupFlow.State.REGISTERING_HOST, - remoting.HostSetupFlow.State.STARTING_HOST, - remoting.HostSetupFlow.State.HOST_STARTED]); + var flow = [ + remoting.HostSetupFlow.State.ASK_PIN, + remoting.HostSetupFlow.State.REGISTERING_HOST, + remoting.HostSetupFlow.State.STARTING_HOST, + remoting.HostSetupFlow.State.HOST_STARTED]; + + if (navigator.platform.indexOf('Mac') != -1 && + this.daemon_.state() == remoting.DaemonPlugin.State.NOT_INSTALLED) { + flow.unshift(remoting.HostSetupFlow.State.INSTALL_HOST); + } + + this.startNewFlow_(flow); }; /** @@ -214,6 +224,10 @@ remoting.HostSetupDialog.prototype.updateState_ = function() { this.hide(); } else if (state == remoting.HostSetupFlow.State.ASK_PIN) { 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 = + 'http://dl.google.com/chrome-remote-desktop/chromeremotedesktop.dmg'; } else if (state == remoting.HostSetupFlow.State.REGISTERING_HOST) { showProcessingMessage(/*i18n-content*/'HOST_SETUP_STARTING'); this.registerHost_(); @@ -473,5 +487,25 @@ remoting.HostSetupDialog.validPin_ = function(pin) { return true; } +/** + * @return {void} Nothing. + */ +remoting.HostSetupDialog.prototype.onInstallDialogOk = function() { + var state = this.daemon_.state(); + if (state == remoting.DaemonPlugin.State.STOPPED) { + this.flow_.switchToNextStep(remoting.DaemonPlugin.AsyncResult.OK); + this.updateState_(); + } else { + remoting.setMode(remoting.AppMode.HOST_SETUP_INSTALL_PENDING); + } +} + +/** + * @return {void} Nothing. + */ +remoting.HostSetupDialog.prototype.onInstallDialogRetry = function() { + remoting.setMode(remoting.AppMode.HOST_SETUP_INSTALL); +} + /** @type {remoting.HostSetupDialog} */ remoting.hostSetupDialog = null; diff --git a/remoting/webapp/main.html b/remoting/webapp/main.html index 1372459..5b3f8af 100644 --- a/remoting/webapp/main.html +++ b/remoting/webapp/main.html @@ -196,10 +196,10 @@ found in the LICENSE file. <div id="host-setup-dialog" class="kd-modaldialog" data-ui-mode="home.host-setup"> - <p class="message" i18n-content="HOST_SETUP_DIALOG_DESCRIPTION"></p> <form id="ask-pin-form" data-ui-mode="home.host-setup.ask-pin" action=""> + <p class="message" i18n-content="HOST_SETUP_DIALOG_DESCRIPTION"></p> <div> <label for="daemon-pin-entry" i18n-content="ASK_PIN_DIALOG_LABEL" @@ -247,6 +247,25 @@ found in the LICENSE file. <button id="host-config-error-dismiss" i18n-content="OK"></button> </div> </div> + <div data-ui-mode="home.host-setup.install" hidden> + <div class="message" i18n-content="HOST_SETUP_INSTALL"></div> + <div class="button-row"> + <div class="box-spacer"></div> + <button id="host-config-install-continue" + i18n-content="OK"></button> + <button id="host-config-install-dismiss" + i18n-content="CANCEL"></button> + </div> + </div> + <div data-ui-mode="home.host-setup.install-pending" hidden> + <div class="message" + i18n-content="HOST_SETUP_INSTALL_PENDING"></div> + <div class="button-row"> + <div class="box-spacer"></div> + <button id="host-config-install-retry" + i18n-content="OK"></button> + </div> + </div> </div> <!-- host-setup-dialog --> <div id="auth-dialog" diff --git a/remoting/webapp/ui_mode.js b/remoting/webapp/ui_mode.js index cd224fc..0990cfd 100644 --- a/remoting/webapp/ui_mode.js +++ b/remoting/webapp/ui_mode.js @@ -39,6 +39,8 @@ remoting.AppMode = { HISTORY: 'home.history', CONFIRM_HOST_DELETE: 'home.confirm-host-delete', HOST_SETUP: 'home.host-setup', + HOST_SETUP_INSTALL: 'home.host-setup.install', + HOST_SETUP_INSTALL_PENDING: 'home.host-setup.install-pending', HOST_SETUP_ASK_PIN: 'home.host-setup.ask-pin', HOST_SETUP_PROCESSING: 'home.host-setup.processing', HOST_SETUP_DONE: 'home.host-setup.done', |