OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 * @typedef {{ | 6 * @typedef {{ |
7 * ConnectionState: string, | 7 * ConnectionState: string, |
8 * iconURL: string, | 8 * iconURL: string, |
9 * policyManaged: boolean, | 9 * policyManaged: boolean, |
10 * servicePath: string | 10 * servicePath: string |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
68 | 68 |
69 /** | 69 /** |
70 * Indicates if cellular device supports network scanning. | 70 * Indicates if cellular device supports network scanning. |
71 * @type {boolean} | 71 * @type {boolean} |
72 * @private | 72 * @private |
73 */ | 73 */ |
74 var cellularSupportsScan_ = false; | 74 var cellularSupportsScan_ = false; |
75 | 75 |
76 /** | 76 /** |
77 * Indicates the current SIM lock type of the cellular device. | 77 * Indicates the current SIM lock type of the cellular device. |
78 * @type {boolean} | 78 * @type {string} |
79 * @private | 79 * @private |
80 */ | 80 */ |
81 var cellularSimLockType_ = ''; | 81 var cellularSimLockType_ = ''; |
82 | 82 |
83 /** | 83 /** |
84 * Indicates whether the SIM card is absent on the cellular device. | 84 * Indicates whether the SIM card is absent on the cellular device. |
85 * @type {boolean} | 85 * @type {boolean} |
86 * @private | 86 * @private |
87 */ | 87 */ |
88 var cellularSimAbsent_ = false; | 88 var cellularSimAbsent_ = false; |
(...skipping 853 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
942 if (entry.networkList) | 942 if (entry.networkList) |
943 return new NetworkSelectorItem( | 943 return new NetworkSelectorItem( |
944 /** @type {{key: string, networkList: Array.<NetworkInfo>}} */( | 944 /** @type {{key: string, networkList: Array.<NetworkInfo>}} */( |
945 entry)); | 945 entry)); |
946 if (entry.command) | 946 if (entry.command) |
947 return new NetworkButtonItem( | 947 return new NetworkButtonItem( |
948 /** @type {{key: string, subtitle: string, command: Function}} */( | 948 /** @type {{key: string, subtitle: string, command: Function}} */( |
949 entry)); | 949 entry)); |
950 if (entry.menu) | 950 if (entry.menu) |
951 return new NetworkMenuItem(entry); | 951 return new NetworkMenuItem(entry); |
952 return undefined; | 952 assertNotReached(); |
Dan Beam
2014/10/01 01:25:57
how do we know this isn't being hit?
Vitaly Pavlenko
2014/10/01 03:07:31
We'll see on try bots if it is being hit or not. I
| |
953 }, | 953 }, |
954 | 954 |
955 /** | 955 /** |
956 * Deletes an element from the list. | 956 * Deletes an element from the list. |
957 * @param {string} key Unique identifier for the element. | 957 * @param {string} key Unique identifier for the element. |
958 */ | 958 */ |
959 deleteItem: function(key) { | 959 deleteItem: function(key) { |
960 var index = this.indexOf(key); | 960 var index = this.indexOf(key); |
961 if (index != undefined) | 961 if (index != undefined) |
962 this.dataModel.splice(index, 1); | 962 this.dataModel.splice(index, 1); |
(...skipping 19 matching lines...) Expand all Loading... | |
982 * Sets the default icon to use for each network type if disconnected. | 982 * Sets the default icon to use for each network type if disconnected. |
983 * @param {!Object.<string, string>} data Mapping of network type to icon | 983 * @param {!Object.<string, string>} data Mapping of network type to icon |
984 * data url. | 984 * data url. |
985 */ | 985 */ |
986 NetworkList.setDefaultNetworkIcons = function(data) { | 986 NetworkList.setDefaultNetworkIcons = function(data) { |
987 defaultIcons_ = Object.create(data); | 987 defaultIcons_ = Object.create(data); |
988 }; | 988 }; |
989 | 989 |
990 /** | 990 /** |
991 * Chrome callback for updating network controls. | 991 * Chrome callback for updating network controls. |
992 * @param {{wiredList: Array.<NetworkInfo>, wirelessList: Array.<NetworkInfo>, | 992 * @param {{cellularAvailable: boolean, |
993 * vpnList: Array.<NetworkInfo>, rememberedList: Array.<NetworkInfo>, | 993 * cellularEnabled: boolean, |
994 * wifiAvailable: boolean, wifiEnabled: boolean, wimaxAvailable: boolean, | 994 * cellularSimAbsent: boolean, |
995 * wimaxEnabled: boolean, cellularAvailable: boolean, | 995 * cellularSimLockType: string, |
996 * cellularEnabled: boolean, cellularSupportsScan: boolean}} data | 996 * cellularSupportsScan: boolean, |
997 * Description of available network devices and their corresponding state. | 997 * rememberedList: Array.<NetworkInfo>, |
998 * vpnList: Array.<NetworkInfo>, | |
999 * wifiAvailable: boolean, | |
1000 * wifiEnabled: boolean, | |
1001 * wimaxAvailable: boolean, | |
1002 * wimaxEnabled: boolean, | |
1003 * wiredList: Array.<NetworkInfo>, | |
1004 * wirelessList: Array.<NetworkInfo>}} data Description of available | |
1005 * network devices and their corresponding state. | |
998 */ | 1006 */ |
999 NetworkList.refreshNetworkData = function(data) { | 1007 NetworkList.refreshNetworkData = function(data) { |
1000 var networkList = $('network-list'); | 1008 var networkList = $('network-list'); |
1001 networkList.startBatchUpdates(); | 1009 networkList.startBatchUpdates(); |
1002 cellularAvailable_ = data.cellularAvailable; | 1010 cellularAvailable_ = data.cellularAvailable; |
1003 cellularEnabled_ = data.cellularEnabled; | 1011 cellularEnabled_ = data.cellularEnabled; |
1004 cellularSupportsScan_ = data.cellularSupportsScan; | 1012 cellularSupportsScan_ = data.cellularSupportsScan; |
1005 cellularSimAbsent_ = data.cellularSimAbsent; | 1013 cellularSimAbsent_ = data.cellularSimAbsent; |
1006 cellularSimLockType_ = data.cellularSimLockType; | 1014 cellularSimLockType_ = data.cellularSimLockType; |
1007 wimaxAvailable_ = data.wimaxAvailable; | 1015 wimaxAvailable_ = data.wimaxAvailable; |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1221 /** | 1229 /** |
1222 * Whether the Network list is disabled. Only used for display purpose. | 1230 * Whether the Network list is disabled. Only used for display purpose. |
1223 */ | 1231 */ |
1224 cr.defineProperty(NetworkList, 'disabled', cr.PropertyKind.BOOL_ATTR); | 1232 cr.defineProperty(NetworkList, 'disabled', cr.PropertyKind.BOOL_ATTR); |
1225 | 1233 |
1226 // Export | 1234 // Export |
1227 return { | 1235 return { |
1228 NetworkList: NetworkList | 1236 NetworkList: NetworkList |
1229 }; | 1237 }; |
1230 }); | 1238 }); |
OLD | NEW |