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

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

Issue 9343001: The Chromium and Google Chrome builds of the chromoting webapp use different (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Move buildtype-dependent parameters to plugin_settings.js." Created 8 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 | Annotate | Revision Log
« no previous file with comments | « remoting/webapp/build-webapp.py ('k') | remoting/webapp/plugin_settings.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 /** 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 16 matching lines...) Expand all
27 // Constants representing keys used for storing persistent state. 27 // Constants representing keys used for storing persistent state.
28 /** @private */ 28 /** @private */
29 remoting.OAuth2.prototype.KEY_REFRESH_TOKEN_ = 'oauth2-refresh-token'; 29 remoting.OAuth2.prototype.KEY_REFRESH_TOKEN_ = 'oauth2-refresh-token';
30 /** @private */ 30 /** @private */
31 remoting.OAuth2.prototype.KEY_ACCESS_TOKEN_ = 'oauth2-access-token'; 31 remoting.OAuth2.prototype.KEY_ACCESS_TOKEN_ = 'oauth2-access-token';
32 /** @private */ 32 /** @private */
33 remoting.OAuth2.prototype.KEY_EMAIL_ = 'remoting-email'; 33 remoting.OAuth2.prototype.KEY_EMAIL_ = 'remoting-email';
34 34
35 // Constants for parameters used in retrieving the OAuth2 credentials. 35 // Constants for parameters used in retrieving the OAuth2 credentials.
36 /** @private */ 36 /** @private */
37 remoting.OAuth2.prototype.CLIENT_ID_ =
38 '440925447803-2pi3v45bff6tp1rde2f7q6lgbor3o5uj.' +
39 'apps.googleusercontent.com';
40 /** @private */
41 remoting.OAuth2.prototype.CLIENT_SECRET_ = 'W2ieEsG-R1gIA4MMurGrgMc_';
42 /** @private */
43 remoting.OAuth2.prototype.SCOPE_ = 37 remoting.OAuth2.prototype.SCOPE_ =
44 'https://www.googleapis.com/auth/chromoting ' + 38 'https://www.googleapis.com/auth/chromoting ' +
45 'https://www.googleapis.com/auth/googletalk ' + 39 'https://www.googleapis.com/auth/googletalk ' +
46 'https://www.googleapis.com/auth/userinfo#email'; 40 'https://www.googleapis.com/auth/userinfo#email';
47 /** @private */ 41 /** @private */
48 remoting.OAuth2.prototype.OAUTH2_TOKEN_ENDPOINT_ = 42 remoting.OAuth2.prototype.OAUTH2_TOKEN_ENDPOINT_ =
49 'https://accounts.google.com/o/oauth2/token'; 43 'https://accounts.google.com/o/oauth2/token';
50 44
51 /** @return {boolean} True if the app is already authenticated. */ 45 /** @return {boolean} True if the app is already authenticated. */
52 remoting.OAuth2.prototype.isAuthenticated = function() { 46 remoting.OAuth2.prototype.isAuthenticated = function() {
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after
336 * @return {?string} The email address, if it has been cached by a previous call 330 * @return {?string} The email address, if it has been cached by a previous call
337 * to getEmail, otherwise null. 331 * to getEmail, otherwise null.
338 */ 332 */
339 remoting.OAuth2.prototype.getCachedEmail = function() { 333 remoting.OAuth2.prototype.getCachedEmail = function() {
340 var value = window.localStorage.getItem(this.KEY_EMAIL_); 334 var value = window.localStorage.getItem(this.KEY_EMAIL_);
341 if (typeof value == 'string') { 335 if (typeof value == 'string') {
342 return value; 336 return value;
343 } 337 }
344 return null; 338 return null;
345 }; 339 };
OLDNEW
« no previous file with comments | « remoting/webapp/build-webapp.py ('k') | remoting/webapp/plugin_settings.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698