| 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 18 matching lines...) Expand all Loading... |
| 29 | 29 |
| 30 var self = this; | 30 var self = this; |
| 31 | 31 |
| 32 // Listens to pref changes. | 32 // Listens to pref changes. |
| 33 Preferences.getInstance().addEventListener(this.pref, | 33 Preferences.getInstance().addEventListener(this.pref, |
| 34 function(event) { | 34 function(event) { |
| 35 self.load_(event.value.value); | 35 self.load_(event.value.value); |
| 36 }); | 36 }); |
| 37 }, | 37 }, |
| 38 | 38 |
| 39 /** |
| 40 * @override |
| 41 * @param {Object} user |
| 42 */ |
| 39 createItem: function(user) { | 43 createItem: function(user) { |
| 40 return new UserListItem(user); | 44 return new UserListItem(user); |
| 41 }, | 45 }, |
| 42 | 46 |
| 43 /** | 47 /** |
| 44 * Finds the index of user by given username (canonicalized email). | 48 * Finds the index of user by given username (canonicalized email). |
| 45 * @private | 49 * @private |
| 46 * @param {string} username The username to look for. | 50 * @param {string} username The username to look for. |
| 47 * @return {number} The index of the found user or -1 if not found. | 51 * @return {number} The index of the found user or -1 if not found. |
| 48 */ | 52 */ |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 updatePicture: function() { | 188 updatePicture: function() { |
| 185 this.icon_.src = 'chrome://userimage/' + this.user.username + | 189 this.icon_.src = 'chrome://userimage/' + this.user.username + |
| 186 '?id=' + (new Date()).getTime(); | 190 '?id=' + (new Date()).getTime(); |
| 187 } | 191 } |
| 188 }; | 192 }; |
| 189 | 193 |
| 190 return { | 194 return { |
| 191 UserList: UserList | 195 UserList: UserList |
| 192 }; | 196 }; |
| 193 }); | 197 }); |
| OLD | NEW |