OLD | NEW |
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 13 matching lines...) Expand all Loading... |
24 * @param {remoting.Identity.ConsentDialog=} opt_consentDialog | 24 * @param {remoting.Identity.ConsentDialog=} opt_consentDialog |
25 * @constructor | 25 * @constructor |
26 */ | 26 */ |
27 remoting.Identity = function(opt_consentDialog) { | 27 remoting.Identity = function(opt_consentDialog) { |
28 /** @private */ | 28 /** @private */ |
29 this.consentDialog_ = opt_consentDialog; | 29 this.consentDialog_ = opt_consentDialog; |
30 /** @type {string} @private */ | 30 /** @type {string} @private */ |
31 this.email_ = ''; | 31 this.email_ = ''; |
32 /** @type {string} @private */ | 32 /** @type {string} @private */ |
33 this.fullName_ = ''; | 33 this.fullName_ = ''; |
34 /** @type {Array.<remoting.Identity.Callbacks>} */ | 34 /** @type {Array<remoting.Identity.Callbacks>} */ |
35 this.pendingCallbacks_ = []; | 35 this.pendingCallbacks_ = []; |
36 }; | 36 }; |
37 | 37 |
38 /** | 38 /** |
39 * chrome.identity.getAuthToken should be initiated from user interactions if | 39 * chrome.identity.getAuthToken should be initiated from user interactions if |
40 * called with interactive equals true. This interface prompts a dialog for | 40 * called with interactive equals true. This interface prompts a dialog for |
41 * the user's consent. | 41 * the user's consent. |
42 * | 42 * |
43 * @interface | 43 * @interface |
44 */ | 44 */ |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 }; | 247 }; |
248 | 248 |
249 /** | 249 /** |
250 * Returns whether the web app has authenticated with the Google services. | 250 * Returns whether the web app has authenticated with the Google services. |
251 * | 251 * |
252 * @return {boolean} | 252 * @return {boolean} |
253 */ | 253 */ |
254 remoting.Identity.prototype.isAuthenticated = function() { | 254 remoting.Identity.prototype.isAuthenticated = function() { |
255 return remoting.identity.email_ !== ''; | 255 return remoting.identity.email_ !== ''; |
256 }; | 256 }; |
OLD | NEW |