Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(435)

Side by Side Diff: remoting/webapp/remoting.js

Issue 342583002: Remove NPAPI plugin from chromoting webapp. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 * Returns whether or not IT2Me is supported via the host NPAPI plugin. 172 * Returns whether or not IT2Me is supported via the host NPAPI plugin.
173 * 173 *
174 * @return {boolean} 174 * @return {boolean}
175 */ 175 */
176 function isIT2MeSupported_() { 176 function isIT2MeSupported_() {
177 // Currently, IT2Me on Chromebooks is not supported. 177 // Currently, IT2Me on Chromebooks is not supported.
178 return !remoting.runningOnChromeOS(); 178 return !remoting.runningOnChromeOS();
179 } 179 }
180 180
181 /** 181 /**
182 * Create an instance of the NPAPI plugin.
183 * @param {Element} container The element to add the plugin to.
184 * @return {remoting.HostPlugin} The new plugin instance or null if it failed to
185 * load.
186 */
187 remoting.createNpapiPlugin = function(container) {
188 var plugin = document.createElement('embed');
189 plugin.type = remoting.settings.PLUGIN_MIMETYPE;
190 // Hiding the plugin means it doesn't load, so make it size zero instead.
191 plugin.width = 0;
192 plugin.height = 0;
193
194 // Verify if the plugin was loaded successfully.
195 if (plugin.hasOwnProperty('REQUESTED_ACCESS_CODE')) {
196 container.appendChild(plugin);
197 return /** @type {remoting.HostPlugin} */ (plugin);
198 }
199
200 return null;
201 };
202
203 /**
204 * Returns true if the current platform is fully supported. It's only used when 182 * Returns true if the current platform is fully supported. It's only used when
205 * we detect that host native messaging components are not installed. In that 183 * we detect that host native messaging components are not installed. In that
206 * case the result of this function determines if the webapp should show the 184 * case the result of this function determines if the webapp should show the
207 * controls that allow to install and enable Me2Me host. 185 * controls that allow to install and enable Me2Me host.
208 * 186 *
209 * @return {boolean} 187 * @return {boolean}
210 */ 188 */
211 remoting.isMe2MeInstallable = function() { 189 remoting.isMe2MeInstallable = function() {
212 /** @type {string} */ 190 /** @type {string} */
213 var platform = navigator.platform; 191 var platform = navigator.platform;
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after
528 /** 506 /**
529 * Generate a nonce, to be used as an xsrf protection token. 507 * Generate a nonce, to be used as an xsrf protection token.
530 * 508 *
531 * @return {string} A URL-Safe Base64-encoded 128-bit random value. */ 509 * @return {string} A URL-Safe Base64-encoded 128-bit random value. */
532 remoting.generateXsrfToken = function() { 510 remoting.generateXsrfToken = function() {
533 var random = new Uint8Array(16); 511 var random = new Uint8Array(16);
534 window.crypto.getRandomValues(random); 512 window.crypto.getRandomValues(random);
535 var base64Token = window.btoa(String.fromCharCode.apply(null, random)); 513 var base64Token = window.btoa(String.fromCharCode.apply(null, random));
536 return base64Token.replace(/\+/g, '-').replace(/\//g, '_').replace(/=/g, ''); 514 return base64Token.replace(/\+/g, '-').replace(/\//g, '_').replace(/=/g, '');
537 }; 515 };
OLDNEW
« remoting/webapp/host_it2me_dispatcher.js ('K') | « remoting/webapp/plugin_settings.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698