| 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.browser_options', function() { | 5 cr.define('options.browser_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 17 matching lines...) Expand all Loading... |
| 28 */ | 28 */ |
| 29 ProfileListItem.decorate = function(el) { | 29 ProfileListItem.decorate = function(el) { |
| 30 el.__proto__ = ProfileListItem.prototype; | 30 el.__proto__ = ProfileListItem.prototype; |
| 31 el.decorate(); | 31 el.decorate(); |
| 32 }; | 32 }; |
| 33 | 33 |
| 34 ProfileListItem.prototype = { | 34 ProfileListItem.prototype = { |
| 35 __proto__: DeletableItem.prototype, | 35 __proto__: DeletableItem.prototype, |
| 36 | 36 |
| 37 /** | 37 /** |
| 38 * Get the filepath for this profile list item. | 38 * @type {string} the file path of this profile list item. |
| 39 * @return the file path of this item. | 39 */ |
| 40 */ | |
| 41 get profilePath() { | 40 get profilePath() { |
| 42 return this.profileInfo_.filePath; | 41 return this.profileInfo_.filePath; |
| 43 }, | 42 }, |
| 44 | 43 |
| 45 /** @inheritDoc */ | 44 /** @inheritDoc */ |
| 46 decorate: function() { | 45 decorate: function() { |
| 47 DeletableItem.prototype.decorate.call(this); | 46 DeletableItem.prototype.decorate.call(this); |
| 48 | 47 |
| 49 var profileInfo = this.profileInfo_; | 48 var profileInfo = this.profileInfo_; |
| 50 | 49 |
| 51 var iconEl = this.ownerDocument.createElement('img'); | 50 var iconEl = this.ownerDocument.createElement('img'); |
| 52 iconEl.className = 'profile-img'; | 51 iconEl.className = 'profile-img'; |
| 53 iconEl.src = profileInfo.iconURL; | 52 iconEl.src = profileInfo.iconURL; |
| 54 this.contentElement.appendChild(iconEl); | 53 this.contentElement.appendChild(iconEl); |
| 55 | 54 |
| 56 var nameEl = this.ownerDocument.createElement('div'); | 55 var nameEl = this.ownerDocument.createElement('div'); |
| 57 if (profileInfo.isCurrentProfile) | 56 if (profileInfo.isCurrentProfile) |
| 58 nameEl.classList.add('profile-item-current'); | 57 nameEl.classList.add('profile-item-current'); |
| 59 this.contentElement.appendChild(nameEl); | 58 this.contentElement.appendChild(nameEl); |
| 60 | 59 |
| 61 var displayName = profileInfo.name; | 60 var displayName = profileInfo.name; |
| 62 if (profileInfo.isCurrentProfile) | 61 if (profileInfo.isCurrentProfile) |
| 63 displayName = localStrings.getStringF( | 62 displayName = localStrings.getStringF( |
| 64 'profilesListItemCurrent', | 63 'profilesListItemCurrent', |
| 65 profileInfo.name) | 64 profileInfo.name); |
| 66 nameEl.textContent = displayName; | 65 nameEl.textContent = displayName; |
| 67 }, | 66 }, |
| 68 }; | 67 }; |
| 69 | 68 |
| 70 var ProfileList = cr.ui.define('list'); | 69 var ProfileList = cr.ui.define('list'); |
| 71 | 70 |
| 72 ProfileList.prototype = { | 71 ProfileList.prototype = { |
| 73 __proto__: DeletableItemList.prototype, | 72 __proto__: DeletableItemList.prototype, |
| 74 | 73 |
| 75 /** @inheritDoc */ | 74 /** @inheritDoc */ |
| (...skipping 20 matching lines...) Expand all Loading... |
| 96 if (profileInfo.isCurrentProfile) | 95 if (profileInfo.isCurrentProfile) |
| 97 ManageProfileOverlay.showManageDialog(profileInfo); | 96 ManageProfileOverlay.showManageDialog(profileInfo); |
| 98 }, | 97 }, |
| 99 }; | 98 }; |
| 100 | 99 |
| 101 return { | 100 return { |
| 102 ProfileList: ProfileList | 101 ProfileList: ProfileList |
| 103 }; | 102 }; |
| 104 }); | 103 }); |
| 105 | 104 |
| OLD | NEW |