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

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

Issue 2707033006: MD Settings: Internet: Use custom a11y labels for network toggle buttons (Closed)
Patch Set: Feedback Created 3 years, 10 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 796ab656a1ebf777a417f3fa749a59f470b65cd1..a478660a30d6332ffcbc2e1fa4aedf86487afe78 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: [Polymer.IronA11yKeysBehavior],
+ behaviors: [Polymer.IronA11yKeysBehavior, I18nBehavior],
properties: {
/**
@@ -31,9 +31,6 @@ Polymer({
*/
activeNetworkState: Object,
- /** String for a11y purposes. */
- itemName: String,
-
/**
* List of all network state data for the network type.
* @type {!Array<!CrOnc.NetworkStateProperties>}
@@ -238,6 +235,26 @@ Polymer({
},
/**
+ * @param {!DeviceStateProperties} deviceState
+ * @return {string}
+ * @private
+ */
+ getToggleA11yString_: function(deviceState) {
+ if (!this.enableToggleIsVisible_(deviceState))
+ return '';
+ switch (deviceState.Type) {
+ case CrOnc.Type.CELLULAR:
+ return this.i18n('internetToggleMobileA11yLabel');
+ case CrOnc.Type.WI_FI:
+ return this.i18n('internetToggleWiFiA11yLabel');
+ case CrOnc.Type.WI_MAX:
+ return this.i18n('internetToggleWiMAXA11yLabel');
+ }
+ assertNotReached();
+ return '';
+ },
+
+ /**
* @return {boolean} Whether or not to show the UI to expand the list.
* @private
*/

Powered by Google App Engine
This is Rietveld 408576698