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

Unified Diff: chrome/browser/resources/options/content_settings.js

Issue 5964003: Content settings lists moved to sub-sub pages. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix syntax 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/options/content_settings.js
diff --git a/chrome/browser/resources/options/content_settings.js b/chrome/browser/resources/options/content_settings.js
index ed8c4a4e44d9591ab7282f040d5fca76eff2e26c..787386e2085414e46711ef326e12c7774094dc82 100644
--- a/chrome/browser/resources/options/content_settings.js
+++ b/chrome/browser/resources/options/content_settings.js
@@ -29,17 +29,15 @@ cr.define('options', function() {
chrome.send('getContentFilterSettings');
- var exceptionsLists = this.pageDiv.querySelectorAll('list');
- for (var i = 0; i < exceptionsLists.length; i++) {
- options.contentSettings.ExceptionsList.decorate(exceptionsLists[i]);
+ var exceptionsButtons =
+ this.pageDiv.querySelectorAll('.exceptionsListButton');
+ for (var i = 0; i < exceptionsButtons.length; i++) {
+ exceptionsButtons[i].onclick = function(event) {
+ ContentSettingsExceptionsArea.getInstance().showList(
+ event.target.getAttribute('contentType'));
+ OptionsPage.showPageByName('contentExceptions');
+ };
}
- ContentSettings.hideOTRLists();
-
- this.addEventListener('visibleChange', function(event) {
- for (var i = 0; i < exceptionsLists.length; i++) {
- exceptionsLists[i].redraw();
- }
- });
// Cookies filter page ---------------------------------------------------
$('block-third-party-cookies').onclick = function(event) {
@@ -63,12 +61,12 @@ cr.define('options', function() {
/**
* Handles a hash value in the URL (such as bar in
- * chrome://options/foo#bar). Overrides the default action of showing an
- * overlay by instead navigating to a particular subtab.
+ * chrome://options/foo#bar).
* @param {string} hash The hash value.
*/
handleHash: function(hash) {
- // TODO(estade): show subpage for hash.
+ ContentSettingsExceptionsArea.getInstance().showList(hash);
+ OptionsPage.showPageByName('contentExceptions');
},
};
@@ -110,7 +108,7 @@ cr.define('options', function() {
ContentSettings.setOTRExceptions = function(type, list) {
var exceptionsList =
document.querySelector('div[contentType=' + type + ']' +
- ' div list[mode=normal]');
+ ' list[mode=otr]');
exceptionsList.parentNode.classList.remove('hidden');
@@ -122,25 +120,6 @@ cr.define('options', function() {
};
/**
- * Called when the last incognito window is closed.
- */
- ContentSettings.OTRProfileDestroyed = function() {
- this.hideOTRLists();
- };
-
- /**
- * Clears and hides the incognito exceptions lists.
- */
- ContentSettings.hideOTRLists = function() {
- var otrLists = document.querySelectorAll('list[mode=otr]');
-
- for (var i = 0; i < otrLists.length; i++) {
- otrLists[i].reset();
- otrLists[i].parentNode.classList.add('hidden');
- }
- };
-
- /**
* Sets the initial value for the Third Party Cookies checkbox.
* @param {boolean=} block True if we are blocking third party cookies.
*/

Powered by Google App Engine
This is Rietveld 408576698