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 86c503102f47dfe03940a62eb69aaf8597a79d05..55281a9df7a5ec310de84b12ae3bdd0401aae9fd 100644 |
--- a/chrome/browser/resources/options/website_settings.js |
+++ b/chrome/browser/resources/options/website_settings.js |
@@ -69,6 +69,11 @@ cr.define('options', 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)); |
@@ -146,9 +151,10 @@ cr.define('options', 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); |
@@ -160,6 +166,7 @@ cr.define('options', function() { |
$('blocked-origin-list-title').hidden = true; |
this.allowedList_.classList.add('nonsplit-origin-list'); |
} |
+ $('global-setting-toggle').checked = isGloballyEnabled; |
}, |
/** |
@@ -240,9 +247,10 @@ cr.define('options', function() { |
} |
}; |
- WebsiteSettingsManager.populateOrigins = function(allowedDict, blockedDict) { |
+ WebsiteSettingsManager.populateOrigins = function(allowedDict, blockedDict, |
+ isGloballyEnabled) { |
WebsiteSettingsManager.getInstance().populateOrigins(allowedDict, |
- blockedDict); |
+ blockedDict, isGloballyEnabled); |
}; |
WebsiteSettingsManager.updateDefault = function(dict) { |