Index: ui/webui/resources/cr_elements/network/cr_network_select.js |
diff --git a/ui/webui/resources/cr_elements/network/cr_network_select.js b/ui/webui/resources/cr_elements/network/cr_network_select.js |
index b4192abb61a44b9fccfa008ed9f9b7025df075e1..d799bd76fdb058c640741b0b31728c793a113595 100644 |
--- a/ui/webui/resources/cr_elements/network/cr_network_select.js |
+++ b/ui/webui/resources/cr_elements/network/cr_network_select.js |
@@ -14,47 +14,6 @@ Polymer({ |
properties: { |
/** |
- * Network state for the active network. |
- * @type {?CrOnc.NetworkStateProperties} |
- */ |
- activeNetworkState: Object, |
- |
- /** |
- * If true, the element includes an 'expand' button that toggles the |
- * expanded state of the network list. |
- */ |
- expandable: { |
- type: Boolean, |
- value: false, |
- }, |
- |
- /** |
- * The maximum height in pixels for the list. |
- */ |
- maxHeight: { |
- type: Number, |
- value: 1000, |
- }, |
- |
- /** |
- * If true, expand the network list. |
- */ |
- networkListOpened: { |
- type: Boolean, |
- value: true, |
- observer: 'networkListOpenedChanged_', |
- }, |
- |
- /** |
- * If true, show the active network state. |
- */ |
- showActive: { |
- type: Boolean, |
- value: false, |
- reflectToAttribute: true, |
- }, |
- |
- /** |
* Show all buttons in list items. |
*/ |
showButtons: { |
@@ -64,17 +23,6 @@ Polymer({ |
}, |
/** |
- * List of all network state data for all visible networks. |
- * @type {!Array<!CrOnc.NetworkStateProperties>} |
- */ |
- networkStateList: { |
- type: Array, |
- value: function() { |
- return []; |
- } |
- }, |
- |
- /** |
* The list of custom items to display after the list of networks. |
* See CrNetworkList for details. |
* @type {!Array<CrNetworkList.CustomItemState>} |
@@ -90,7 +38,6 @@ Polymer({ |
* Whether to handle "item-selected" for network items. |
* If this property is false, "network-item-selected" event is fired |
* carrying CrOnc.NetworkStateProperties as event detail. |
- * |
* @type {Function} |
*/ |
handleNetworkItemSelected: { |
@@ -98,6 +45,18 @@ Polymer({ |
value: false, |
reflectToAttribute: true, |
}, |
+ |
+ /** |
+ * List of all network state data for all visible networks. |
+ * @private {!Array<!CrOnc.NetworkStateProperties>} |
+ */ |
+ networkStateList_: { |
+ type: Array, |
+ value: function() { |
+ return []; |
+ } |
+ }, |
+ |
}, |
/** |
@@ -117,15 +76,15 @@ Polymer({ |
/** @override */ |
attached: function() { |
- this.networkListChangedListener_ = this.refreshNetworks_.bind(this); |
+ this.networkListChangedListener_ = this.refreshNetworks.bind(this); |
chrome.networkingPrivate.onNetworkListChanged.addListener( |
this.networkListChangedListener_); |
- this.deviceStateListChangedListener_ = this.refreshNetworks_.bind(this); |
+ this.deviceStateListChangedListener_ = this.refreshNetworks.bind(this); |
chrome.networkingPrivate.onDeviceStateListChanged.addListener( |
this.deviceStateListChangedListener_); |
- this.refreshNetworks_(); |
+ this.refreshNetworks(); |
chrome.networkingPrivate.requestNetworkScan(); |
}, |
@@ -138,19 +97,11 @@ Polymer({ |
}, |
/** |
- * Polymer changed function. |
- * @private |
- */ |
- networkListOpenedChanged_: function() { |
- if (this.networkListOpened) |
- chrome.networkingPrivate.requestNetworkScan(); |
- }, |
- |
- /** |
- * Request the list of visible networks. |
+ * Request the list of visible networks. May be called externally to force a |
+ * refresh and list update (e.g. when the element is shown). |
* @private |
*/ |
- refreshNetworks_: function() { |
+ refreshNetworks: function() { |
var filter = { |
networkType: chrome.networkingPrivate.NetworkType.ALL, |
visible: true, |
@@ -165,8 +116,7 @@ Polymer({ |
* @private |
*/ |
getNetworksCallback_: function(states) { |
- this.activeNetworkState = states[0] || undefined; |
- this.networkStateList = states; |
+ this.networkStateList_ = states; |
}, |
/** |
@@ -191,8 +141,4 @@ Polymer({ |
console.error('networkingPrivate.startConnect error: ' + lastError); |
}); |
}, |
- |
- getExpandA11yText_: function() { |
- return this.i18n('networkExpandA11yLabel'); |
- }, |
}); |