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 cr.define('options.accounts', function() { | 5 cr.define('options.accounts', function() { |
6 /** @const */ var List = cr.ui.List; | 6 /** @const */ var List = cr.ui.List; |
7 /** @const */ var ListItem = cr.ui.ListItem; | 7 /** @const */ var ListItem = cr.ui.ListItem; |
8 /** @const */ var ArrayDataModel = cr.ui.ArrayDataModel; | 8 /** @const */ var ArrayDataModel = cr.ui.ArrayDataModel; |
9 | 9 |
10 /** | 10 /** |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 var index = this.indexOf_(username); | 70 var index = this.indexOf_(username); |
71 if (index >= 0) { | 71 if (index >= 0) { |
72 var item = this.getListItemByIndex(index); | 72 var item = this.getListItemByIndex(index); |
73 if (item) | 73 if (item) |
74 item.updatePicture(); | 74 item.updatePicture(); |
75 } | 75 } |
76 }, | 76 }, |
77 | 77 |
78 /** | 78 /** |
79 * Loads given user list. | 79 * Loads given user list. |
80 * @param {Array.<Object>} users An array of user info objects. | 80 * @param {!Array.<Object>} users An array of user info objects. |
81 * @private | 81 * @private |
82 */ | 82 */ |
83 load_: function(users) { | 83 load_: function(users) { |
84 this.dataModel = new ArrayDataModel(users); | 84 this.dataModel = new ArrayDataModel(users); |
85 }, | 85 }, |
86 | 86 |
87 /** | 87 /** |
88 * Removes given user from the list. | 88 * Removes given user from the list. |
89 * @param {Object} user User info object to be removed from user list. | 89 * @param {Object} user User info object to be removed from user list. |
90 * @private | 90 * @private |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 updatePicture: function() { | 184 updatePicture: function() { |
185 this.icon_.src = 'chrome://userimage/' + this.user.username + | 185 this.icon_.src = 'chrome://userimage/' + this.user.username + |
186 '?id=' + (new Date()).getTime(); | 186 '?id=' + (new Date()).getTime(); |
187 } | 187 } |
188 }; | 188 }; |
189 | 189 |
190 return { | 190 return { |
191 UserList: UserList | 191 UserList: UserList |
192 }; | 192 }; |
193 }); | 193 }); |
OLD | NEW |