summaryrefslogtreecommitdiffstats
path: root/remoting
diff options
context:
space:
mode:
authorjamiewalch@google.com <jamiewalch@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-08 23:07:57 +0000
committerjamiewalch@google.com <jamiewalch@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-08 23:07:57 +0000
commitd0dc376040e9a814739edf5a234fefa1357a8709 (patch)
treee7317e9ed89b28114f20376d22a76743fca1e119 /remoting
parent2823e2f1e2ac8289cca46d121089ffde1116e6db (diff)
downloadchromium_src-d0dc376040e9a814739edf5a234fefa1357a8709.zip
chromium_src-d0dc376040e9a814739edf5a234fefa1357a8709.tar.gz
chromium_src-d0dc376040e9a814739edf5a234fefa1357a8709.tar.bz2
Use the same disconnect prompt for client and host.
BUG=None TEST=Manual Review URL: http://codereview.chromium.org/7598012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@95902 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting')
-rw-r--r--remoting/webapp/me2mom/_locales/en/messages.json8
-rw-r--r--remoting/webapp/me2mom/remoting.js20
2 files changed, 11 insertions, 17 deletions
diff --git a/remoting/webapp/me2mom/_locales/en/messages.json b/remoting/webapp/me2mom/_locales/en/messages.json
index 208a3c2..d8aee99 100644
--- a/remoting/webapp/me2mom/_locales/en/messages.json
+++ b/remoting/webapp/me2mom/_locales/en/messages.json
@@ -11,13 +11,9 @@
"message": "Cancel",
"description": "Label for general-purpose Cancel buttons"
},
- "closePromptClient": {
+ "closePrompt": {
"message": "Navigating away from this page will end your Chromoting session.",
- "description": "Message shown when the client tab is closed while a connection is active."
- },
- "closePromptHost": {
- "message": "Navigating away from this page will disconnect the Chromoting viewer.",
- "description": "Message shown when the host tab is closed while a connection is active."
+ "description": "Message shown when the Chromoting client tab is closed while a connection is active."
},
"connectButton": {
"message": "Connect",
diff --git a/remoting/webapp/me2mom/remoting.js b/remoting/webapp/me2mom/remoting.js
index aedac36..484212e 100644
--- a/remoting/webapp/me2mom/remoting.js
+++ b/remoting/webapp/me2mom/remoting.js
@@ -598,21 +598,19 @@ remoting.disconnect = function() {
}
}
-/** If the client is connected, or the host is shared, prompt before closing.
+/**
+ * If the client is connected, or the host is shared, prompt before closing.
*
* @return {(string|void)} The prompt string if a connection is active.
*/
remoting.promptClose = function() {
- var messageId = null;
- if (remoting.getMajorMode() == remoting.AppMode.HOST &&
- remoting.currentMode != remoting.AppMode.HOST_UNSHARED) {
- messageId = 'closePromptHost';
- } else if (remoting.getMajorMode() == remoting.AppMode.IN_SESSION ||
- remoting.currentMode == remoting.AppMode.CLIENT_CONNECTING) {
- messageId = 'closePromptClient';
- }
- if (messageId) {
- var result = chrome.i18n.getMessage(messageId);
+ // 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('closePrompt');
return result;
}
}