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 869 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 = []; |
890 fields.push('MacAddress'); | |
891 var type = this.networkProperties.Type; | 890 var type = this.networkProperties.Type; |
| 891 if (type != CrOnc.Type.TETHER) |
| 892 fields.push('MacAddress'); |
892 if (type == CrOnc.Type.CELLULAR && !!this.networkProperties.Cellular) { | 893 if (type == CrOnc.Type.CELLULAR && !!this.networkProperties.Cellular) { |
893 fields.push( | 894 fields.push( |
894 'Cellular.Carrier', 'Cellular.Family', 'Cellular.NetworkTechnology', | 895 'Cellular.Carrier', 'Cellular.Family', 'Cellular.NetworkTechnology', |
895 'Cellular.ServingOperator.Code'); | 896 'Cellular.ServingOperator.Code'); |
896 } else if (type == CrOnc.Type.WI_FI) { | 897 } else if (type == CrOnc.Type.WI_FI) { |
897 fields.push( | 898 fields.push( |
898 'WiFi.SSID', 'WiFi.BSSID', 'WiFi.SignalStrength', 'WiFi.Security', | 899 'WiFi.SSID', 'WiFi.BSSID', 'WiFi.SignalStrength', 'WiFi.Security', |
899 'WiFi.EAP.Outer', 'WiFi.EAP.Inner', 'WiFi.EAP.SubjectMatch', | 900 'WiFi.EAP.Outer', 'WiFi.EAP.Inner', 'WiFi.EAP.SubjectMatch', |
900 'WiFi.EAP.Identity', 'WiFi.EAP.AnonymousIdentity', 'WiFi.Frequency'); | 901 'WiFi.EAP.Identity', 'WiFi.EAP.AnonymousIdentity', 'WiFi.Frequency'); |
901 } else if (type == CrOnc.Type.WI_MAX) { | 902 } else if (type == CrOnc.Type.WI_MAX) { |
(...skipping 19 matching lines...) Expand all Loading... |
921 } | 922 } |
922 return fields; | 923 return fields; |
923 }, | 924 }, |
924 | 925 |
925 /** | 926 /** |
926 * @param {!CrOnc.NetworkProperties} networkProperties | 927 * @param {!CrOnc.NetworkProperties} networkProperties |
927 * @return {boolean} | 928 * @return {boolean} |
928 * @private | 929 * @private |
929 */ | 930 */ |
930 showAdvanced_: function(networkProperties) { | 931 showAdvanced_: function(networkProperties) { |
| 932 if (networkProperties.Type == CrOnc.Type.TETHER) { |
| 933 // These settings apply to the underlying WiFi network, not the Tether |
| 934 // network. |
| 935 return false; |
| 936 } |
931 return this.hasAdvancedFields_() || this.hasDeviceFields_() || | 937 return this.hasAdvancedFields_() || this.hasDeviceFields_() || |
932 this.isRememberedOrConnected_(networkProperties); | 938 this.isRememberedOrConnected_(networkProperties); |
933 }, | 939 }, |
934 | 940 |
935 /** | 941 /** |
936 * @return {boolean} | 942 * @return {boolean} |
937 * @private | 943 * @private |
938 */ | 944 */ |
939 hasAdvancedFields_: function() { | 945 hasAdvancedFields_: function() { |
940 return this.hasVisibleFields_(this.getAdvancedFields_()); | 946 return this.hasVisibleFields_(this.getAdvancedFields_()); |
(...skipping 14 matching lines...) Expand all Loading... |
955 hasAdvancedOrDeviceFields_: function() { | 961 hasAdvancedOrDeviceFields_: function() { |
956 return this.hasAdvancedFields_() || this.hasDeviceFields_(); | 962 return this.hasAdvancedFields_() || this.hasDeviceFields_(); |
957 }, | 963 }, |
958 | 964 |
959 /** | 965 /** |
960 * @param {!CrOnc.NetworkProperties} networkProperties | 966 * @param {!CrOnc.NetworkProperties} networkProperties |
961 * @return {boolean} | 967 * @return {boolean} |
962 * @private | 968 * @private |
963 */ | 969 */ |
964 hasNetworkSection_: function(networkProperties) { | 970 hasNetworkSection_: function(networkProperties) { |
| 971 if (networkProperties.Type == CrOnc.Type.TETHER) { |
| 972 // These settings apply to the underlying WiFi network, not the Tether |
| 973 // network. |
| 974 return false; |
| 975 } |
965 if (networkProperties.Type == CrOnc.Type.VPN) | 976 if (networkProperties.Type == CrOnc.Type.VPN) |
966 return false; | 977 return false; |
967 if (networkProperties.Type == CrOnc.Type.CELLULAR) | 978 if (networkProperties.Type == CrOnc.Type.CELLULAR) |
968 return true; | 979 return true; |
969 return this.isRememberedOrConnected_(networkProperties); | 980 return this.isRememberedOrConnected_(networkProperties); |
970 }, | 981 }, |
971 | 982 |
972 /** | 983 /** |
973 * @param {!CrOnc.NetworkProperties} networkProperties | 984 * @param {!CrOnc.NetworkProperties} networkProperties |
974 * @return {boolean} | 985 * @return {boolean} |
(...skipping 17 matching lines...) Expand all Loading... |
992 */ | 1003 */ |
993 allPropertiesMatch_: function(curValue, newValue) { | 1004 allPropertiesMatch_: function(curValue, newValue) { |
994 for (var key in newValue) { | 1005 for (var key in newValue) { |
995 if (newValue[key] != curValue[key]) | 1006 if (newValue[key] != curValue[key]) |
996 return false; | 1007 return false; |
997 } | 1008 } |
998 return true; | 1009 return true; |
999 } | 1010 } |
1000 }); | 1011 }); |
1001 })(); | 1012 })(); |
OLD | NEW |