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

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

Issue 2300783002: MD Settings: Internet: Cleanup JS (Closed)
Patch Set: Created 4 years, 4 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_ip_config.js
diff --git a/chrome/browser/resources/settings/internet_page/network_ip_config.js b/chrome/browser/resources/settings/internet_page/network_ip_config.js
index 0bc5144d9e67316cd43f6d8498b6458287eb96a8..462904467bd9ac0374b3d532bad41e8ff8e1acbd 100644
--- a/chrome/browser/resources/settings/internet_page/network_ip_config.js
+++ b/chrome/browser/resources/settings/internet_page/network_ip_config.js
@@ -23,17 +23,14 @@ Polymer({
/**
* Whether or not the IP Address can be edited.
- * TODO(stevenjb): Implement editing.
*/
editable: {
type: Boolean,
value: false,
},
- /**
- * State of 'Configure IP Addresses Automatically'.
- */
- automatic: {
+ /** State of 'Configure IP Addresses Automatically'. */
+ automatic_: {
type: Boolean,
value: false,
observer: 'automaticChanged_',
@@ -47,7 +44,7 @@ Polymer({
* ipv6: !CrOnc.IPConfigUIProperties
* }|undefined}
*/
- ipConfig: {type: Object},
+ ipConfig_: {type: Object},
/**
* Array of properties to pass to the property list.
@@ -86,14 +83,14 @@ Polymer({
// Update the 'automatic' property.
var ipConfigType =
CrOnc.getActiveValue(this.networkProperties.IPAddressConfigType);
- this.automatic = (ipConfigType != CrOnc.IPConfigType.STATIC);
+ this.automatic_ = (ipConfigType != CrOnc.IPConfigType.STATIC);
// Update the 'ipConfig' property.
var ipv4 =
CrOnc.getIPConfigForType(this.networkProperties, CrOnc.IPType.IPV4);
var ipv6 =
CrOnc.getIPConfigForType(this.networkProperties, CrOnc.IPType.IPV6);
- this.ipConfig = {
+ this.ipConfig_ = {
ipv4: this.getIPConfigUIProperties_(ipv4),
ipv6: this.getIPConfigUIProperties_(ipv6)
};
@@ -103,13 +100,13 @@ Polymer({
* Polymer automatic changed method.
*/
automaticChanged_: function() {
- if (!this.automatic || !this.ipConfig)
+ if (!this.automatic_ || !this.ipConfig_)
return;
- if (this.automatic || !this.savedStaticIp_) {
+ if (this.automatic_ || !this.savedStaticIp_) {
// Save the static IP configuration when switching to automatic.
- this.savedStaticIp_ = this.ipConfig.ipv4;
+ this.savedStaticIp_ = this.ipConfig_.ipv4;
var configType =
- this.automatic ? CrOnc.IPConfigType.DHCP : CrOnc.IPConfigType.STATIC;
+ this.automatic_ ? CrOnc.IPConfigType.DHCP : CrOnc.IPConfigType.STATIC;
this.fire('ip-change', {
field: 'IPAddressConfigType',
value: configType,
@@ -172,16 +169,16 @@ Polymer({
* @return {boolean}
* @private
*/
- showIPEditFields_: function(editable, automatic) {
- return editable && !automatic;
+ showIPEditFields_: function() {
+ return this.editable && !this.automatic_;
},
/**
* @return {Object} An object with the edit type for each editable field.
* @private
*/
- getIPEditFields_: function(ipConfig, editable, automatic) {
- if (!editable || automatic)
+ getIPEditFields_: function() {
+ if (!this.editable || this.automatic__)
return {};
return {
'ipv4.IPAddress': 'String',
@@ -197,7 +194,7 @@ Polymer({
* @private
*/
onIPChange_: function(event) {
- if (!this.ipConfig)
+ if (!this.ipConfig_)
return;
var field = event.detail.field;
var value = event.detail.value;
@@ -205,7 +202,7 @@ Polymer({
this.set('ipConfig.' + field, value);
this.fire('ip-change', {
field: 'StaticIPConfig',
- value: this.getIPConfigProperties_(this.ipConfig.ipv4)
+ value: this.getIPConfigProperties_(this.ipConfig_.ipv4)
});
},
});

Powered by Google App Engine
This is Rietveld 408576698