Chromium Code Reviews| Index: chrome/browser/resources/options/managed_user_settings.js |
| diff --git a/chrome/browser/resources/options/managed_user_settings.js b/chrome/browser/resources/options/managed_user_settings.js |
| index b94cc959961e7e2a4238bc19fc5f19c1f0339108..0a80940a8c3f03756d4817517ec79c825ce49326 100644 |
| --- a/chrome/browser/resources/options/managed_user_settings.js |
| +++ b/chrome/browser/resources/options/managed_user_settings.js |
| @@ -59,6 +59,21 @@ cr.define('options', function() { |
| // Call base class implementation to start preference initialization. |
| SettingsDialog.prototype.initializePage.call(this); |
| + var exceptionsButtons = |
| + this.pageDiv.querySelectorAll('.exceptions-list-button'); |
| + exceptionsButtons[0].onclick = function(event) { |
|
James Hawkins
2013/04/02 15:57:33
This seems fragile; why are we only adding onclick
Sergiu
2013/04/02 17:14:09
Yeah, that wasn't exactly right since there is onl
|
| + var page = ManagedUserSettingsExceptionsArea.getInstance(); |
| + var url = page.name; |
| + window.history.replaceState({pageName: page.name}, |
|
James Hawkins
2013/04/02 15:57:33
What's with this replaceState?
Sergiu
2013/04/02 17:14:09
I thought this was needed by looking at the conten
|
| + page.title, |
| + '/' + url); |
| + |
| + OptionsPage.navigateToPage('manualExceptions'); |
| + uber.invokeMethodOnParent('setPath', {path: url}); |
| + uber.invokeMethodOnParent('setTitle', |
| + {title: loadTimeData.getString('manualExceptionsTabTitle')}); |
| + }; |
| + |
| $('get-content-packs-button').onclick = function(event) { |
| window.open(loadTimeData.getString('getContentPacksURL')); |
| }; |
| @@ -178,6 +193,28 @@ cr.define('options', function() { |
| } |
| }; |
| + /** |
| + * Initializes an exceptions list. |
| + * @param {Array} list An array of pairs, where the first element of each pair |
| + * is the filter string, and the second is the setting (allow/block). |
| + */ |
| + ManagedUserSettings.setManualExceptions = function(list) { |
| + $('manual-exceptions').setManualExceptions(list); |
| + }; |
| + |
| + /** |
| + * The browser's response to a request to check the validity of a given URL |
| + * pattern. |
| + * @param {string} mode The browser mode. |
| + * @param {string} pattern The pattern. |
| + * @param {bool} valid Whether said pattern is valid in the context of |
| + * a content exception setting. |
| + */ |
| + ManagedUserSettings.patternValidityCheckComplete = |
| + function(pattern, valid) { |
| + $('manual-exceptions').patternValidityCheckComplete(pattern, valid); |
| + }; |
| + |
| // Export |
| return { |
| ManagedUserSettings: ManagedUserSettings, |