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 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 /** | 122 /** |
123 * Object providing network type values for data binding. | 123 * Object providing network type values for data binding. |
124 * @const | 124 * @const |
125 * @private | 125 * @private |
126 */ | 126 */ |
127 NetworkType_: { | 127 NetworkType_: { |
128 type: Object, | 128 type: Object, |
129 value: { | 129 value: { |
130 CELLULAR: CrOnc.Type.CELLULAR, | 130 CELLULAR: CrOnc.Type.CELLULAR, |
131 ETHERNET: CrOnc.Type.ETHERNET, | 131 ETHERNET: CrOnc.Type.ETHERNET, |
| 132 TETHER: CrOnc.Type.TETHER, |
132 VPN: CrOnc.Type.VPN, | 133 VPN: CrOnc.Type.VPN, |
133 WIFI: CrOnc.Type.WI_FI, | 134 WIFI: CrOnc.Type.WI_FI, |
134 WIMAX: CrOnc.Type.WI_MAX, | 135 WIMAX: CrOnc.Type.WI_MAX, |
135 }, | 136 }, |
136 readOnly: true | 137 readOnly: true |
137 }, | 138 }, |
138 }, | 139 }, |
139 | 140 |
140 /** | 141 /** |
141 * Listener function for chrome.networkingPrivate.onNetworksChanged event. | 142 * Listener function for chrome.networkingPrivate.onNetworksChanged event. |
(...skipping 652 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
794 * @return {!Array<string>} The fields to display in the info section. | 795 * @return {!Array<string>} The fields to display in the info section. |
795 * @private | 796 * @private |
796 */ | 797 */ |
797 getInfoFields_: function() { | 798 getInfoFields_: function() { |
798 /** @type {!Array<string>} */ var fields = []; | 799 /** @type {!Array<string>} */ var fields = []; |
799 var type = this.networkProperties.Type; | 800 var type = this.networkProperties.Type; |
800 if (type == CrOnc.Type.CELLULAR && !!this.networkProperties.Cellular) { | 801 if (type == CrOnc.Type.CELLULAR && !!this.networkProperties.Cellular) { |
801 fields.push( | 802 fields.push( |
802 'Cellular.ActivationState', 'Cellular.RoamingState', | 803 'Cellular.ActivationState', 'Cellular.RoamingState', |
803 'RestrictedConnectivity', 'Cellular.ServingOperator.Name'); | 804 'RestrictedConnectivity', 'Cellular.ServingOperator.Name'); |
| 805 } else if (type == CrOnc.Type.TETHER && !!this.networkProperties.Tether) { |
| 806 fields.push( |
| 807 'Tether.BatteryPercentage', 'Tether.SignalStrength', |
| 808 'Tether.Carrier'); |
804 } else if (type == CrOnc.Type.VPN && !!this.networkProperties.VPN) { | 809 } else if (type == CrOnc.Type.VPN && !!this.networkProperties.VPN) { |
805 var vpnType = CrOnc.getActiveValue(this.networkProperties.VPN.Type); | 810 var vpnType = CrOnc.getActiveValue(this.networkProperties.VPN.Type); |
806 if (vpnType == 'ThirdPartyVPN') { | 811 if (vpnType == 'ThirdPartyVPN') { |
807 fields.push('VPN.ThirdPartyVPN.ProviderName'); | 812 fields.push('VPN.ThirdPartyVPN.ProviderName'); |
808 } else { | 813 } else { |
809 fields.push('VPN.Host', 'VPN.Type'); | 814 fields.push('VPN.Host', 'VPN.Type'); |
810 if (vpnType == 'OpenVPN') | 815 if (vpnType == 'OpenVPN') |
811 fields.push('VPN.OpenVPN.Username'); | 816 fields.push('VPN.OpenVPN.Username'); |
812 else if (vpnType == 'L2TP-IPsec') | 817 else if (vpnType == 'L2TP-IPsec') |
813 fields.push('VPN.L2TP.Username'); | 818 fields.push('VPN.L2TP.Username'); |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
952 */ | 957 */ |
953 allPropertiesMatch_: function(curValue, newValue) { | 958 allPropertiesMatch_: function(curValue, newValue) { |
954 for (var key in newValue) { | 959 for (var key in newValue) { |
955 if (newValue[key] != curValue[key]) | 960 if (newValue[key] != curValue[key]) |
956 return false; | 961 return false; |
957 } | 962 } |
958 return true; | 963 return true; |
959 } | 964 } |
960 }); | 965 }); |
961 })(); | 966 })(); |
OLD | NEW |