Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 /** | 5 /** |
| 6 * @fileoverview | 6 * @fileoverview |
| 7 * 'settings-internet-detail' is the settings subpage containing details | 7 * 'settings-internet-detail' is the settings subpage containing details |
| 8 * for a network. | 8 * for a network. |
| 9 */ | 9 */ |
| 10 (function() { | 10 (function() { |
| (...skipping 868 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 879 fields.push('RestrictedConnectivity', 'WiMAX.EAP.Identity'); | 879 fields.push('RestrictedConnectivity', 'WiMAX.EAP.Identity'); |
| 880 } | 880 } |
| 881 return fields; | 881 return fields; |
| 882 }, | 882 }, |
| 883 | 883 |
| 884 /** | 884 /** |
| 885 * @return {!Array<string>} The fields to display in the Advanced section. | 885 * @return {!Array<string>} The fields to display in the Advanced section. |
| 886 * @private | 886 * @private |
| 887 */ | 887 */ |
| 888 getAdvancedFields_: function() { | 888 getAdvancedFields_: function() { |
| 889 /** @type {!Array<string>} */ var fields = []; | 889 /** @type {!Array<string>} */ var fields = []; |
|
stevenjb
2017/06/22 22:29:19
+if (type != CrOnc.Type.TETHER)
Kyle Horimoto
2017/06/22 23:03:00
Done.
| |
| 890 fields.push('MacAddress'); | 890 fields.push('MacAddress'); |
| 891 var type = this.networkProperties.Type; | 891 var type = this.networkProperties.Type; |
| 892 if (type == CrOnc.Type.CELLULAR && !!this.networkProperties.Cellular) { | 892 if (type == CrOnc.Type.CELLULAR && !!this.networkProperties.Cellular) { |
| 893 fields.push( | 893 fields.push( |
| 894 'Cellular.Carrier', 'Cellular.Family', 'Cellular.NetworkTechnology', | 894 'Cellular.Carrier', 'Cellular.Family', 'Cellular.NetworkTechnology', |
| 895 'Cellular.ServingOperator.Code'); | 895 'Cellular.ServingOperator.Code'); |
| 896 } else if (type == CrOnc.Type.WI_FI) { | 896 } else if (type == CrOnc.Type.WI_FI) { |
| 897 fields.push( | 897 fields.push( |
| 898 'WiFi.SSID', 'WiFi.BSSID', 'WiFi.SignalStrength', 'WiFi.Security', | 898 'WiFi.SSID', 'WiFi.BSSID', 'WiFi.SignalStrength', 'WiFi.Security', |
| 899 'WiFi.EAP.Outer', 'WiFi.EAP.Inner', 'WiFi.EAP.SubjectMatch', | 899 'WiFi.EAP.Outer', 'WiFi.EAP.Inner', 'WiFi.EAP.SubjectMatch', |
| (...skipping 21 matching lines...) Expand all Loading... | |
| 921 } | 921 } |
| 922 return fields; | 922 return fields; |
| 923 }, | 923 }, |
| 924 | 924 |
| 925 /** | 925 /** |
| 926 * @param {!CrOnc.NetworkProperties} networkProperties | 926 * @param {!CrOnc.NetworkProperties} networkProperties |
| 927 * @return {boolean} | 927 * @return {boolean} |
| 928 * @private | 928 * @private |
| 929 */ | 929 */ |
| 930 showAdvanced_: function(networkProperties) { | 930 showAdvanced_: function(networkProperties) { |
| 931 if (networkProperties.Type == CrOnc.Type.TETHER) | |
| 932 return false; | |
|
stevenjb
2017/06/22 22:29:19
Modify getAdvancedFields_ instead (see above)
Kyle Horimoto
2017/06/22 23:03:00
That's not good enough. When this network is conne
| |
| 931 return this.hasAdvancedFields_() || this.hasDeviceFields_() || | 933 return this.hasAdvancedFields_() || this.hasDeviceFields_() || |
| 932 this.isRememberedOrConnected_(networkProperties); | 934 this.isRememberedOrConnected_(networkProperties); |
| 933 }, | 935 }, |
| 934 | 936 |
| 935 /** | 937 /** |
| 936 * @return {boolean} | 938 * @return {boolean} |
| 937 * @private | 939 * @private |
| 938 */ | 940 */ |
| 939 hasAdvancedFields_: function() { | 941 hasAdvancedFields_: function() { |
| 940 return this.hasVisibleFields_(this.getAdvancedFields_()); | 942 return this.hasVisibleFields_(this.getAdvancedFields_()); |
| (...skipping 14 matching lines...) Expand all Loading... | |
| 955 hasAdvancedOrDeviceFields_: function() { | 957 hasAdvancedOrDeviceFields_: function() { |
| 956 return this.hasAdvancedFields_() || this.hasDeviceFields_(); | 958 return this.hasAdvancedFields_() || this.hasDeviceFields_(); |
| 957 }, | 959 }, |
| 958 | 960 |
| 959 /** | 961 /** |
| 960 * @param {!CrOnc.NetworkProperties} networkProperties | 962 * @param {!CrOnc.NetworkProperties} networkProperties |
| 961 * @return {boolean} | 963 * @return {boolean} |
| 962 * @private | 964 * @private |
| 963 */ | 965 */ |
| 964 hasNetworkSection_: function(networkProperties) { | 966 hasNetworkSection_: function(networkProperties) { |
| 965 if (networkProperties.Type == CrOnc.Type.VPN) | 967 if (networkProperties.Type == CrOnc.Type.VPN || |
| 968 networkProperties.Type == CrOnc.Type.TETHER) { | |
|
stevenjb
2017/06/22 22:29:19
This seems incorrect to me. Connected Tether netwo
Kyle Horimoto
2017/06/22 23:03:00
As discussed offline, UX says we should not displa
| |
| 966 return false; | 969 return false; |
| 970 } | |
| 967 if (networkProperties.Type == CrOnc.Type.CELLULAR) | 971 if (networkProperties.Type == CrOnc.Type.CELLULAR) |
| 968 return true; | 972 return true; |
| 969 return this.isRememberedOrConnected_(networkProperties); | 973 return this.isRememberedOrConnected_(networkProperties); |
|
stevenjb
2017/06/22 22:29:19
This logic may need to change though, we probably
Kyle Horimoto
2017/06/22 23:03:00
Acknowledged.
| |
| 970 }, | 974 }, |
| 971 | 975 |
| 972 /** | 976 /** |
| 973 * @param {!CrOnc.NetworkProperties} networkProperties | 977 * @param {!CrOnc.NetworkProperties} networkProperties |
| 974 * @return {boolean} | 978 * @return {boolean} |
| 975 * @private | 979 * @private |
| 976 */ | 980 */ |
| 977 showCellularSim_: function(networkProperties) { | 981 showCellularSim_: function(networkProperties) { |
| 978 if (networkProperties.Type != 'Cellular' || !networkProperties.Cellular) { | 982 if (networkProperties.Type != 'Cellular' || !networkProperties.Cellular) { |
| 979 return false; | 983 return false; |
| (...skipping 12 matching lines...) Expand all Loading... | |
| 992 */ | 996 */ |
| 993 allPropertiesMatch_: function(curValue, newValue) { | 997 allPropertiesMatch_: function(curValue, newValue) { |
| 994 for (var key in newValue) { | 998 for (var key in newValue) { |
| 995 if (newValue[key] != curValue[key]) | 999 if (newValue[key] != curValue[key]) |
| 996 return false; | 1000 return false; |
| 997 } | 1001 } |
| 998 return true; | 1002 return true; |
| 999 } | 1003 } |
| 1000 }); | 1004 }); |
| 1001 })(); | 1005 })(); |
| OLD | NEW |