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

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

Issue 12594029: Create interface to manage manual exceptions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Load the overlay only when managed users are available. Created 7 years, 8 months 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) 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 if (loadTimeData.getBoolean('managedUsersEnabled')) { 5 if (loadTimeData.getBoolean('managedUsersEnabled')) {
6 6
7 cr.define('options', function() { 7 cr.define('options', function() {
8 /** @const */ var OptionsPage = options.OptionsPage; 8 /** @const */ var OptionsPage = options.OptionsPage;
9 /** @const */ var SettingsDialog = options.SettingsDialog; 9 /** @const */ var SettingsDialog = options.SettingsDialog;
10 10
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 isPassphraseSet: false, 52 isPassphraseSet: false,
53 53
54 /** 54 /**
55 * Initialize the page. 55 * Initialize the page.
56 * @override 56 * @override
57 */ 57 */
58 initializePage: function() { 58 initializePage: function() {
59 // Call base class implementation to start preference initialization. 59 // Call base class implementation to start preference initialization.
60 SettingsDialog.prototype.initializePage.call(this); 60 SettingsDialog.prototype.initializePage.call(this);
61 61
62 $('manage-exceptions-button').onclick = function(event) {
63 var page = ManagedUserSettingsExceptionsArea.getInstance();
64 var url = page.name;
65
66 OptionsPage.navigateToPage('manualExceptions');
67 uber.invokeMethodOnParent('setPath', {path: url});
68 uber.invokeMethodOnParent('setTitle',
69 {title: loadTimeData.getString('manualExceptionsTabTitle')});
70 };
71
62 $('get-content-packs-button').onclick = function(event) { 72 $('get-content-packs-button').onclick = function(event) {
63 window.open(loadTimeData.getString('getContentPacksURL')); 73 window.open(loadTimeData.getString('getContentPacksURL'));
64 }; 74 };
65 75
66 $('set-passphrase').onclick = function() { 76 $('set-passphrase').onclick = function() {
67 OptionsPage.navigateToPage('setPassphrase'); 77 OptionsPage.navigateToPage('setPassphrase');
68 }; 78 };
69 79
70 $('use-passphrase-checkbox').onclick = function() { 80 $('use-passphrase-checkbox').onclick = function() {
71 $('set-passphrase').disabled = !$('use-passphrase-checkbox').checked; 81 $('set-passphrase').disabled = !$('use-passphrase-checkbox').checked;
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 181
172 var ManagedUserSettingsForTesting = { 182 var ManagedUserSettingsForTesting = {
173 getSetPassphraseButton: function() { 183 getSetPassphraseButton: function() {
174 return $('set-passphrase'); 184 return $('set-passphrase');
175 }, 185 },
176 getUnlockButton: function() { 186 getUnlockButton: function() {
177 return $('unlock-settings'); 187 return $('unlock-settings');
178 } 188 }
179 }; 189 };
180 190
191 /**
192 * Initializes an exceptions list.
193 * @param {Array} list An array of pairs, where the first element of each pair
194 * is the filter string, and the second is the setting (allow/block).
195 */
196 ManagedUserSettings.setManualExceptions = function(list) {
197 $('manual-exceptions').setManualExceptions(list);
198 };
199
200 /**
201 * The browser's response to a request to check the validity of a given URL
202 * pattern.
203 * @param {string} mode The browser mode.
204 * @param {string} pattern The pattern.
205 * @param {bool} valid Whether said pattern is valid in the context of
206 * a content exception setting.
207 */
208 ManagedUserSettings.patternValidityCheckComplete =
209 function(pattern, valid) {
210 $('manual-exceptions').patternValidityCheckComplete(pattern, valid);
211 };
212
181 // Export 213 // Export
182 return { 214 return {
183 ManagedUserSettings: ManagedUserSettings, 215 ManagedUserSettings: ManagedUserSettings,
184 ManagedUserSettingsForTesting: ManagedUserSettingsForTesting, 216 ManagedUserSettingsForTesting: ManagedUserSettingsForTesting,
185 ManagedUserAuthentication: ManagedUserAuthentication 217 ManagedUserAuthentication: ManagedUserAuthentication
186 }; 218 };
187 }); 219 });
188 220
189 } 221 }
OLDNEW
« no previous file with comments | « chrome/browser/resources/options/managed_user_settings.html ('k') | chrome/browser/resources/options/options.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698