OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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.personal_options', function() { | 5 cr.define('options.personal_options', function() { |
6 const DeletableItem = options.DeletableItem; | 6 const DeletableItem = options.DeletableItem; |
7 const DeletableItemList = options.DeletableItemList; | 7 const DeletableItemList = options.DeletableItemList; |
8 const ListSingleSelectionModel = cr.ui.ListSingleSelectionModel; | 8 const ListSingleSelectionModel = cr.ui.ListSingleSelectionModel; |
9 | 9 |
10 var localStrings = new LocalStrings(); | 10 var localStrings = new LocalStrings(); |
(...skipping 30 matching lines...) Expand all Loading... |
41 get profilePath() { | 41 get profilePath() { |
42 return this.profileInfo_.filePath; | 42 return this.profileInfo_.filePath; |
43 }, | 43 }, |
44 | 44 |
45 /** @inheritDoc */ | 45 /** @inheritDoc */ |
46 decorate: function() { | 46 decorate: function() { |
47 DeletableItem.prototype.decorate.call(this); | 47 DeletableItem.prototype.decorate.call(this); |
48 | 48 |
49 var profileInfo = this.profileInfo_; | 49 var profileInfo = this.profileInfo_; |
50 | 50 |
51 var nameEl = this.contentElement; | 51 var iconEl = this.ownerDocument.createElement('img'); |
52 nameEl.className = 'profile-item'; | 52 iconEl.className = 'profile-img'; |
| 53 iconEl.src = profileInfo.iconURL; |
| 54 this.contentElement.appendChild(iconEl); |
| 55 |
| 56 var nameEl = this.ownerDocument.createElement('div'); |
53 if (profileInfo.isCurrentProfile) | 57 if (profileInfo.isCurrentProfile) |
54 nameEl.classList.add('profile-item-current'); | 58 nameEl.classList.add('profile-item-current'); |
| 59 this.contentElement.appendChild(nameEl); |
55 | 60 |
56 var displayName = profileInfo.name; | 61 var displayName = profileInfo.name; |
57 if (profileInfo.isCurrentProfile) | 62 if (profileInfo.isCurrentProfile) |
58 displayName = localStrings.getStringF( | 63 displayName = localStrings.getStringF( |
59 'profilesListItemCurrent', | 64 'profilesListItemCurrent', |
60 profileInfo.name) | 65 profileInfo.name) |
61 nameEl.textContent = displayName; | 66 nameEl.textContent = displayName; |
62 }, | 67 }, |
63 }; | 68 }; |
64 | 69 |
(...skipping 23 matching lines...) Expand all Loading... |
88 activateItemAtIndex: function(index) { | 93 activateItemAtIndex: function(index) { |
89 ManageProfileOverlay.showManageDialog(this.dataModel.item(index)); | 94 ManageProfileOverlay.showManageDialog(this.dataModel.item(index)); |
90 }, | 95 }, |
91 }; | 96 }; |
92 | 97 |
93 return { | 98 return { |
94 ProfileList: ProfileList | 99 ProfileList: ProfileList |
95 }; | 100 }; |
96 }); | 101 }); |
97 | 102 |
OLD | NEW |