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

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

Issue 12905012: Webapp changes to support third party authentication (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Rebase, update patch Created 7 years, 8 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
« no previous file with comments | « remoting/webapp/plugin_settings.js ('k') | remoting/webapp/session_connector.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 364 matching lines...) Expand 10 before | Expand all | Expand 10 after
375 ]; 375 ];
376 for (var setting in window.localStorage) { 376 for (var setting in window.localStorage) {
377 if (oauthSettings.indexOf(setting) == -1) { 377 if (oauthSettings.indexOf(setting) == -1) {
378 var copy = {} 378 var copy = {}
379 copy[setting] = window.localStorage.getItem(setting); 379 copy[setting] = window.localStorage.getItem(setting);
380 chrome.storage.local.set(copy); 380 chrome.storage.local.set(copy);
381 window.localStorage.removeItem(setting); 381 window.localStorage.removeItem(setting);
382 } 382 }
383 } 383 }
384 } 384 }
385
386 /**
387 * Generate a nonce, to be used as an xsrf protection token.
388 *
389 * @return {string} A URL-Safe Base64-encoded 128-bit random value. */
390 remoting.generateXsrfToken = function() {
391 var random = new Uint8Array(16);
392 window.crypto.getRandomValues(random);
393 var base64Token = window.btoa(String.fromCharCode.apply(null, random));
394 return base64Token.replace(/\+/g, '-').replace(/\//g, '_').replace(/=/g, '');
395 };
OLDNEW
« no previous file with comments | « remoting/webapp/plugin_settings.js ('k') | remoting/webapp/session_connector.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698