Chromium Code Reviews| 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 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 385 toolbar.style['left'] = toolbarX + 'px'; | 385 toolbar.style['left'] = toolbarX + 'px'; |
| 386 } | 386 } |
| 387 | 387 |
| 388 /** | 388 /** |
| 389 * Start a connection to the specified host, using the stored details. | 389 * Start a connection to the specified host, using the stored details. |
| 390 * | 390 * |
| 391 * @param {string} hostId The Id of the host to connect to. | 391 * @param {string} hostId The Id of the host to connect to. |
| 392 * @return {void} Nothing. | 392 * @return {void} Nothing. |
| 393 */ | 393 */ |
| 394 remoting.connectHost = function(hostId) { | 394 remoting.connectHost = function(hostId) { |
| 395 for (var i = 0; i < remoting.hostList.length; ++i) { | 395 for (var i = 0; i < remoting.hostList.hosts.length; ++i) { |
| 396 var host = remoting.hostList[i]; | 396 /** @type {remoting.Host} */ |
|
Wez
2011/11/16 21:41:23
Does this annotation apply to the var definition?
Jamie
2011/11/16 22:09:09
Yes. For some reason, JSCompiler can't infer the t
| |
| 397 var host = remoting.hostList.hosts[i]; | |
| 397 if (host.hostId != hostId) | 398 if (host.hostId != hostId) |
| 398 continue; | 399 continue; |
| 399 | 400 |
| 400 remoting.hostJid = host.jabberId; | 401 remoting.hostJid = host.jabberId; |
| 401 remoting.hostPublicKey = host.publicKey; | 402 remoting.hostPublicKey = host.publicKey; |
| 402 document.getElementById('connected-to').innerText = host.hostName; | 403 document.getElementById('connected-to').innerText = host.hostName; |
| 403 | 404 |
| 404 remoting.debug.log('Connecting to host...'); | 405 remoting.debug.log('Connecting to host...'); |
| 405 | 406 |
| 406 if (!remoting.wcsLoader) { | 407 if (!remoting.wcsLoader) { |
| (...skipping 29 matching lines...) Expand all Loading... | |
| 436 remoting.clientSession.createPluginAndConnect( | 437 remoting.clientSession.createPluginAndConnect( |
| 437 document.getElementById('session-mode'), | 438 document.getElementById('session-mode'), |
| 438 token); | 439 token); |
| 439 }; | 440 }; |
| 440 | 441 |
| 441 remoting.setMode(remoting.AppMode.CLIENT_CONNECTING); | 442 remoting.setMode(remoting.AppMode.CLIENT_CONNECTING); |
| 442 remoting.oauth2.callWithToken(createPluginAndConnect); | 443 remoting.oauth2.callWithToken(createPluginAndConnect); |
| 443 } | 444 } |
| 444 | 445 |
| 445 }()); | 446 }()); |
| OLD | NEW |