| 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 } | 54 } |
| 55 | 55 |
| 56 console.log(remoting.getExtensionInfo()); | 56 console.log(remoting.getExtensionInfo()); |
| 57 l10n.localize(); | 57 l10n.localize(); |
| 58 | 58 |
| 59 // Create global objects. | 59 // Create global objects. |
| 60 remoting.settings = new remoting.Settings(); | 60 remoting.settings = new remoting.Settings(); |
| 61 if (remoting.isAppsV2) { | 61 if (remoting.isAppsV2) { |
| 62 remoting.identity = new remoting.Identity(consentRequired_); | 62 remoting.identity = new remoting.Identity(consentRequired_); |
| 63 remoting.fullscreen = new remoting.FullscreenAppsV2(); | 63 remoting.fullscreen = new remoting.FullscreenAppsV2(); |
| 64 remoting.titleBar = new remoting.TitleBar(); |
| 64 } else { | 65 } else { |
| 65 remoting.oauth2 = new remoting.OAuth2(); | 66 remoting.oauth2 = new remoting.OAuth2(); |
| 66 if (!remoting.oauth2.isAuthenticated()) { | 67 if (!remoting.oauth2.isAuthenticated()) { |
| 67 document.getElementById('auth-dialog').hidden = false; | 68 document.getElementById('auth-dialog').hidden = false; |
| 68 } | 69 } |
| 69 remoting.identity = remoting.oauth2; | 70 remoting.identity = remoting.oauth2; |
| 70 remoting.fullscreen = new remoting.FullscreenAppsV1(); | 71 remoting.fullscreen = new remoting.FullscreenAppsV1(); |
| 71 } | 72 } |
| 72 remoting.stats = new remoting.ConnectionStats( | 73 remoting.stats = new remoting.ConnectionStats( |
| 73 document.getElementById('statistics')); | 74 document.getElementById('statistics')); |
| (...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 511 /** | 512 /** |
| 512 * Generate a nonce, to be used as an xsrf protection token. | 513 * Generate a nonce, to be used as an xsrf protection token. |
| 513 * | 514 * |
| 514 * @return {string} A URL-Safe Base64-encoded 128-bit random value. */ | 515 * @return {string} A URL-Safe Base64-encoded 128-bit random value. */ |
| 515 remoting.generateXsrfToken = function() { | 516 remoting.generateXsrfToken = function() { |
| 516 var random = new Uint8Array(16); | 517 var random = new Uint8Array(16); |
| 517 window.crypto.getRandomValues(random); | 518 window.crypto.getRandomValues(random); |
| 518 var base64Token = window.btoa(String.fromCharCode.apply(null, random)); | 519 var base64Token = window.btoa(String.fromCharCode.apply(null, random)); |
| 519 return base64Token.replace(/\+/g, '-').replace(/\//g, '_').replace(/=/g, ''); | 520 return base64Token.replace(/\+/g, '-').replace(/\//g, '_').replace(/=/g, ''); |
| 520 }; | 521 }; |
| OLD | NEW |