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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « remoting/webapp/me2mom/_locales/en/messages.json ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 var remoting = remoting || {}; 5 var remoting = remoting || {};
6 6
7 (function() { 7 (function() {
8 'use strict'; 8 'use strict';
9 9
10 window.addEventListener('blur', pluginLostFocus_, false); 10 window.addEventListener('blur', pluginLostFocus_, false);
(...skipping 580 matching lines...) Expand 10 before | Expand all | Expand 10 after
591 */ 591 */
592 remoting.disconnect = function() { 592 remoting.disconnect = function() {
593 if (remoting.session) { 593 if (remoting.session) {
594 remoting.session.disconnect(); 594 remoting.session.disconnect();
595 remoting.session = null; 595 remoting.session = null;
596 remoting.debug.log('Disconnected.'); 596 remoting.debug.log('Disconnected.');
597 remoting.setMode(remoting.AppMode.CLIENT_SESSION_FINISHED); 597 remoting.setMode(remoting.AppMode.CLIENT_SESSION_FINISHED);
598 } 598 }
599 } 599 }
600 600
601 /** If the client is connected, or the host is shared, prompt before closing. 601 /**
602 * If the client is connected, or the host is shared, prompt before closing.
602 * 603 *
603 * @return {(string|void)} The prompt string if a connection is active. 604 * @return {(string|void)} The prompt string if a connection is active.
604 */ 605 */
605 remoting.promptClose = function() { 606 remoting.promptClose = function() {
606 var messageId = null; 607 // Prompt to close if the host is in any state other than unshared, or if the
607 if (remoting.getMajorMode() == remoting.AppMode.HOST && 608 // client is connecting or has already connected.
608 remoting.currentMode != remoting.AppMode.HOST_UNSHARED) { 609 if ((remoting.getMajorMode() == remoting.AppMode.HOST &&
609 messageId = 'closePromptHost'; 610 remoting.currentMode != remoting.AppMode.HOST_UNSHARED) ||
610 } else if (remoting.getMajorMode() == remoting.AppMode.IN_SESSION || 611 remoting.getMajorMode() == remoting.AppMode.IN_SESSION ||
611 remoting.currentMode == remoting.AppMode.CLIENT_CONNECTING) { 612 remoting.currentMode == remoting.AppMode.CLIENT_CONNECTING) {
612 messageId = 'closePromptClient'; 613 var result = chrome.i18n.getMessage('closePrompt');
613 }
614 if (messageId) {
615 var result = chrome.i18n.getMessage(messageId);
616 return result; 614 return result;
617 } 615 }
618 } 616 }
619 617
620 }()); 618 }());
OLDNEW
« 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