| 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 f688f0524e3041e42e1a1aa8c2acbe65fc762aa4..2f59a795a4f639579f56fbfcdfd91c19c80dce8a 100644
|
| --- a/chrome/browser/resources/settings/internet_page/network_summary_item.js
|
| +++ b/chrome/browser/resources/settings/internet_page/network_summary_item.js
|
| @@ -4,7 +4,9 @@
|
|
|
| /**
|
| * @fileoverview Polymer element for displaying the network state for a specific
|
| - * type and a list of networks for that type.
|
| + * type and a list of networks for that type. NOTE: It both Cellular and Tether
|
| + * technologies are available, they are combined into a single 'Mobile data'
|
| + * section. See crbug.com/726380.
|
| */
|
|
|
| Polymer({
|
| @@ -20,6 +22,13 @@ Polymer({
|
| */
|
| deviceState: Object,
|
|
|
| + /**
|
| + * If both Cellular and Tether technologies exist, we combine the sections
|
| + * and set this to the device state for Tether.
|
| + * @type {!CrOnc.DeviceStateProperties|undefined}
|
| + */
|
| + tetherDeviceState: Object,
|
| +
|
| /**
|
| * Network state for the active network.
|
| * @type {!CrOnc.NetworkStateProperties|undefined}
|
| @@ -162,7 +171,9 @@ Polymer({
|
| */
|
| enableToggleIsVisible_: function(deviceState) {
|
| return !!deviceState && deviceState.Type != CrOnc.Type.ETHERNET &&
|
| - deviceState.Type != CrOnc.Type.VPN;
|
| + deviceState.Type != CrOnc.Type.VPN &&
|
| + (deviceState.Type == CrOnc.Type.TETHER ||
|
| + deviceState.State != CrOnc.DeviceState.UNINITIALIZED);
|
| },
|
|
|
| /**
|
| @@ -171,7 +182,9 @@ Polymer({
|
| * @private
|
| */
|
| enableToggleIsEnabled_: function(deviceState) {
|
| - return !!deviceState && deviceState.State != CrOnc.DeviceState.PROHIBITED;
|
| + return this.enableToggleIsVisible_(deviceState) &&
|
| + deviceState.State != CrOnc.DeviceState.PROHIBITED &&
|
| + deviceState.State != CrOnc.DeviceState.UNINITIALIZED;
|
| },
|
|
|
| /**
|
| @@ -184,7 +197,6 @@ Polymer({
|
| return '';
|
| switch (deviceState.Type) {
|
| case CrOnc.Type.TETHER:
|
| - return this.i18n('internetToggleTetherA11yLabel');
|
| case CrOnc.Type.CELLULAR:
|
| return this.i18n('internetToggleMobileA11yLabel');
|
| case CrOnc.Type.WI_FI:
|
| @@ -219,9 +231,10 @@ Polymer({
|
| if (!deviceState)
|
| return false;
|
| var type = deviceState.Type;
|
| - var minlen = (deviceState.Type == CrOnc.Type.WI_FI ||
|
| - deviceState.Type == CrOnc.Type.VPN ||
|
| - deviceState.Type == CrOnc.Type.TETHER) ?
|
| + if (type == CrOnc.Type.CELLULAR && this.tetherDeviceState)
|
| + return true;
|
| + var minlen = (type == CrOnc.Type.WI_FI || type == CrOnc.Type.VPN ||
|
| + type == CrOnc.Type.TETHER) ?
|
| 1 :
|
| 2;
|
| return networkStateList.length >= minlen;
|
| @@ -233,9 +246,11 @@ Polymer({
|
| */
|
| onShowDetailsTap_: function(event) {
|
| if (!this.deviceIsEnabled_(this.deviceState)) {
|
| - this.fire(
|
| - 'device-enabled-toggled',
|
| - {enabled: true, type: this.deviceState.Type});
|
| + if (this.enableToggleIsEnabled_(this.deviceState)) {
|
| + this.fire(
|
| + 'device-enabled-toggled',
|
| + {enabled: true, type: this.deviceState.Type});
|
| + }
|
| } else if (this.shouldShowSubpage_(
|
| this.deviceState, this.networkStateList)) {
|
| this.fire('show-networks', this.deviceState);
|
|
|