OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 cr.define('identity_internals', function() { | 5 cr.define('identity_internals', function() { |
6 'use strict'; | 6 'use strict'; |
7 | 7 |
8 /** | 8 /** |
9 * Creates an identity token item. | 9 * Creates an identity token item. |
10 * @param {!Object} tokenInfo Object containing token information. | 10 * @param {!Object} tokenInfo Object containing token information. |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 * Callback function accepting a list of tokens to be displayed. | 190 * Callback function accepting a list of tokens to be displayed. |
191 * @param {!Token[]} tokens A list of tokens to be displayed | 191 * @param {!Token[]} tokens A list of tokens to be displayed |
192 */ | 192 */ |
193 function returnTokens(tokens) { | 193 function returnTokens(tokens) { |
194 tokenList_.data_ = tokens; | 194 tokenList_.data_ = tokens; |
195 tokenList_.showTokenNodes_(); | 195 tokenList_.showTokenNodes_(); |
196 } | 196 } |
197 | 197 |
198 /** | 198 /** |
199 * Callback function that removes a token from UI once it has been revoked. | 199 * Callback function that removes a token from UI once it has been revoked. |
200 * @param {!Array.<string>} accessTokens Array with a single element, which is | 200 * @param {!Array<string>} accessTokens Array with a single element, which is |
201 * an access token to be removed. | 201 * an access token to be removed. |
202 */ | 202 */ |
203 function tokenRevokeDone(accessTokens) { | 203 function tokenRevokeDone(accessTokens) { |
204 assert(accessTokens.length > 0); | 204 assert(accessTokens.length > 0); |
205 tokenList_.removeTokenNode_(accessTokens[0]); | 205 tokenList_.removeTokenNode_(accessTokens[0]); |
206 } | 206 } |
207 | 207 |
208 // Return an object with all of the exports. | 208 // Return an object with all of the exports. |
209 return { | 209 return { |
210 initialize: initialize, | 210 initialize: initialize, |
211 returnTokens: returnTokens, | 211 returnTokens: returnTokens, |
212 tokenRevokeDone: tokenRevokeDone, | 212 tokenRevokeDone: tokenRevokeDone, |
213 }; | 213 }; |
214 }); | 214 }); |
215 | 215 |
216 document.addEventListener('DOMContentLoaded', identity_internals.initialize); | 216 document.addEventListener('DOMContentLoaded', identity_internals.initialize); |
OLD | NEW |