| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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', function() { | 5 cr.define('options', function() { |
| 6 | 6 |
| 7 var OptionsPage = options.OptionsPage; | 7 var OptionsPage = options.OptionsPage; |
| 8 | 8 |
| 9 ////////////////////////////////////////////////////////////////////////////// | 9 ////////////////////////////////////////////////////////////////////////////// |
| 10 // ContentSettings class: | 10 // ContentSettings class: |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 * @param {Object} dict A mapping from radio groups to the checked value for | 75 * @param {Object} dict A mapping from radio groups to the checked value for |
| 76 * that group. | 76 * that group. |
| 77 */ | 77 */ |
| 78 ContentSettings.setContentFilterSettingsValue = function(dict) { | 78 ContentSettings.setContentFilterSettingsValue = function(dict) { |
| 79 for (var group in dict) { | 79 for (var group in dict) { |
| 80 document.querySelector('input[type=radio][name=' + group + '][value=' + | 80 document.querySelector('input[type=radio][name=' + group + '][value=' + |
| 81 dict[group]['value'] + ']').checked = true; | 81 dict[group]['value'] + ']').checked = true; |
| 82 var radios = document.querySelectorAll('input[type=radio][name=' + | 82 var radios = document.querySelectorAll('input[type=radio][name=' + |
| 83 group + ']'); | 83 group + ']'); |
| 84 for (var i = 0, len = radios.length; i < len; i++) { | 84 for (var i = 0, len = radios.length; i < len; i++) { |
| 85 radios[i].disabled = dict[group]['managed']; | 85 var managed = dict[group]['managed']; |
| 86 radios[i].managed = dict[group]['managed']; | 86 radios[i].disabled = managed; |
| 87 radios[i].controlledBy = managed ? 'policy': null; |
| 87 } | 88 } |
| 88 } | 89 } |
| 89 OptionsPage.updateManagedBannerVisibility(); | 90 OptionsPage.updateManagedBannerVisibility(); |
| 90 }; | 91 }; |
| 91 | 92 |
| 92 /** | 93 /** |
| 93 * Initializes an exceptions list. | 94 * Initializes an exceptions list. |
| 94 * @param {string} type The content type that we are setting exceptions for. | 95 * @param {string} type The content type that we are setting exceptions for. |
| 95 * @param {Array} list An array of pairs, where the first element of each pair | 96 * @param {Array} list An array of pairs, where the first element of each pair |
| 96 * is the filter string, and the second is the setting (allow/block). | 97 * is the filter string, and the second is the setting (allow/block). |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 'list[mode=' + mode + ']'); | 132 'list[mode=' + mode + ']'); |
| 132 exceptionsList.patternValidityCheckComplete(pattern, valid); | 133 exceptionsList.patternValidityCheckComplete(pattern, valid); |
| 133 }; | 134 }; |
| 134 | 135 |
| 135 // Export | 136 // Export |
| 136 return { | 137 return { |
| 137 ContentSettings: ContentSettings | 138 ContentSettings: ContentSettings |
| 138 }; | 139 }; |
| 139 | 140 |
| 140 }); | 141 }); |
| OLD | NEW |