| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 * that group. | 77 * that group. |
| 78 */ | 78 */ |
| 79 ContentSettings.setContentFilterSettingsValue = function(dict) { | 79 ContentSettings.setContentFilterSettingsValue = function(dict) { |
| 80 for (var group in dict) { | 80 for (var group in dict) { |
| 81 document.querySelector('input[type=radio][name=' + group + | 81 document.querySelector('input[type=radio][name=' + group + |
| 82 '][value=' + dict[group] + ']').checked = true; | 82 '][value=' + dict[group] + ']').checked = true; |
| 83 } | 83 } |
| 84 }; | 84 }; |
| 85 | 85 |
| 86 /** | 86 /** |
| 87 * Called to set whether we show certain UI related to the cookies prompt. | |
| 88 * @param {boolean} enabled The value --enable-cookies-prompt. | |
| 89 * that group. | |
| 90 */ | |
| 91 ContentSettings.setCookiesPromptEnabled = function(enabled) { | |
| 92 cookiesExceptionsList.enableAskOption = enabled; | |
| 93 | |
| 94 if (!enabled) | |
| 95 $('cookiesAskRadio').classList.add('hidden'); | |
| 96 } | |
| 97 | |
| 98 /** | |
| 99 * Initializes an exceptions list. | 87 * Initializes an exceptions list. |
| 100 * @param {string} type The content type that we are setting exceptions for. | 88 * @param {string} type The content type that we are setting exceptions for. |
| 101 * @param {Array} list An array of pairs, where the first element of each pair | 89 * @param {Array} list An array of pairs, where the first element of each pair |
| 102 * is the filter string, and the second is the setting (allow/block). | 90 * is the filter string, and the second is the setting (allow/block). |
| 103 */ | 91 */ |
| 104 ContentSettings.setExceptions = function(type, list) { | 92 ContentSettings.setExceptions = function(type, list) { |
| 105 var exceptionsList = | 93 var exceptionsList = |
| 106 document.querySelector('div[contentType=' + type + '] list'); | 94 document.querySelector('div[contentType=' + type + '] list'); |
| 107 exceptionsList.clear(); | 95 exceptionsList.clear(); |
| 108 for (var i = 0; i < list.length; i++) { | 96 for (var i = 0; i < list.length; i++) { |
| (...skipping 23 matching lines...) Expand all Loading... |
| 132 exceptionsList.patternValidityCheckComplete(pattern, valid); | 120 exceptionsList.patternValidityCheckComplete(pattern, valid); |
| 133 }; | 121 }; |
| 134 | 122 |
| 135 // Export | 123 // Export |
| 136 return { | 124 return { |
| 137 ContentSettings: ContentSettings | 125 ContentSettings: ContentSettings |
| 138 }; | 126 }; |
| 139 | 127 |
| 140 }); | 128 }); |
| 141 | 129 |
| OLD | NEW |