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

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

Issue 2290853002: MD Settings: Use network name for detail page title (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_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..4b7efd55f8c37d3cbfcce950f4ad18868f6cb75a 100644
--- a/chrome/browser/resources/settings/internet_page/network_summary.js
+++ b/chrome/browser/resources/settings/internet_page/network_summary.js
@@ -378,7 +378,16 @@ Polymer({
this.deviceStates = newDeviceStates;
this.networkStateLists = newNetworkStateLists;
- // Set activeNetworkStates last to rebuild the dom-repeat.
+
+ // Sort and set activeNetworkStates last to rebuild the dom-repeat.
+ var networkTypeSortOrder = [
+ CrOnc.Type.ETHERNET, CrOnc.Type.WI_FI, CrOnc.Type.CELLULAR,
+ CrOnc.Type.WI_MAX, CrOnc.Type.VPN
+ ];
+ newActiveNetworkStates.sort(function(a, b) {
+ return networkTypeSortOrder.indexOf(a.Type) -
+ networkTypeSortOrder.indexOf(a.Type);
+ });
dschuyler 2016/08/30 00:50:01 This looks like the same sort order could be gaine
dschuyler 2016/08/30 00:55:37 Whoops that ~7 is mixing JS calls and array iterat
stevenjb 2016/08/30 15:36:49 The sort is likely to be trivial compared to the m
this.activeNetworkStates = newActiveNetworkStates;
},
});

Powered by Google App Engine
This is Rietveld 408576698