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

Unified Diff: chrome/browser/resources/settings/internet_page/network_property_list.js

Issue 1369403006: Add cr-policy-network-indicator and add to internet settings (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Separate policy indicator strings Created 5 years, 2 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/settings/internet_page/network_property_list.js
diff --git a/chrome/browser/resources/settings/internet_page/network_property_list.js b/chrome/browser/resources/settings/internet_page/network_property_list.js
index 87b64216d51eb68115725d5ac0a8f314f48e4ad1..1660f0fb84a824878562e8d8d969fc9d0ac9602c 100644
--- a/chrome/browser/resources/settings/internet_page/network_property_list.js
+++ b/chrome/browser/resources/settings/internet_page/network_property_list.js
@@ -14,9 +14,12 @@
Polymer({
is: 'network-property-list',
+ behaviors: [CrPolicyNetworkBehavior],
+
properties: {
/**
* The dictionary containing the properties to display.
+ * @type {!Object|undefined}
*/
propertyDict: {
type: Object
@@ -80,18 +83,18 @@ Polymer({
},
/**
- * @param {!Object|undefined} propertyDict
+ * @param {!Object} propertyDict
* @param {string} key The property key.
* @return {boolean} Whether or not the property exists in |propertyDict|.
* @private
*/
hasPropertyValue_: function(propertyDict, key) {
- var value = (propertyDict && this.get(key, propertyDict)) || undefined;
+ var value = this.get(key, propertyDict);
return (value !== undefined && value !== '');
},
/**
- * @param {!Object|undefined} propertyDict
+ * @param {!Object} propertyDict
* @param {!Object} editFieldTypes The editFieldTypes object.
* @param {string} key The property key.
* @return {boolean} Whether or not to show the property. Editable properties
@@ -105,7 +108,7 @@ Polymer({
},
/**
- * @param {!Object|undefined} propertyDict
+ * @param {!Object} propertyDict
* @param {!Object} editFieldTypes The editFieldTypes object.
* @param {string} key The property key.
* @return {boolean} True if |key| exists in |propertiesDict| and is not
@@ -115,12 +118,15 @@ Polymer({
showNoEdit_: function(propertyDict, editFieldTypes, key) {
if (!this.hasPropertyValue_(propertyDict, key))
return false;
- var editType = editFieldTypes[key];
- return !editType;
+ var property = /** @type {!CrOnc.NetworkProperty|undefined} */(
+ this.get(key, propertyDict));
+ if (this.isNetworkPolicyEnforced(property))
+ return true;
+ return !editFieldTypes[key];
},
/**
- * @param {!Object|undefined} propertyDict
+ * @param {!Object} propertyDict
* @param {!Object} editFieldTypes The editFieldTypes object.
* @param {string} key The property key.
* @param {string} type The field type.
@@ -129,18 +135,22 @@ Polymer({
* @private
*/
showEdit_: function(propertyDict, editFieldTypes, key, type) {
+ if (!this.hasPropertyValue_(propertyDict, key))
+ return false;
+ var property = /** @type {!CrOnc.NetworkProperty|undefined} */(
+ this.get(key, propertyDict));
+ if (this.isNetworkPolicyEnforced(property))
+ return false;
return editFieldTypes[key] == type;
},
/**
- * @param {!Object|undefined} propertyDict
+ * @param {!Object} propertyDict
* @param {string} key The property key.
* @return {string} The text to display for the property value.
* @private
*/
getPropertyValue_: function(propertyDict, key) {
- if (!propertyDict)
- return '';
var value = this.get(key, propertyDict);
if (value === undefined)
return '';

Powered by Google App Engine
This is Rietveld 408576698