From 1d9b53df4f4643293bcf2840c5099d6b509ab85e Mon Sep 17 00:00:00 2001 From: "jamiewalch@google.com" Date: Tue, 23 Aug 2011 00:29:25 +0000 Subject: Make client disconnect message endpoint-neutral and show it for host disconnect. BUG=93461, 93462 TEST=Manual (use remoting.setMode) Review URL: http://codereview.chromium.org/7712015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@97786 0039d316-1c4b-4281-b951-d872f2087c98 --- remoting/webapp/me2mom/_locales/en/messages.json | 4 ++-- remoting/webapp/me2mom/choice.html | 20 +++++++++++++------- remoting/webapp/me2mom/remoting.js | 21 ++++++++++++--------- 3 files changed, 27 insertions(+), 18 deletions(-) diff --git a/remoting/webapp/me2mom/_locales/en/messages.json b/remoting/webapp/me2mom/_locales/en/messages.json index 867b696..1a6ccc6 100644 --- a/remoting/webapp/me2mom/_locales/en/messages.json +++ b/remoting/webapp/me2mom/_locales/en/messages.json @@ -146,8 +146,8 @@ "description": "Text shown while generating an access code." }, "MESSAGE_SESSION_FINISHED": { - "message": "You are no longer connected to the remote desktop.", - "description": "Message displayed when the client has disconnected." + "message": "Your Chromoting session has ended.", + "description": "Message displayed when the client or host has disconnected." }, "MESSAGE_SHARED": { "message": "Your desktop is currently being shared with $user$.", diff --git a/remoting/webapp/me2mom/choice.html b/remoting/webapp/me2mom/choice.html index b8c2a2a..9661ea5 100644 --- a/remoting/webapp/me2mom/choice.html +++ b/remoting/webapp/me2mom/choice.html @@ -136,16 +136,22 @@ found in the LICENSE file.
+ i18n-content="ERROR_UNABLE_TO_GET_TOKEN"> -
- -
+
+
+ +
+ +
+
diff --git a/remoting/webapp/me2mom/remoting.js b/remoting/webapp/me2mom/remoting.js index 3b3d637..c1736e6 100644 --- a/remoting/webapp/me2mom/remoting.js +++ b/remoting/webapp/me2mom/remoting.js @@ -31,6 +31,7 @@ remoting.AppMode = { HOST_WAITING_FOR_CONNECTION: 'host.waiting-for-connection', HOST_SHARED: 'host.shared', HOST_SHARE_FAILED: 'host.share-failed', + HOST_SHARE_FINISHED: 'host.share-finished', IN_SESSION: 'in-session' }; @@ -324,7 +325,7 @@ function onStateChanged_() { // If an error is being displayed, then the plugin should not be able to // hide it by setting the state. Errors must be dismissed by the user // clicking OK, which puts the app into mode HOST_UNSHARED. - remoting.setMode(remoting.AppMode.HOST_UNSHARED); + remoting.setMode(remoting.AppMode.HOST_SHARE_FINISHED); } plugin.parentNode.removeChild(plugin); } else if (state == plugin.ERROR) { @@ -619,14 +620,16 @@ remoting.disconnect = function() { * @return {(string|void)} The prompt string if a connection is active. */ remoting.promptClose = function() { - // Prompt to close if the host is in any state other than unshared, or if the - // client is connecting or has already connected. - if ((remoting.getMajorMode() == remoting.AppMode.HOST && - remoting.currentMode != remoting.AppMode.HOST_UNSHARED) || - remoting.getMajorMode() == remoting.AppMode.IN_SESSION || - remoting.currentMode == remoting.AppMode.CLIENT_CONNECTING) { - var result = chrome.i18n.getMessage('CLOSE_PROMPT'); - return result; + switch (remoting.currentMode) { + case remoting.AppMode.CLIENT_CONNECTING: + case remoting.AppMode.HOST_WAITING_FOR_CODE: + case remoting.AppMode.HOST_WAITING_FOR_CONNECTION: + case remoting.AppMode.HOST_SHARED: + case remoting.AppMode.IN_SESSION: + var result = chrome.i18n.getMessage('CLOSE_PROMPT'); + return result; + default: + return NULL; } } -- cgit v1.1