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 @@
"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",
......
......@@ -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 ||
// 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) {
messageId = 'closePromptClient';
}
if (messageId) {
var result = chrome.i18n.getMessage(messageId);
var result = chrome.i18n.getMessage('closePrompt');
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