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

Side by Side Diff: remoting/webapp/app_remoting/js/app_remoting.js

Issue 963103004: Remove getCached* methods from remoting.Identity. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase and jscompile fixes. Created 5 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
« no previous file with comments | « no previous file | remoting/webapp/crd/js/host_controller.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 * This class implements the functionality that is specific to application 7 * This class implements the functionality that is specific to application
8 * remoting ("AppRemoting" or AR). 8 * remoting ("AppRemoting" or AR).
9 */ 9 */
10 10
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 return ''; 231 return '';
232 }; 232 };
233 233
234 /** 234 /**
235 * Called when a new session has been connected. 235 * Called when a new session has been connected.
236 * 236 *
237 * @param {remoting.ClientSession} clientSession 237 * @param {remoting.ClientSession} clientSession
238 * @return {void} Nothing. 238 * @return {void} Nothing.
239 */ 239 */
240 remoting.AppRemoting.prototype.handleConnected = function(clientSession) { 240 remoting.AppRemoting.prototype.handleConnected = function(clientSession) {
241 remoting.clientSession.sendClientMessage( 241 remoting.identity.getUserInfo().then(
242 'setUserDisplayInfo', 242 function(userInfo) {
243 JSON.stringify({fullName: remoting.identity.getCachedUserFullName()})); 243 remoting.clientSession.sendClientMessage(
244 'setUserDisplayInfo',
245 JSON.stringify({fullName: userInfo.name}));
246 });
244 247
245 // Set up a ping at 10-second intervals to test the connection speed. 248 // Set up a ping at 10-second intervals to test the connection speed.
246 function ping() { 249 function ping() {
247 var message = { timestamp: new Date().getTime() }; 250 var message = { timestamp: new Date().getTime() };
248 clientSession.sendClientMessage('pingRequest', JSON.stringify(message)); 251 clientSession.sendClientMessage('pingRequest', JSON.stringify(message));
249 }; 252 };
250 ping(); 253 ping();
251 this.pingTimerId_ = window.setInterval(ping, 10 * 1000); 254 this.pingTimerId_ = window.setInterval(ping, 10 * 1000);
252 }; 255 };
253 256
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
346 * @param {remoting.Error} errorTag The error to be localized and displayed. 349 * @param {remoting.Error} errorTag The error to be localized and displayed.
347 * @return {void} Nothing. 350 * @return {void} Nothing.
348 */ 351 */
349 remoting.AppRemoting.prototype.handleError = function(errorTag) { 352 remoting.AppRemoting.prototype.handleError = function(errorTag) {
350 console.error('Connection failed: ' + errorTag); 353 console.error('Connection failed: ' + errorTag);
351 remoting.LoadingWindow.close(); 354 remoting.LoadingWindow.close();
352 remoting.MessageWindow.showErrorMessage( 355 remoting.MessageWindow.showErrorMessage(
353 chrome.i18n.getMessage(/*i18n-content*/'CONNECTION_FAILED'), 356 chrome.i18n.getMessage(/*i18n-content*/'CONNECTION_FAILED'),
354 chrome.i18n.getMessage(/** @type {string} */ (errorTag))); 357 chrome.i18n.getMessage(/** @type {string} */ (errorTag)));
355 }; 358 };
OLDNEW
« no previous file with comments | « no previous file | remoting/webapp/crd/js/host_controller.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698