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

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

Issue 2824493003: MD Settings: Elim is-list-item from cr-network-list-item (Closed)
Patch Set: Fix function definition Created 3 years, 8 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_item.js
diff --git a/chrome/browser/resources/settings/internet_page/network_summary_item.js b/chrome/browser/resources/settings/internet_page/network_summary_item.js
index 377c807b242aa9f43a06256d2a1a475eb781ac42..0e0b20431298b9ff95f8f6435fd2d166f33a139e 100644
--- a/chrome/browser/resources/settings/internet_page/network_summary_item.js
+++ b/chrome/browser/resources/settings/internet_page/network_summary_item.js
@@ -13,7 +13,7 @@ var DeviceStateProperties;
Polymer({
is: 'network-summary-item',
- behaviors: [I18nBehavior],
+ behaviors: [CrPolicyNetworkBehavior, I18nBehavior],
properties: {
/**
@@ -47,6 +47,60 @@ Polymer({
},
/**
+ * @return {string}
+ * @private
+ */
+ getNetworkName_: function() {
+ return CrOncStrings['OncType' + this.activeNetworkState.Type];
+ },
+
+ /**
+ * @return {string}
+ * @private
+ */
+ getNetworkStateText_: function() {
+ var network = this.activeNetworkState;
+ var state = network.ConnectionState;
+ var name = CrOnc.getNetworkName(network);
+ if (state)
+ return this.getConnectionStateText_(state, name);
+ if (this.deviceIsEnabled_(this.deviceState))
+ return CrOncStrings.networkListItemNotConnected;
+ return this.i18n('deviceOff');
+ },
+
+ /**
+ * @param {CrOnc.ConnectionState} state
+ * @param {string} name
+ * @return {string}
+ * @private
+ */
+ getConnectionStateText_: function(state, name) {
+ switch (state) {
+ case CrOnc.ConnectionState.CONNECTED:
+ return name;
+ case CrOnc.ConnectionState.CONNECTING:
+ if (name)
+ return CrOncStrings.networkListItemConnectingTo.replace('$1', name);
+ return CrOncStrings.networkListItemConnecting;
+ case CrOnc.ConnectionState.NOT_CONNECTED:
+ return CrOncStrings.networkListItemNotConnected;
+ }
+ assertNotReached();
+ return state;
+ },
+
+ /**
+ * @return {boolean}
+ * @private
+ */
+ showPolicyIndicator_: function() {
+ var network = this.activeNetworkState;
+ return network.ConnectionState == CrOnc.ConnectionState.CONNECTED ||
+ this.isPolicySource(network.Source);
+ },
+
+ /**
* Show the <network-siminfo> element if this is a disabled and locked
* cellular device.
* @return {boolean}

Powered by Google App Engine
This is Rietveld 408576698