| 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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 | 95 |
| 96 /** @override */ | 96 /** @override */ |
| 97 createItem: function(pageInfo) { | 97 createItem: function(pageInfo) { |
| 98 var item = new ProfileListItem(pageInfo); | 98 var item = new ProfileListItem(pageInfo); |
| 99 item.deletable = this.canDeleteItems_; | 99 item.deletable = this.canDeleteItems_; |
| 100 return item; | 100 return item; |
| 101 }, | 101 }, |
| 102 | 102 |
| 103 /** @override */ | 103 /** @override */ |
| 104 deleteItemAtIndex: function(index) { | 104 deleteItemAtIndex: function(index) { |
| 105 if (loadTimeData.getBoolean('profileIsSupervised')) | |
| 106 return; | |
| 107 ManageProfileOverlay.showDeleteDialog(this.dataModel.item(index)); | 105 ManageProfileOverlay.showDeleteDialog(this.dataModel.item(index)); |
| 108 }, | 106 }, |
| 109 | 107 |
| 110 /** @override */ | 108 /** @override */ |
| 111 activateItemAtIndex: function(index) { | 109 activateItemAtIndex: function(index) { |
| 112 // Don't allow the user to edit a profile that is not current. | 110 // Don't allow the user to edit a profile that is not current. |
| 113 var profileInfo = this.dataModel.item(index); | 111 var profileInfo = this.dataModel.item(index); |
| 114 if (profileInfo.isCurrentProfile) | 112 if (profileInfo.isCurrentProfile) |
| 115 ManageProfileOverlay.showManageDialog(profileInfo); | 113 ManageProfileOverlay.showManageDialog(profileInfo); |
| 116 }, | 114 }, |
| (...skipping 16 matching lines...) Expand all Loading... |
| 133 * If false, items in this list will not be deletable. | 131 * If false, items in this list will not be deletable. |
| 134 * @private | 132 * @private |
| 135 */ | 133 */ |
| 136 canDeleteItems_: true, | 134 canDeleteItems_: true, |
| 137 }; | 135 }; |
| 138 | 136 |
| 139 return { | 137 return { |
| 140 ProfileList: ProfileList | 138 ProfileList: ProfileList |
| 141 }; | 139 }; |
| 142 }); | 140 }); |
| OLD | NEW |