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 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
143 /** | 143 /** |
144 * Returns whether or not IT2Me is supported via the host NPAPI plugin. | 144 * Returns whether or not IT2Me is supported via the host NPAPI plugin. |
145 * | 145 * |
146 * @return {boolean} | 146 * @return {boolean} |
147 */ | 147 */ |
148 function isIT2MeSupported_() { | 148 function isIT2MeSupported_() { |
149 // Currently, IT2Me on Chromebooks is not supported. | 149 // Currently, IT2Me on Chromebooks is not supported. |
150 return !remoting.runningOnChromeOS(); | 150 return !remoting.runningOnChromeOS(); |
151 } | 151 } |
152 | 152 |
153 // TODO(sergeyu): We want to show Me2Me host controls only on some Linux | |
154 // distributions that we know work properly with the chromoting host. Implement | |
155 // dome detection mechanism and apply it here. | |
156 remoting.supportLinuxDistibutionDetected_ = false; | |
Jamie
2014/01/31 18:39:15
s/support/supported/
Sergey Ulanov
2014/01/31 23:34:17
Done.
| |
157 | |
158 remoting.isMe2MeSupported = function isMe2MeSupported() { | |
159 var platform = navigator.platform; | |
160 | |
161 // Currently Me2Me is supported on Windows, OSX and some versions of Linux. | |
162 return platform == "Win32" || platform == "MacIntel" || | |
163 ((platform == "Linux x86_64" || platform == "Linux i386") && | |
164 remoting.supportLinuxDistibutionDetected_ && | |
165 !remoting.runningOnChromeOS()); | |
Jamie
2014/01/31 18:39:15
Does ChromeOS report itself as Linux? If so, then
Sergey Ulanov
2014/01/31 23:34:17
Yes, ChromeOS reports itself as Linux (blink uses
| |
166 } | |
167 | |
153 /** | 168 /** |
154 * Display the user's email address and allow access to the rest of the app, | 169 * Display the user's email address and allow access to the rest of the app, |
155 * including parsing URL parameters. | 170 * including parsing URL parameters. |
156 * | 171 * |
157 * @param {string} email The user's email address. | 172 * @param {string} email The user's email address. |
158 * @return {void} Nothing. | 173 * @return {void} Nothing. |
159 */ | 174 */ |
160 remoting.onEmail = function(email) { | 175 remoting.onEmail = function(email) { |
161 document.getElementById('current-email').innerText = email; | 176 document.getElementById('current-email').innerText = email; |
162 document.getElementById('get-started-it2me').disabled = false; | 177 document.getElementById('get-started-it2me').disabled = false; |
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
456 /** | 471 /** |
457 * Generate a nonce, to be used as an xsrf protection token. | 472 * Generate a nonce, to be used as an xsrf protection token. |
458 * | 473 * |
459 * @return {string} A URL-Safe Base64-encoded 128-bit random value. */ | 474 * @return {string} A URL-Safe Base64-encoded 128-bit random value. */ |
460 remoting.generateXsrfToken = function() { | 475 remoting.generateXsrfToken = function() { |
461 var random = new Uint8Array(16); | 476 var random = new Uint8Array(16); |
462 window.crypto.getRandomValues(random); | 477 window.crypto.getRandomValues(random); |
463 var base64Token = window.btoa(String.fromCharCode.apply(null, random)); | 478 var base64Token = window.btoa(String.fromCharCode.apply(null, random)); |
464 return base64Token.replace(/\+/g, '-').replace(/\//g, '_').replace(/=/g, ''); | 479 return base64Token.replace(/\+/g, '-').replace(/\//g, '_').replace(/=/g, ''); |
465 }; | 480 }; |
OLD | NEW |