| 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.contentSettings', function() { | 5 cr.define('options.contentSettings', function() { |
| 6 /** @const */ var ControlledSettingIndicator = | 6 /** @const */ var ControlledSettingIndicator = |
| 7 options.ControlledSettingIndicator; | 7 options.ControlledSettingIndicator; |
| 8 /** @const */ var InlineEditableItemList = options.InlineEditableItemList; | 8 /** @const */ var InlineEditableItemList = options.InlineEditableItemList; |
| 9 /** @const */ var InlineEditableItem = options.InlineEditableItem; | 9 /** @const */ var InlineEditableItem = options.InlineEditableItem; |
| 10 /** @const */ var ArrayDataModel = cr.ui.ArrayDataModel; | 10 /** @const */ var ArrayDataModel = cr.ui.ArrayDataModel; |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 var controlledBy = | 196 var controlledBy = |
| 197 this.dataItem.source && this.dataItem.source != 'preference' ? | 197 this.dataItem.source && this.dataItem.source != 'preference' ? |
| 198 this.dataItem.source : null; | 198 this.dataItem.source : null; |
| 199 | 199 |
| 200 if (controlledBy) { | 200 if (controlledBy) { |
| 201 this.setAttribute('controlled-by', controlledBy); | 201 this.setAttribute('controlled-by', controlledBy); |
| 202 this.deletable = false; | 202 this.deletable = false; |
| 203 this.editable = false; | 203 this.editable = false; |
| 204 } | 204 } |
| 205 | 205 |
| 206 if (controlledBy == 'policy' || controlledBy == 'extension') { | 206 if (controlledBy == 'policy' || controlledBy == 'extension' || |
| 207 controlledBy == 'recommended') { |
| 207 this.querySelector('.row-delete-button').hidden = true; | 208 this.querySelector('.row-delete-button').hidden = true; |
| 208 var indicator = new ControlledSettingIndicator(); | 209 var indicator = new ControlledSettingIndicator(); |
| 209 indicator.setAttribute('content-exception', this.contentType); | 210 indicator.setAttribute('content-exception', this.contentType); |
| 210 // Create a synthetic pref change event decorated as | 211 // Create a synthetic pref change event decorated as |
| 211 // CoreOptionsHandler::CreateValueForPref() does. | 212 // CoreOptionsHandler::CreateValueForPref() does. |
| 212 var event = new Event(this.contentType); | 213 var event = new Event(this.contentType); |
| 213 event.value = { controlledBy: controlledBy }; | 214 event.value = { controlledBy: controlledBy }; |
| 214 indicator.handlePrefChange(event); | 215 indicator.handlePrefChange(event); |
| 215 this.appendChild(indicator); | 216 this.appendChild(indicator); |
| 216 } | 217 } |
| (...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 696 } | 697 } |
| 697 }; | 698 }; |
| 698 | 699 |
| 699 return { | 700 return { |
| 700 ExceptionsListItem: ExceptionsListItem, | 701 ExceptionsListItem: ExceptionsListItem, |
| 701 ExceptionsAddRowListItem: ExceptionsAddRowListItem, | 702 ExceptionsAddRowListItem: ExceptionsAddRowListItem, |
| 702 ExceptionsList: ExceptionsList, | 703 ExceptionsList: ExceptionsList, |
| 703 ContentSettingsExceptionsArea: ContentSettingsExceptionsArea, | 704 ContentSettingsExceptionsArea: ContentSettingsExceptionsArea, |
| 704 }; | 705 }; |
| 705 }); | 706 }); |
| OLD | NEW |