Index: chrome/browser/resources/settings/internet_page/network_proxy.js |
diff --git a/chrome/browser/resources/settings/internet_page/network_proxy.js b/chrome/browser/resources/settings/internet_page/network_proxy.js |
index 6f7de41b76541294414562b8202e5aa6d8de1997..cfd6d819e9c74d082d0d7d04c470ef224a7dd783 100644 |
--- a/chrome/browser/resources/settings/internet_page/network_proxy.js |
+++ b/chrome/browser/resources/settings/internet_page/network_proxy.js |
@@ -9,7 +9,7 @@ |
Polymer({ |
is: 'network-proxy', |
- behaviors: [CrPolicyNetworkBehavior], |
+ behaviors: [I18nBehavior, CrPolicyNetworkBehavior], |
properties: { |
/** |
@@ -255,15 +255,27 @@ Polymer({ |
* @return {string} The description for |proxyType|. |
* @private |
*/ |
- proxyTypeDesc_: function(proxyType) { |
- // TODO(stevenjb): Translate. |
+ getProxyTypeDesc_: function(proxyType) { |
if (proxyType == CrOnc.ProxySettingsType.MANUAL) |
- return 'Manual proxy configuration'; |
+ return this.i18n('networkProxyTypeManual'); |
if (proxyType == CrOnc.ProxySettingsType.PAC) |
- return 'Automatic proxy configuration'; |
+ return this.i18n('networkProxyTypePac'); |
if (proxyType == CrOnc.ProxySettingsType.WPAD) |
- return 'Web proxy autodiscovery'; |
- return 'Direct Internet connection'; |
+ return this.i18n('networkProxyTypeWpad'); |
+ return this.i18n('networkProxyTypeDirect'); |
+ }, |
+ |
+ /** |
+ * @param {!CrOnc.ManagedProperty|undefined} property |
+ * @return {string} The string describing the policy controlling |property|. |
+ * @private |
+ */ |
+ getEnforcedString_: function(property) { |
+ if (this.isExtensionControlled(property)) |
+ return this.i18n('networkProxyControlledExtension'); |
+ if (this.isNetworkPolicyEnforced(property)) |
+ return this.i18n('networkProxyEnforcedPolicy'); |
+ return ''; |
}, |
/** |
@@ -282,6 +294,25 @@ Polymer({ |
}, |
/** |
+ * @return {boolean} Whether changing the proxy type should be disabled. |
+ * @private |
+ */ |
+ isProxyTypeDisabled_: function() { |
+ var proxySettings = this.networkProperties.ProxySettings; |
+ return !!proxySettings && this.isEnforced_(proxySettings.Type); |
+ }, |
+ |
+ /** |
+ * @param {!CrOnc.ManagedProperty|undefined} property |
+ * @return {boolean} Whether the property setting is enforced. |
+ * @private |
+ */ |
+ isEnforced_: function(property) { |
+ return this.isNetworkPolicyEnforced(property) || |
+ this.isExtensionControlled(property); |
+ }, |
+ |
+ /** |
* @param {string} property The property to test |
* @param {string} value The value to test against |
* @return {boolean} True if property == value |