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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 /** 5 /**
6 * @fileoverview 6 * @fileoverview
7 * Functions related to the 'client screen' for Chromoting. 7 * Functions related to the 'client screen' for Chromoting.
8 */ 8 */
9 9
10 'use strict'; 10 'use strict';
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 205
206 } else if (newState == remoting.ClientSession.State.CONNECTING) { 206 } else if (newState == remoting.ClientSession.State.CONNECTING) {
207 console.log('Connecting as ' + remoting.oauth2.getCachedEmail()); 207 console.log('Connecting as ' + remoting.oauth2.getCachedEmail());
208 208
209 } else if (newState == remoting.ClientSession.State.INITIALIZING) { 209 } else if (newState == remoting.ClientSession.State.INITIALIZING) {
210 console.log('Initializing connection'); 210 console.log('Initializing connection');
211 211
212 } else if (newState == remoting.ClientSession.State.CONNECTED) { 212 } else if (newState == remoting.ClientSession.State.CONNECTED) {
213 if (remoting.clientSession) { 213 if (remoting.clientSession) {
214 clearPin = true; 214 clearPin = true;
215 setConnectionFailedButtonsText_(true);
215 remoting.setMode(remoting.AppMode.IN_SESSION); 216 remoting.setMode(remoting.AppMode.IN_SESSION);
216 remoting.toolbar.center(); 217 remoting.toolbar.center();
217 remoting.toolbar.preview(); 218 remoting.toolbar.preview();
218 updateStatistics_(); 219 updateStatistics_();
219 } 220 }
220 221
221 } else if (newState == remoting.ClientSession.State.CLOSED) { 222 } else if (newState == remoting.ClientSession.State.CLOSED) {
222 if (oldState == remoting.ClientSession.State.CONNECTED) { 223 if (oldState == remoting.ClientSession.State.CONNECTED) {
223 remoting.clientSession.removePlugin(); 224 remoting.clientSession.removePlugin();
224 remoting.clientSession = null; 225 remoting.clientSession = null;
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
340 remoting.clientSession = null; 341 remoting.clientSession = null;
341 } 342 }
342 if (remoting.currentConnectionType == remoting.ConnectionType.It2Me) { 343 if (remoting.currentConnectionType == remoting.ConnectionType.It2Me) {
343 remoting.setMode(remoting.AppMode.CLIENT_CONNECT_FAILED_IT2ME); 344 remoting.setMode(remoting.AppMode.CLIENT_CONNECT_FAILED_IT2ME);
344 } else { 345 } else {
345 remoting.setMode(remoting.AppMode.CLIENT_CONNECT_FAILED_ME2ME); 346 remoting.setMode(remoting.AppMode.CLIENT_CONNECT_FAILED_ME2ME);
346 } 347 }
347 } 348 }
348 349
349 /** 350 /**
351 * Set the text on the buttons shown under the error message if connection
352 * fails.
353 *
354 * @param {boolean} haveConnected Whether the connection is currently
355 * successful.
356 * @return {void} Nothing.
357 */
358 function setConnectionFailedButtonsText_(haveConnected) {
359 if (haveConnected) {
360 var button1 = document.getElementById('client-finished-me2me-button');
361 l10n.localizeElementFromTag(button1, 'OK');
362 button1.setAttribute('autofocus', 'autofocus');
363 var button2 = document.getElementById('client-reconnect-button');
364 l10n.localizeElementFromTag(button2, 'RECONNECT');
365 button2.removeAttribute('autofocus');
366 } else {
367 var button1 = document.getElementById('client-finished-me2me-button');
368 l10n.localizeElementFromTag(button1, 'CANCEL');
369 button1.removeAttribute('autofocus');
370 var button2 = document.getElementById('client-reconnect-button');
371 l10n.localizeElementFromTag(button2, 'OK');
372 button2.setAttribute('autofocus', 'autofocus');
373 }
374 }
375
376 /**
350 * Parse the response from the server to a request to resolve a support id. 377 * Parse the response from the server to a request to resolve a support id.
351 * 378 *
352 * @param {XMLHttpRequest} xhr The XMLHttpRequest object. 379 * @param {XMLHttpRequest} xhr The XMLHttpRequest object.
353 * @return {void} Nothing. 380 * @return {void} Nothing.
354 */ 381 */
355 function parseServerResponse_(xhr) { 382 function parseServerResponse_(xhr) {
356 remoting.supportHostsXhr_ = null; 383 remoting.supportHostsXhr_ = null;
357 console.log('parseServerResponse: xhr = ' + xhr); 384 console.log('parseServerResponse: xhr = ' + xhr);
358 if (xhr.status == 200) { 385 if (xhr.status == 200) {
359 var host = /** @type {{data: {jabberId: string, publicKey: string}}} */ 386 var host = /** @type {{data: {jabberId: string, publicKey: string}}} */
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
469 }; 496 };
470 497
471 /** 498 /**
472 * Start a connection to the specified host, using the cached details 499 * Start a connection to the specified host, using the cached details
473 * and the PIN entered by the user. 500 * and the PIN entered by the user.
474 * 501 *
475 * @return {void} Nothing. 502 * @return {void} Nothing.
476 */ 503 */
477 remoting.connectMe2MeWithPin = function() { 504 remoting.connectMe2MeWithPin = function() {
478 console.log('Connecting to host...'); 505 console.log('Connecting to host...');
506 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.
479 remoting.setMode(remoting.AppMode.CLIENT_CONNECTING); 507 remoting.setMode(remoting.AppMode.CLIENT_CONNECTING);
480 508
481 var host = remoting.hostList.getHostForId(remoting.hostId); 509 var host = remoting.hostList.getHostForId(remoting.hostId);
482 if (!host) { 510 if (!host) {
483 retryConnectOrReportOffline_(); 511 retryConnectOrReportOffline_();
484 return; 512 return;
485 } 513 }
486 remoting.hostJid = host.jabberId; 514 remoting.hostJid = host.jabberId;
487 remoting.hostPublicKey = host.publicKey; 515 remoting.hostPublicKey = host.publicKey;
488 document.getElementById('connected-to').innerText = host.hostName; 516 document.getElementById('connected-to').innerText = host.hostName;
(...skipping 20 matching lines...) Expand all
509 /** @type {string} */ (remoting.oauth2.getCachedEmail()), 537 /** @type {string} */ (remoting.oauth2.getCachedEmail()),
510 remoting.ClientSession.Mode.ME2ME, onClientStateChange_); 538 remoting.ClientSession.Mode.ME2ME, onClientStateChange_);
511 remoting.clientSession.createPluginAndConnect( 539 remoting.clientSession.createPluginAndConnect(
512 document.getElementById('session-mode'), 540 document.getElementById('session-mode'),
513 token); 541 token);
514 remoting.setScaleToFit(remoting.clientSession.getScaleToFit()); 542 remoting.setScaleToFit(remoting.clientSession.getScaleToFit());
515 } else { 543 } else {
516 showConnectError_(remoting.Error.AUTHENTICATION_FAILED); 544 showConnectError_(remoting.Error.AUTHENTICATION_FAILED);
517 } 545 }
518 } 546 }
OLDNEW
« 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