| 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 */ var DeletableItem = options.DeletableItem; | 6 /** @const */ var DeletableItem = options.DeletableItem; |
| 7 /** @const */ var DeletableItemList = options.DeletableItemList; | 7 /** @const */ var DeletableItemList = options.DeletableItemList; |
| 8 /** @const */ var ListSingleSelectionModel = cr.ui.ListSingleSelectionModel; | 8 /** @const */ var ListSingleSelectionModel = cr.ui.ListSingleSelectionModel; |
| 9 | 9 |
| 10 var localStrings = new LocalStrings(); | |
| 11 | |
| 12 /** | 10 /** |
| 13 * Creates a new profile list item. | 11 * Creates a new profile list item. |
| 14 * @param {Object} profileInfo The profile this item respresents. | 12 * @param {Object} profileInfo The profile this item respresents. |
| 15 * @constructor | 13 * @constructor |
| 16 * @extends {cr.ui.DeletableItem} | 14 * @extends {cr.ui.DeletableItem} |
| 17 */ | 15 */ |
| 18 function ProfileListItem(profileInfo) { | 16 function ProfileListItem(profileInfo) { |
| 19 var el = cr.doc.createElement('div'); | 17 var el = cr.doc.createElement('div'); |
| 20 el.profileInfo_ = profileInfo; | 18 el.profileInfo_ = profileInfo; |
| 21 ProfileListItem.decorate(el); | 19 ProfileListItem.decorate(el); |
| (...skipping 29 matching lines...) Expand all Loading... |
| 51 iconEl.className = 'profile-img'; | 49 iconEl.className = 'profile-img'; |
| 52 iconEl.src = profileInfo.iconURL; | 50 iconEl.src = profileInfo.iconURL; |
| 53 this.contentElement.appendChild(iconEl); | 51 this.contentElement.appendChild(iconEl); |
| 54 | 52 |
| 55 var nameEl = this.ownerDocument.createElement('div'); | 53 var nameEl = this.ownerDocument.createElement('div'); |
| 56 if (profileInfo.isCurrentProfile) | 54 if (profileInfo.isCurrentProfile) |
| 57 nameEl.classList.add('profile-item-current'); | 55 nameEl.classList.add('profile-item-current'); |
| 58 this.contentElement.appendChild(nameEl); | 56 this.contentElement.appendChild(nameEl); |
| 59 | 57 |
| 60 var displayName = profileInfo.name; | 58 var displayName = profileInfo.name; |
| 61 if (profileInfo.isCurrentProfile) | 59 if (profileInfo.isCurrentProfile) { |
| 62 displayName = localStrings.getStringF( | 60 displayName = loadTimeData.getStringF('profilesListItemCurrent', |
| 63 'profilesListItemCurrent', | 61 profileInfo.name); |
| 64 profileInfo.name); | 62 } |
| 65 nameEl.textContent = displayName; | 63 nameEl.textContent = displayName; |
| 66 | 64 |
| 67 // Ensure that the button cannot be tabbed to for accessibility reasons. | 65 // Ensure that the button cannot be tabbed to for accessibility reasons. |
| 68 this.closeButtonElement.tabIndex = -1; | 66 this.closeButtonElement.tabIndex = -1; |
| 69 }, | 67 }, |
| 70 }; | 68 }; |
| 71 | 69 |
| 72 var ProfileList = cr.ui.define('list'); | 70 var ProfileList = cr.ui.define('list'); |
| 73 | 71 |
| 74 ProfileList.prototype = { | 72 ProfileList.prototype = { |
| (...skipping 23 matching lines...) Expand all Loading... |
| 98 if (profileInfo.isCurrentProfile) | 96 if (profileInfo.isCurrentProfile) |
| 99 ManageProfileOverlay.showManageDialog(profileInfo); | 97 ManageProfileOverlay.showManageDialog(profileInfo); |
| 100 }, | 98 }, |
| 101 }; | 99 }; |
| 102 | 100 |
| 103 return { | 101 return { |
| 104 ProfileList: ProfileList | 102 ProfileList: ProfileList |
| 105 }; | 103 }; |
| 106 }); | 104 }); |
| 107 | 105 |
| OLD | NEW |