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

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

Issue 917093003: Shorten Closure template notation from Array.<*> to Array<*>. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove cvox Created 5 years, 10 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
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 /** 5 /**
6 * @fileoverview 6 * @fileoverview
7 * OAuth2 class that handles retrieval/storage of an OAuth2 token. 7 * OAuth2 class that handles retrieval/storage of an OAuth2 token.
8 * 8 *
9 * Uses a content script to trampoline the OAuth redirect page back into the 9 * Uses a content script to trampoline the OAuth redirect page back into the
10 * extension context. This works around the lack of native support for 10 * extension context. This works around the lack of native support for
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 'scope': this.SCOPE_, 256 'scope': this.SCOPE_,
257 'state': xsrf_token, 257 'state': xsrf_token,
258 'response_type': 'code', 258 'response_type': 'code',
259 'access_type': 'offline', 259 'access_type': 'offline',
260 'approval_prompt': 'force' 260 'approval_prompt': 'force'
261 }); 261 });
262 262
263 /** 263 /**
264 * Processes the results of the oauth flow. 264 * Processes the results of the oauth flow.
265 * 265 *
266 * @param {Object.<string, string>} message Dictionary containing the parsed 266 * @param {Object<string, string>} message Dictionary containing the parsed
267 * OAuth redirect URL parameters. 267 * OAuth redirect URL parameters.
268 * @param {function(*)} sendResponse Function to send response. 268 * @param {function(*)} sendResponse Function to send response.
269 */ 269 */
270 function oauth2MessageListener(message, sender, sendResponse) { 270 function oauth2MessageListener(message, sender, sendResponse) {
271 if ('code' in message && 'state' in message) { 271 if ('code' in message && 'state' in message) {
272 if (message['state'] == xsrf_token) { 272 if (message['state'] == xsrf_token) {
273 onDone(message['code']); 273 onDone(message['code']);
274 } else { 274 } else {
275 console.error('Invalid XSRF token.'); 275 console.error('Invalid XSRF token.');
276 onDone(null); 276 onDone(null);
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
461 * @return {?string} The user's full name, if it has been cached by a previous 461 * @return {?string} The user's full name, if it has been cached by a previous
462 * call to getUserInfo, otherwise null. 462 * call to getUserInfo, otherwise null.
463 */ 463 */
464 remoting.OAuth2.prototype.getCachedUserFullName = function() { 464 remoting.OAuth2.prototype.getCachedUserFullName = function() {
465 var value = window.localStorage.getItem(this.KEY_FULLNAME_); 465 var value = window.localStorage.getItem(this.KEY_FULLNAME_);
466 if (typeof value == 'string') { 466 if (typeof value == 'string') {
467 return value; 467 return value;
468 } 468 }
469 return null; 469 return null;
470 }; 470 };
OLDNEW
« no previous file with comments | « remoting/webapp/crd/js/log_to_server.js ('k') | remoting/webapp/crd/js/paired_client_manager.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698