summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjamiewalch@google.com <jamiewalch@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-23 00:29:25 +0000
committerjamiewalch@google.com <jamiewalch@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-23 00:29:25 +0000
commit1d9b53df4f4643293bcf2840c5099d6b509ab85e (patch)
tree5ad764773290162558ccfae5fe670192b4788556
parent9f60c15133040d1cd79ba3d7cff4428351be32cd (diff)
downloadchromium_src-1d9b53df4f4643293bcf2840c5099d6b509ab85e.zip
chromium_src-1d9b53df4f4643293bcf2840c5099d6b509ab85e.tar.gz
chromium_src-1d9b53df4f4643293bcf2840c5099d6b509ab85e.tar.bz2
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
-rw-r--r--remoting/webapp/me2mom/_locales/en/messages.json4
-rw-r--r--remoting/webapp/me2mom/choice.html20
-rw-r--r--remoting/webapp/me2mom/remoting.js21
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.
<div data-ui-mode="host.share-failed" class="message">
<span id="unable-to-get-token" class="error-state"
- i18n-content="ERROR_UNABLE_TO_GET_TOKEN">
+ i18n-content="ERROR_UNABLE_TO_GET_TOKEN">
</span>
- <div class="centered-button">
- <button type="button" class="big-button"
- onclick="remoting.setMode('host.unshared');"
- i18n-content="OK">
- </button>
- </div>
</div> <!-- host.share-failed -->
+ <div data-ui-mode="host.share-finished" class="message"
+ i18n-content="MESSAGE_SESSION_FINISHED">
+ </div> <!-- host.share-finished -->
+
+ <div class="centered-button"
+ data-ui-mode="host.share-failed host.share-finished">
+ <button type="button" class="big-button"
+ onclick="remoting.setMode('host.unshared');"
+ i18n-content="OK">
+ </button>
+ </div>
+
<div id="host-plugin-container"></div>
</div> <!-- host-panel -->
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;
}
}