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

Unified Diff: remoting/webapp/client_screen.js

Issue 9827002: [Chromoting] Improve the text on the buttons in the connection-failed dialog. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 9 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/webapp/client_screen.js
diff --git a/remoting/webapp/client_screen.js b/remoting/webapp/client_screen.js
index 5890518400270bb50245507b595abeff723a057c..489a94ef55dd72df38650ebc4566239024235e30 100644
--- a/remoting/webapp/client_screen.js
+++ b/remoting/webapp/client_screen.js
@@ -212,6 +212,7 @@ function onClientStateChange_(oldState, newState) {
} else if (newState == remoting.ClientSession.State.CONNECTED) {
if (remoting.clientSession) {
clearPin = true;
+ setConnectionFailedButtonsText_(true);
remoting.setMode(remoting.AppMode.IN_SESSION);
remoting.toolbar.center();
remoting.toolbar.preview();
@@ -347,6 +348,32 @@ function showConnectError_(errorTag) {
}
/**
+ * Set the text on the buttons shown under the error message if connection
+ * fails.
+ *
+ * @param {boolean} haveConnected Whether the connection is currently
+ * successful.
+ * @return {void} Nothing.
+ */
+function setConnectionFailedButtonsText_(haveConnected) {
+ if (haveConnected) {
+ var button1 = document.getElementById('client-finished-me2me-button');
+ l10n.localizeElementFromTag(button1, 'OK');
+ button1.setAttribute('autofocus', 'autofocus');
+ var button2 = document.getElementById('client-reconnect-button');
+ l10n.localizeElementFromTag(button2, 'RECONNECT');
+ button2.removeAttribute('autofocus');
+ } else {
+ var button1 = document.getElementById('client-finished-me2me-button');
+ l10n.localizeElementFromTag(button1, 'CANCEL');
+ button1.removeAttribute('autofocus');
+ var button2 = document.getElementById('client-reconnect-button');
+ l10n.localizeElementFromTag(button2, 'OK');
+ button2.setAttribute('autofocus', 'autofocus');
+ }
+}
+
+/**
* Parse the response from the server to a request to resolve a support id.
*
* @param {XMLHttpRequest} xhr The XMLHttpRequest object.
@@ -476,6 +503,7 @@ remoting.connectMe2Me = function(hostId, retryIfOffline) {
*/
remoting.connectMe2MeWithPin = function() {
console.log('Connecting to host...');
+ setConnectionFailedButtonsText_(false);
Jamie 2012/03/21 22:52:13 This isn't strictly necessary because the HTML has
simonmorris 2012/03/22 00:02:42 Done.
remoting.setMode(remoting.AppMode.CLIENT_CONNECTING);
var host = remoting.hostList.getHostForId(remoting.hostId);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698