Chromium Code Reviews| Index: chrome/browser/resources/options/content_settings_exceptions_area.js |
| diff --git a/chrome/browser/resources/options/content_settings_exceptions_area.js b/chrome/browser/resources/options/content_settings_exceptions_area.js |
| index 3ad7ac62a552f0e1079168e4d2c97cf12e4e61c1..05a940cb8aa559c44e6f93ed06211ed5d3d74963 100644 |
| --- a/chrome/browser/resources/options/content_settings_exceptions_area.js |
| +++ b/chrome/browser/resources/options/content_settings_exceptions_area.js |
| @@ -345,6 +345,27 @@ cr.define('options.contentSettings', function() { |
| settingOption.selected = true; |
| }, |
| + /** |
| + * Updates UI to indicate that the exception was overruled by a source. |
| + * |
| + * @param {string} overruledBy The source that overrules the exception. |
| + */ |
| + setOverruledBy: function(overruledBy) { |
| + this.classList.toggle('overruled', !!overruledBy); |
| + var textElt = this.querySelector('.exception-pattern .static-text'); |
| + textElt.setAttribute('title', |
| + loadTimeData.getString('exceptionDisabledByPolicy')); |
| + |
| + var indicator = new ControlledSettingIndicator(); |
| + indicator.setAttribute('content-exception', this.contentType); |
| + // Create a synthetic pref change event decorated as |
| + // CoreOptionsHandler::CreateValueForPref() does. |
| + var event = new Event(this.contentType); |
| + event.value = { controlledBy: overruledBy }; |
| + indicator.handlePrefChange(event); |
| + this.appendChild(indicator); |
|
Bernhard Bauer
2016/05/18 09:55:13
What happens if this is called multiple times (e.g
huangs
2016/05/18 13:52:49
If content settings change then the entire list ge
|
| + }, |
| + |
| /** @override */ |
| get currentInputIsValid() { |
| return this.inputValidityKnown && this.inputIsValid; |
| @@ -520,6 +541,20 @@ cr.define('options.contentSettings', function() { |
| }, |
| /** |
| + * Updates UI to indicate that user exceptions were overruled by a source. |
| + * |
| + * @param {string} overruledBy The source that overrules user exceptions. |
| + */ |
| + setOverruledBy: function(overruledBy) { |
| + for (var index = 0; index < this.dataModel.length; ++index) { |
| + var item = this.getListItemByIndex(index); |
| + if (item.dataItem.source == 'preference') { |
|
Bernhard Bauer
2016/05/18 09:55:13
Doesn't this mean that any preference rule is mark
huangs
2016/05/18 13:52:49
The "overruled" concept only applies to Policy Def
Bernhard Bauer
2016/05/19 14:20:40
I don't really want to get into a product discussi
huangs
2016/05/20 15:16:46
I think treating default as "super wildcard except
Bernhard Bauer
2016/05/23 13:34:11
I'm not sure what you are trying to say. This UI w
huangs
2016/05/24 05:02:00
By "bug" do you mean:
(1) Code is not doing what
Bernhard Bauer
2016/05/24 16:54:34
Yes, that's what I mean.
|
| + item.setOverruledBy(overruledBy); |
| + } |
| + } |
| + }, |
| + |
| + /** |
| * Sets the exceptions in the js model. |
| * |
| * @param {Array<options.Exception>} entries A list of dictionaries of |