| 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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 } | 62 } |
| 63 | 63 |
| 64 console.log(remoting.getExtensionInfo()); | 64 console.log(remoting.getExtensionInfo()); |
| 65 l10n.localize(); | 65 l10n.localize(); |
| 66 | 66 |
| 67 // Create global objects. | 67 // Create global objects. |
| 68 remoting.settings = new remoting.Settings(); | 68 remoting.settings = new remoting.Settings(); |
| 69 if (remoting.isAppsV2) { | 69 if (remoting.isAppsV2) { |
| 70 remoting.identity = new remoting.Identity(consentRequired_); | 70 remoting.identity = new remoting.Identity(consentRequired_); |
| 71 remoting.fullscreen = new remoting.FullscreenAppsV2(); | 71 remoting.fullscreen = new remoting.FullscreenAppsV2(); |
| 72 remoting.windowFrame = new remoting.WindowFrame( |
| 73 document.getElementById('title-bar')); |
| 72 } else { | 74 } else { |
| 73 remoting.oauth2 = new remoting.OAuth2(); | 75 remoting.oauth2 = new remoting.OAuth2(); |
| 74 if (!remoting.oauth2.isAuthenticated()) { | 76 if (!remoting.oauth2.isAuthenticated()) { |
| 75 document.getElementById('auth-dialog').hidden = false; | 77 document.getElementById('auth-dialog').hidden = false; |
| 76 } | 78 } |
| 77 remoting.identity = remoting.oauth2; | 79 remoting.identity = remoting.oauth2; |
| 78 remoting.fullscreen = new remoting.FullscreenAppsV1(); | 80 remoting.fullscreen = new remoting.FullscreenAppsV1(); |
| 79 } | 81 } |
| 80 remoting.stats = new remoting.ConnectionStats( | 82 remoting.stats = new remoting.ConnectionStats( |
| 81 document.getElementById('statistics')); | 83 document.getElementById('statistics')); |
| (...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 527 /** | 529 /** |
| 528 * Generate a nonce, to be used as an xsrf protection token. | 530 * Generate a nonce, to be used as an xsrf protection token. |
| 529 * | 531 * |
| 530 * @return {string} A URL-Safe Base64-encoded 128-bit random value. */ | 532 * @return {string} A URL-Safe Base64-encoded 128-bit random value. */ |
| 531 remoting.generateXsrfToken = function() { | 533 remoting.generateXsrfToken = function() { |
| 532 var random = new Uint8Array(16); | 534 var random = new Uint8Array(16); |
| 533 window.crypto.getRandomValues(random); | 535 window.crypto.getRandomValues(random); |
| 534 var base64Token = window.btoa(String.fromCharCode.apply(null, random)); | 536 var base64Token = window.btoa(String.fromCharCode.apply(null, random)); |
| 535 return base64Token.replace(/\+/g, '-').replace(/\//g, '_').replace(/=/g, ''); | 537 return base64Token.replace(/\+/g, '-').replace(/\//g, '_').replace(/=/g, ''); |
| 536 }; | 538 }; |
| OLD | NEW |