Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(110)

Side by Side Diff: chrome/browser/resources/options/content_settings.js

Issue 5398001: Allow default desktop content settings to be managed via policy (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove Cocoa UI-changes Created 10 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 }, 71 },
72 }; 72 };
73 73
74 /** 74 /**
75 * Sets the values for all the content settings radios. 75 * Sets the values for all the content settings radios.
76 * @param {Object} dict A mapping from radio groups to the checked value for 76 * @param {Object} dict A mapping from radio groups to the checked value for
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 + '][value=' +
82 '][value=' + dict[group] + ']').checked = true; 82 dict[group]['value'] + ']').checked = true;
83 var radios = document.querySelectorAll('input[type=radio][name=' +
84 group + ']');
85 for (var i = 0, len = radios.length; i < len; i++) {
86 radios[i].disabled = dict[group]['managed'];
87 }
83 } 88 }
84 }; 89 };
85 90
86 /** 91 /**
87 * Initializes an exceptions list. 92 * Initializes an exceptions list.
88 * @param {string} type The content type that we are setting exceptions for. 93 * @param {string} type The content type that we are setting exceptions for.
89 * @param {Array} list An array of pairs, where the first element of each pair 94 * @param {Array} list An array of pairs, where the first element of each pair
90 * is the filter string, and the second is the setting (allow/block). 95 * is the filter string, and the second is the setting (allow/block).
91 */ 96 */
92 ContentSettings.setExceptions = function(type, list) { 97 ContentSettings.setExceptions = function(type, list) {
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 'list[mode=' + mode + ']'); 163 'list[mode=' + mode + ']');
159 exceptionsList.patternValidityCheckComplete(pattern, valid); 164 exceptionsList.patternValidityCheckComplete(pattern, valid);
160 }; 165 };
161 166
162 // Export 167 // Export
163 return { 168 return {
164 ContentSettings: ContentSettings 169 ContentSettings: ContentSettings
165 }; 170 };
166 171
167 }); 172 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698