| OLD | NEW |
| 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 /** | 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 370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 381 } | 381 } |
| 382 | 382 |
| 383 /** | 383 /** |
| 384 * Timer callback to update the statistics panel. | 384 * Timer callback to update the statistics panel. |
| 385 */ | 385 */ |
| 386 function updateStatistics_() { | 386 function updateStatistics_() { |
| 387 if (!remoting.clientSession || | 387 if (!remoting.clientSession || |
| 388 remoting.clientSession.state != remoting.ClientSession.State.CONNECTED) { | 388 remoting.clientSession.state != remoting.ClientSession.State.CONNECTED) { |
| 389 return; | 389 return; |
| 390 } | 390 } |
| 391 remoting.debug.updateStatistics(remoting.clientSession.stats()); | 391 var stats = remoting.clientSession.stats(); |
| 392 remoting.debug.updateStatistics(stats); |
| 393 remoting.clientSession.logStatistics(stats); |
| 392 // Update the stats once per second. | 394 // Update the stats once per second. |
| 393 window.setTimeout(updateStatistics_, 1000); | 395 window.setTimeout(updateStatistics_, 1000); |
| 394 } | 396 } |
| 395 | 397 |
| 396 | 398 |
| 397 /** | 399 /** |
| 398 * Start a connection to the specified host, using the stored details. | 400 * Start a connection to the specified host, using the stored details. |
| 399 * | 401 * |
| 400 * @param {string} hostJid The jabber Id of the host. | 402 * @param {string} hostJid The jabber Id of the host. |
| 401 * @param {string} hostPublicKey The public key of the host. | 403 * @param {string} hostPublicKey The public key of the host. |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 439 var createPluginAndConnect = function(token) { | 441 var createPluginAndConnect = function(token) { |
| 440 remoting.clientSession.createPluginAndConnect( | 442 remoting.clientSession.createPluginAndConnect( |
| 441 document.getElementById('session-mode'), | 443 document.getElementById('session-mode'), |
| 442 token); | 444 token); |
| 443 }; | 445 }; |
| 444 | 446 |
| 445 remoting.oauth2.callWithToken(createPluginAndConnect); | 447 remoting.oauth2.callWithToken(createPluginAndConnect); |
| 446 } | 448 } |
| 447 | 449 |
| 448 }()); | 450 }()); |
| OLD | NEW |