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 /** | 10 /** |
(...skipping 22 matching lines...) Expand all Loading... | |
33 __proto__: DeletableItem.prototype, | 33 __proto__: DeletableItem.prototype, |
34 | 34 |
35 /** | 35 /** |
36 * @type {string} the file path of this profile list item. | 36 * @type {string} the file path of this profile list item. |
37 */ | 37 */ |
38 get profilePath() { | 38 get profilePath() { |
39 return this.profileInfo_.filePath; | 39 return this.profileInfo_.filePath; |
40 }, | 40 }, |
41 | 41 |
42 /** | 42 /** |
43 * @type {boolean} whether this profile is managed. | 43 * @type {boolean} whether this profile is supervised. |
44 */ | 44 */ |
45 get isManaged() { | 45 get isSupervised() { |
Pam (message me for reviews)
2014/07/23 21:13:39
Is this used anywhere?
Marc Treib
2014/07/24 12:11:54
Apparently not. Removed.
| |
46 return this.profileInfo_.isManaged; | 46 return this.profileInfo_.isSupervised; |
47 }, | 47 }, |
48 | 48 |
49 /** @override */ | 49 /** @override */ |
50 decorate: function() { | 50 decorate: function() { |
51 DeletableItem.prototype.decorate.call(this); | 51 DeletableItem.prototype.decorate.call(this); |
52 | 52 |
53 var profileInfo = this.profileInfo_; | 53 var profileInfo = this.profileInfo_; |
54 | 54 |
55 var containerEl = this.ownerDocument.createElement('div'); | 55 var containerEl = this.ownerDocument.createElement('div'); |
56 containerEl.className = 'profile-container'; | 56 containerEl.className = 'profile-container'; |
57 | 57 |
58 var iconEl = this.ownerDocument.createElement('img'); | 58 var iconEl = this.ownerDocument.createElement('img'); |
59 iconEl.className = 'profile-img'; | 59 iconEl.className = 'profile-img'; |
60 iconEl.style.content = getProfileAvatarIcon(profileInfo.iconURL); | 60 iconEl.style.content = getProfileAvatarIcon(profileInfo.iconURL); |
61 containerEl.appendChild(iconEl); | 61 containerEl.appendChild(iconEl); |
62 | 62 |
63 var nameEl = this.ownerDocument.createElement('div'); | 63 var nameEl = this.ownerDocument.createElement('div'); |
64 nameEl.className = 'profile-name'; | 64 nameEl.className = 'profile-name'; |
65 if (profileInfo.isCurrentProfile) | 65 if (profileInfo.isCurrentProfile) |
66 nameEl.classList.add('profile-item-current'); | 66 nameEl.classList.add('profile-item-current'); |
67 containerEl.appendChild(nameEl); | 67 containerEl.appendChild(nameEl); |
68 | 68 |
69 var displayName = profileInfo.name; | 69 var displayName = profileInfo.name; |
70 if (profileInfo.isCurrentProfile) { | 70 if (profileInfo.isCurrentProfile) { |
71 displayName = loadTimeData.getStringF('profilesListItemCurrent', | 71 displayName = loadTimeData.getStringF('profilesListItemCurrent', |
72 profileInfo.name); | 72 profileInfo.name); |
73 } | 73 } |
74 nameEl.textContent = displayName; | 74 nameEl.textContent = displayName; |
75 | 75 |
76 if (profileInfo.isManaged) { | 76 if (profileInfo.isSupervised) { |
77 var supervisedEl = this.ownerDocument.createElement('div'); | 77 var supervisedEl = this.ownerDocument.createElement('div'); |
78 supervisedEl.className = 'profile-supervised'; | 78 supervisedEl.className = 'profile-supervised'; |
79 supervisedEl.textContent = | 79 supervisedEl.textContent = |
80 '(' + loadTimeData.getStringF('managedUserLabel') + ')'; | 80 '(' + loadTimeData.getStringF('supervisedUserLabel') + ')'; |
81 containerEl.appendChild(supervisedEl); | 81 containerEl.appendChild(supervisedEl); |
82 } | 82 } |
83 | 83 |
84 this.contentElement.appendChild(containerEl); | 84 this.contentElement.appendChild(containerEl); |
85 | 85 |
86 // Ensure that the button cannot be tabbed to for accessibility reasons. | 86 // Ensure that the button cannot be tabbed to for accessibility reasons. |
87 this.closeButtonElement.tabIndex = -1; | 87 this.closeButtonElement.tabIndex = -1; |
88 }, | 88 }, |
89 }; | 89 }; |
90 | 90 |
(...skipping 10 matching lines...) Expand all Loading... | |
101 | 101 |
102 /** @override */ | 102 /** @override */ |
103 createItem: function(pageInfo) { | 103 createItem: function(pageInfo) { |
104 var item = new ProfileListItem(pageInfo); | 104 var item = new ProfileListItem(pageInfo); |
105 item.deletable = this.canDeleteItems_; | 105 item.deletable = this.canDeleteItems_; |
106 return item; | 106 return item; |
107 }, | 107 }, |
108 | 108 |
109 /** @override */ | 109 /** @override */ |
110 deleteItemAtIndex: function(index) { | 110 deleteItemAtIndex: function(index) { |
111 if (loadTimeData.getBoolean('profileIsManaged')) | 111 if (loadTimeData.getBoolean('profileIsSupervised')) |
112 return; | 112 return; |
113 ManageProfileOverlay.showDeleteDialog(this.dataModel.item(index)); | 113 ManageProfileOverlay.showDeleteDialog(this.dataModel.item(index)); |
114 }, | 114 }, |
115 | 115 |
116 /** @override */ | 116 /** @override */ |
117 activateItemAtIndex: function(index) { | 117 activateItemAtIndex: function(index) { |
118 // Don't allow the user to edit a profile that is not current. | 118 // Don't allow the user to edit a profile that is not current. |
119 var profileInfo = this.dataModel.item(index); | 119 var profileInfo = this.dataModel.item(index); |
120 if (profileInfo.isCurrentProfile) | 120 if (profileInfo.isCurrentProfile) |
121 ManageProfileOverlay.showManageDialog(profileInfo); | 121 ManageProfileOverlay.showManageDialog(profileInfo); |
(...skipping 10 matching lines...) Expand all Loading... | |
132 * If false, items in this list will not be deletable. | 132 * If false, items in this list will not be deletable. |
133 * @private | 133 * @private |
134 */ | 134 */ |
135 canDeleteItems_: true, | 135 canDeleteItems_: true, |
136 }; | 136 }; |
137 | 137 |
138 return { | 138 return { |
139 ProfileList: ProfileList | 139 ProfileList: ProfileList |
140 }; | 140 }; |
141 }); | 141 }); |
OLD | NEW |