Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(935)

Unified Diff: remoting/webapp/me2mom/remoting.js

Issue 7598012: Use the same disconnect prompt for client and host. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/webapp/me2mom/_locales/en/messages.json ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/webapp/me2mom/remoting.js
diff --git a/remoting/webapp/me2mom/remoting.js b/remoting/webapp/me2mom/remoting.js
index aedac36af7edfdbdb54ab5bca478ff44442ef320..484212ef683277797d6042c08a80ff30c13122d5 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;
}
}
« no previous file with comments | « remoting/webapp/me2mom/_locales/en/messages.json ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698