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

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

Issue 954373002: [Webapp Refactor] Group authentications fields into remoting.CredentialsProvider. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove supports() Created 5 years, 9 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 * Wrapper class for Chrome's identity API. 7 * Wrapper class for Chrome's identity API.
8 */ 8 */
9 9
10 'use strict'; 10 'use strict';
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 }); 150 });
151 }; 151 };
152 152
153 /** 153 /**
154 * Gets the user's email address. 154 * Gets the user's email address.
155 * 155 *
156 * @return {!Promise<string>} Promise resolved with the user's email 156 * @return {!Promise<string>} Promise resolved with the user's email
157 * address or rejected with a remoting.Error. 157 * address or rejected with a remoting.Error.
158 */ 158 */
159 remoting.Identity.prototype.getEmail = function() { 159 remoting.Identity.prototype.getEmail = function() {
160 this.getUserInfo().then(function(userInfo) { 160 return this.getUserInfo().then(function(userInfo) {
161 return userInfo.email; 161 return userInfo.email;
162 }); 162 });
163 }; 163 };
164 164
165 /** 165 /**
166 * Gets the user's email address, or null if no successful call to 166 * Gets the user's email address, or null if no successful call to
167 * getUserInfo has been made. 167 * getUserInfo has been made.
168 * 168 *
169 * @return {?string} The cached email address, if available. 169 * @return {?string} The cached email address, if available.
170 */ 170 */
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 }; 229 };
230 230
231 /** 231 /**
232 * Returns whether the web app has authenticated with the Google services. 232 * Returns whether the web app has authenticated with the Google services.
233 * 233 *
234 * @return {boolean} 234 * @return {boolean}
235 */ 235 */
236 remoting.Identity.prototype.isAuthenticated = function() { 236 remoting.Identity.prototype.isAuthenticated = function() {
237 return remoting.identity.email_ !== ''; 237 return remoting.identity.email_ !== '';
238 }; 238 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698