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

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

Issue 2300783002: MD Settings: Internet: Cleanup JS (Closed)
Patch Set: Feedback 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_summary.js
diff --git a/chrome/browser/resources/settings/internet_page/network_summary.js b/chrome/browser/resources/settings/internet_page/network_summary.js
index f34bba6ebe9be6e9455947c8b8036f3e87ad0da7..e5d5b068d8ae654ad1d5932dcfcf930c934ddec3 100644
--- a/chrome/browser/resources/settings/internet_page/network_summary.js
+++ b/chrome/browser/resources/settings/internet_page/network_summary.js
@@ -47,38 +47,42 @@ Polymer({
},
/**
+ * Interface for networkingPrivate calls, passed from internet_page.
+ * @type {NetworkingPrivate}
+ */
+ networkingPrivate: Object,
+
+ /**
* The device state for each network device type.
- * @type {DeviceStateObject}
+ * @private {DeviceStateObject}
*/
- deviceStates: {
+ deviceStates_: {
type: Object,
- value: function() { return {}; },
+ value: function() {
+ return {};
+ },
},
/**
* Array of active network states, one per device type.
- * @type {!Array<!CrOnc.NetworkStateProperties>}
+ * @private {!Array<!CrOnc.NetworkStateProperties>}
*/
- activeNetworkStates: {
+ activeNetworkStates_: {
type: Array,
- value: function() { return []; },
+ value: function() {
+ return [];
+ },
},
/**
* List of network state data for each network type.
- * @type {NetworkStateListObject}
- */
- networkStateLists: {
- type: Object,
- value: function() { return {}; },
- },
-
- /**
- * Interface for networkingPrivate calls, passed from internet_page.
- * @type {NetworkingPrivate}
+ * @private {NetworkStateListObject}
*/
- networkingPrivate: {
+ networkStateLists_: {
type: Object,
+ value: function() {
+ return {};
+ },
},
},
@@ -188,13 +192,17 @@ Polymer({
* networkingPrivate.onNetworkListChanged event callback.
* @private
*/
- onNetworkListChangedEvent_: function() { this.getNetworkLists_(); },
+ onNetworkListChangedEvent_: function() {
+ this.getNetworkLists_();
+ },
/**
* networkingPrivate.onDeviceStateListChanged event callback.
* @private
*/
- onDeviceStateListChangedEvent_: function() { this.getNetworkLists_(); },
+ onDeviceStateListChangedEvent_: function() {
+ this.getNetworkLists_();
+ },
/**
* networkingPrivate.onNetworksChanged event callback.
@@ -249,9 +257,9 @@ Polymer({
return;
}
// Find the active state for the type and update it.
- for (let i = 0; i < this.activeNetworkStates.length; ++i) {
- if (this.activeNetworkStates[i].type == state.type) {
- this.activeNetworkStates[i] = state;
+ for (let i = 0; i < this.activeNetworkStates_.length; ++i) {
+ if (this.activeNetworkStates_[i].type == state.type) {
+ this.activeNetworkStates_[i] = state;
return;
}
}
@@ -327,7 +335,7 @@ Polymer({
for (let state of opt_deviceStates)
newDeviceStates[state.Type] = state;
} else {
- newDeviceStates = this.deviceStates;
+ newDeviceStates = this.deviceStates_;
}
// Clear any current networks.
@@ -376,9 +384,9 @@ Polymer({
this.activeNetworkIds_.add(state.GUID);
}
- this.deviceStates = newDeviceStates;
- this.networkStateLists = newNetworkStateLists;
+ this.deviceStates_ = newDeviceStates;
+ this.networkStateLists_ = newNetworkStateLists;
// Set activeNetworkStates last to rebuild the dom-repeat.
- this.activeNetworkStates = newActiveNetworkStates;
+ this.activeNetworkStates_ = newActiveNetworkStates;
},
});

Powered by Google App Engine
This is Rietveld 408576698