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 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 * Returns true if the current platform is fully supported. It's only used when | 177 * Returns true if the current platform is fully supported. It's only used when |
178 * we detect that host native messaging components are not installed. In that | 178 * we detect that host native messaging components are not installed. In that |
179 * case the result of this function determines if the webapp should show the | 179 * case the result of this function determines if the webapp should show the |
180 * controls that allow to install and enable Me2Me host. | 180 * controls that allow to install and enable Me2Me host. |
181 * | 181 * |
182 * @return {boolean} | 182 * @return {boolean} |
183 */ | 183 */ |
184 remoting.isMe2MeInstallable = function() { | 184 remoting.isMe2MeInstallable = function() { |
185 /** @type {string} */ | 185 /** @type {string} */ |
186 var platform = navigator.platform; | 186 var platform = navigator.platform; |
187 // Chromoting host is not installable on ChromeOS and any linux distro other | 187 // The chromoting host is currently not installable on ChromeOS. |
188 // than Ubuntu. | 188 // For Linux, we have a install package for Ubuntu but not other distros. |
| 189 // Since we cannot tell from javascript alone the Linux distro the client is |
| 190 // on, we don't show the daemon-control UI for Linux unless the host is |
| 191 // installed. |
189 return platform == 'Win32' || platform == 'MacIntel'; | 192 return platform == 'Win32' || platform == 'MacIntel'; |
190 } | 193 } |
191 | 194 |
192 /** | 195 /** |
193 * Display the user's email address and allow access to the rest of the app, | 196 * Display the user's email address and allow access to the rest of the app, |
194 * including parsing URL parameters. | 197 * including parsing URL parameters. |
195 * | 198 * |
196 * @param {string} email The user's email address. | 199 * @param {string} email The user's email address. |
197 * @return {void} Nothing. | 200 * @return {void} Nothing. |
198 */ | 201 */ |
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
499 /** | 502 /** |
500 * Generate a nonce, to be used as an xsrf protection token. | 503 * Generate a nonce, to be used as an xsrf protection token. |
501 * | 504 * |
502 * @return {string} A URL-Safe Base64-encoded 128-bit random value. */ | 505 * @return {string} A URL-Safe Base64-encoded 128-bit random value. */ |
503 remoting.generateXsrfToken = function() { | 506 remoting.generateXsrfToken = function() { |
504 var random = new Uint8Array(16); | 507 var random = new Uint8Array(16); |
505 window.crypto.getRandomValues(random); | 508 window.crypto.getRandomValues(random); |
506 var base64Token = window.btoa(String.fromCharCode.apply(null, random)); | 509 var base64Token = window.btoa(String.fromCharCode.apply(null, random)); |
507 return base64Token.replace(/\+/g, '-').replace(/\//g, '_').replace(/=/g, ''); | 510 return base64Token.replace(/\+/g, '-').replace(/\//g, '_').replace(/=/g, ''); |
508 }; | 511 }; |
OLD | NEW |