Commit d0dc3760 authored by jamiewalch@google.com's avatar jamiewalch@google.com

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
parent 2823e2f1
...@@ -11,13 +11,9 @@ ...@@ -11,13 +11,9 @@
"message": "Cancel", "message": "Cancel",
"description": "Label for general-purpose Cancel buttons" "description": "Label for general-purpose Cancel buttons"
}, },
"closePromptClient": { "closePrompt": {
"message": "Navigating away from this page will end your Chromoting session.", "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." "description": "Message shown when the Chromoting 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."
}, },
"connectButton": { "connectButton": {
"message": "Connect", "message": "Connect",
......
...@@ -598,21 +598,19 @@ remoting.disconnect = function() { ...@@ -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. * @return {(string|void)} The prompt string if a connection is active.
*/ */
remoting.promptClose = function() { remoting.promptClose = function() {
var messageId = null; // Prompt to close if the host is in any state other than unshared, or if the
if (remoting.getMajorMode() == remoting.AppMode.HOST && // client is connecting or has already connected.
remoting.currentMode != remoting.AppMode.HOST_UNSHARED) { if ((remoting.getMajorMode() == remoting.AppMode.HOST &&
messageId = 'closePromptHost'; remoting.currentMode != remoting.AppMode.HOST_UNSHARED) ||
} else if (remoting.getMajorMode() == remoting.AppMode.IN_SESSION || remoting.getMajorMode() == remoting.AppMode.IN_SESSION ||
remoting.currentMode == remoting.AppMode.CLIENT_CONNECTING) { remoting.currentMode == remoting.AppMode.CLIENT_CONNECTING) {
messageId = 'closePromptClient'; var result = chrome.i18n.getMessage('closePrompt');
}
if (messageId) {
var result = chrome.i18n.getMessage(messageId);
return result; return result;
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment