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

Unified Diff: ui/webui/resources/cr_elements/network/cr_network_select.js

Issue 2627353003: Settings/Oobe: Simplify cr-network-select and use flex (Closed)
Patch Set: Add comment Created 3 years, 11 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
« no previous file with comments | « ui/webui/resources/cr_elements/network/cr_network_select.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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');
- },
});
« no previous file with comments | « ui/webui/resources/cr_elements/network/cr_network_select.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698