Index: chrome/browser/resources/options/browser_options.js |
diff --git a/chrome/browser/resources/options/browser_options.js b/chrome/browser/resources/options/browser_options.js |
index 59fe9ebd4ae955efac37bb08999569084ed71ec5..c5fd816d04aa3b2ab4c2fbad9fefd0501d113a92 100644 |
--- a/chrome/browser/resources/options/browser_options.js |
+++ b/chrome/browser/resources/options/browser_options.js |
@@ -573,6 +573,9 @@ cr.define('options', function() { |
this.addExtensionControlledBox_('newtab-section-content', |
'newtab-controlled', |
false); |
+ this.addExtensionControlledBox_('proxy-section-content', |
+ 'proxy-controlled', |
+ true); |
document.body.addEventListener('click', function(e) { |
var button = findAncestor(e.target, function(el) { |
@@ -1508,10 +1511,14 @@ cr.define('options', function() { |
}, |
/** |
- * Set the enabled state for the proxy settings button. |
+ * Set the enabled state for the proxy settings button and its associated |
+ * message when extension controlled. |
+ * @param {boolean} disabled Whether the button should be disabled. |
+ * @param {boolean} extensionControlled Whether the proxy is extension |
+ * controlled. |
* @private |
*/ |
- setupProxySettingsSection_: function(disabled, extensionControlled) { |
+ setupProxySettingsButton_: function(disabled, extensionControlled) { |
if (!cr.isChromeOS) { |
$('proxiesConfigureButton').disabled = disabled; |
$('proxiesLabel').textContent = |
@@ -1626,6 +1633,15 @@ cr.define('options', function() { |
'newtab-controlled', |
details.newTabPage.id, |
details.newTabPage.name); |
+ this.toggleExtensionControlledBox_('proxy-section-content', |
+ 'proxy-controlled', |
+ details.proxy.id, |
+ details.proxy.name); |
+ |
+ // The proxy section contains just the warning box and nothing else, so |
+ // if we're hiding the proxy warning box, we should also hide its header |
+ // section. |
+ $('proxy-section').hidden = details.proxy.id.length == 0; |
}, |
@@ -1794,7 +1810,7 @@ cr.define('options', function() { |
'setThemesResetButtonEnabled', |
'setVirtualKeyboardCheckboxState', |
'setupPageZoomSelector', |
- 'setupProxySettingsSection', |
+ 'setupProxySettingsButton', |
'showBluetoothSettings', |
'showCreateProfileError', |
'showCreateProfileSuccess', |