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

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

Issue 542253003: Add a global on/off switch for content settings and expose a toggle on the Website Settings options… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@global-settings
Patch Set: Rebase. Created 6 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/options/website_settings.js
diff --git a/chrome/browser/resources/options/website_settings.js b/chrome/browser/resources/options/website_settings.js
index caa619932e157d7e7d16ccd5b5b903b447c62d14..e8ada593606c2689fb9e055cb242cd3d0810e310 100644
--- a/chrome/browser/resources/options/website_settings.js
+++ b/chrome/browser/resources/options/website_settings.js
@@ -66,6 +66,11 @@ cr.define('options.ContentSettings', function() {
chrome.send('setDefaultContentSetting', [this.value]);
};
+ $('global-setting-toggle').onchange = function(event) {
+ var value = event.target.checked;
+ chrome.send('setGlobalEnabled', [value]);
+ };
+
var searchBox = $('website-settings-search-box');
searchBox.addEventListener('search',
this.handleSearchQueryChange_.bind(this));
@@ -144,9 +149,10 @@ cr.define('options.ContentSettings', function() {
which will be used to sort the origins in the main/allowed list.
* @param {!Object} blockedDict An optional dictionary of origins to their
usage, which will be used to sort the origins in the blocked list.
+ * @param {bool} isGloballyEnabled If the content setting is turned on.
* @private
*/
- populateOrigins: function(allowedDict, blockedDict) {
+ populateOrigins: function(allowedDict, blockedDict, isGloballyEnabled) {
this.populateOriginsHelper_(this.allowedList_, allowedDict);
if (blockedDict) {
this.populateOriginsHelper_(this.blockedList_, blockedDict);
@@ -159,6 +165,7 @@ cr.define('options.ContentSettings', function() {
$('allowed-origin-list-title').hidden = true;
this.allowedList_.classList.add('nonsplit-origin-list');
}
+ $('global-setting-toggle').checked = isGloballyEnabled;
},
/**
@@ -242,9 +249,10 @@ cr.define('options.ContentSettings', function() {
}
};
- WebsiteSettingsManager.populateOrigins = function(allowedDict, blockedDict) {
+ WebsiteSettingsManager.populateOrigins = function(allowedDict, blockedDict,
+ isGloballyEnabled) {
WebsiteSettingsManager.getInstance().populateOrigins(allowedDict,
- blockedDict);
+ blockedDict, isGloballyEnabled);
};
WebsiteSettingsManager.updateDefault = function(dict) {

Powered by Google App Engine
This is Rietveld 408576698