OLD | NEW |
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 'use strict'; | 5 'use strict'; |
6 | 6 |
7 /** @suppress {duplicate} */ | 7 /** @suppress {duplicate} */ |
8 var remoting = remoting || {}; | 8 var remoting = remoting || {}; |
9 | 9 |
10 /** @type {remoting.HostSession} */ remoting.hostSession = null; | 10 /** @type {remoting.HostSession} */ remoting.hostSession = null; |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 } | 67 } |
68 remoting.identity = remoting.oauth2; | 68 remoting.identity = remoting.oauth2; |
69 } | 69 } |
70 remoting.stats = new remoting.ConnectionStats( | 70 remoting.stats = new remoting.ConnectionStats( |
71 document.getElementById('statistics')); | 71 document.getElementById('statistics')); |
72 remoting.formatIq = new remoting.FormatIq(); | 72 remoting.formatIq = new remoting.FormatIq(); |
73 remoting.hostList = new remoting.HostList( | 73 remoting.hostList = new remoting.HostList( |
74 document.getElementById('host-list'), | 74 document.getElementById('host-list'), |
75 document.getElementById('host-list-empty'), | 75 document.getElementById('host-list-empty'), |
76 document.getElementById('host-list-error-message'), | 76 document.getElementById('host-list-error-message'), |
77 document.getElementById('host-list-refresh-failed-button')); | 77 document.getElementById('host-list-refresh-failed-button'), |
| 78 document.getElementById('host-list-loading-indicator')); |
78 remoting.toolbar = new remoting.Toolbar( | 79 remoting.toolbar = new remoting.Toolbar( |
79 document.getElementById('session-toolbar')); | 80 document.getElementById('session-toolbar')); |
80 remoting.clipboard = new remoting.Clipboard(); | 81 remoting.clipboard = new remoting.Clipboard(); |
81 var sandbox = /** @type {HTMLIFrameElement} */ | 82 var sandbox = /** @type {HTMLIFrameElement} */ |
82 document.getElementById('wcs-sandbox'); | 83 document.getElementById('wcs-sandbox'); |
83 remoting.wcsSandbox = new remoting.WcsSandboxContainer(sandbox.contentWindow); | 84 remoting.wcsSandbox = new remoting.WcsSandboxContainer(sandbox.contentWindow); |
84 | 85 |
85 /** @param {remoting.Error} error */ | 86 /** @param {remoting.Error} error */ |
86 var onGetEmailError = function(error) { | 87 var onGetEmailError = function(error) { |
87 // No need to show the error message for NOT_AUTHENTICATED | 88 // No need to show the error message for NOT_AUTHENTICATED |
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
460 /** | 461 /** |
461 * Generate a nonce, to be used as an xsrf protection token. | 462 * Generate a nonce, to be used as an xsrf protection token. |
462 * | 463 * |
463 * @return {string} A URL-Safe Base64-encoded 128-bit random value. */ | 464 * @return {string} A URL-Safe Base64-encoded 128-bit random value. */ |
464 remoting.generateXsrfToken = function() { | 465 remoting.generateXsrfToken = function() { |
465 var random = new Uint8Array(16); | 466 var random = new Uint8Array(16); |
466 window.crypto.getRandomValues(random); | 467 window.crypto.getRandomValues(random); |
467 var base64Token = window.btoa(String.fromCharCode.apply(null, random)); | 468 var base64Token = window.btoa(String.fromCharCode.apply(null, random)); |
468 return base64Token.replace(/\+/g, '-').replace(/\//g, '_').replace(/=/g, ''); | 469 return base64Token.replace(/\+/g, '-').replace(/\//g, '_').replace(/=/g, ''); |
469 }; | 470 }; |
OLD | NEW |