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 cr.define('options.network', function() { | 5 cr.define('options.network', function() { |
6 var ArrayDataModel = cr.ui.ArrayDataModel; | 6 var ArrayDataModel = cr.ui.ArrayDataModel; |
7 var List = cr.ui.List; | 7 var List = cr.ui.List; |
8 var ListItem = cr.ui.ListItem; | 8 var ListItem = cr.ui.ListItem; |
9 var ListSingleSelectionModel = cr.ui.ListSingleSelectionModel; | 9 var ListSingleSelectionModel = cr.ui.ListSingleSelectionModel; |
10 var Menu = cr.ui.Menu; | 10 var Menu = cr.ui.Menu; |
(...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
378 return el; | 378 return el; |
379 } | 379 } |
380 | 380 |
381 NetworkSelectorItem.prototype = { | 381 NetworkSelectorItem.prototype = { |
382 __proto__: NetworkMenuItem.prototype, | 382 __proto__: NetworkMenuItem.prototype, |
383 | 383 |
384 /** @override */ | 384 /** @override */ |
385 decorate: function() { | 385 decorate: function() { |
386 // TODO(kevers): Generalize method of setting default label. | 386 // TODO(kevers): Generalize method of setting default label. |
387 var policyManaged = false; | 387 var policyManaged = false; |
388 this.subtitle = loadTimeData.getString('OncStateNotConnected'); | 388 this.subtitle = loadTimeData.getString('OncConnectionStateNotConnected'); |
389 var list = this.data_.networkList; | 389 var list = this.data_.networkList; |
390 var candidateURL = null; | 390 var candidateURL = null; |
391 for (var i = 0; i < list.length; i++) { | 391 for (var i = 0; i < list.length; i++) { |
392 var networkDetails = list[i]; | 392 var networkDetails = list[i]; |
393 if (networkDetails.ConnectionState == 'Connecting' || | 393 if (networkDetails.ConnectionState == 'Connecting' || |
394 networkDetails.ConnectionState == 'Connected') { | 394 networkDetails.ConnectionState == 'Connected') { |
395 this.subtitle = getNetworkName(networkDetails); | 395 this.subtitle = getNetworkName(networkDetails); |
396 this.setSubtitleDirection('ltr'); | 396 this.setSubtitleDirection('ltr'); |
397 policyManaged = networkDetails.policyManaged; | 397 policyManaged = networkDetails.policyManaged; |
398 candidateURL = networkDetails.iconURL; | 398 candidateURL = networkDetails.iconURL; |
(...skipping 549 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
948 | 948 |
949 // Only show Ethernet control if connected. | 949 // Only show Ethernet control if connected. |
950 var ethernetConnection = getConnection_(data.wiredList); | 950 var ethernetConnection = getConnection_(data.wiredList); |
951 if (ethernetConnection) { | 951 if (ethernetConnection) { |
952 var type = String('Ethernet'); | 952 var type = String('Ethernet'); |
953 var path = ethernetConnection.servicePath; | 953 var path = ethernetConnection.servicePath; |
954 var ethernetOptions = function() { | 954 var ethernetOptions = function() { |
955 chrome.send('networkCommand', | 955 chrome.send('networkCommand', |
956 [type, path, 'options']); | 956 [type, path, 'options']); |
957 }; | 957 }; |
958 networkList.update({key: 'Ethernet', | 958 networkList.update( |
959 subtitle: loadTimeData.getString('OncStateConnected'), | 959 { key: 'Ethernet', |
960 iconURL: ethernetConnection.iconURL, | 960 subtitle: loadTimeData.getString('OncConnectionStateConnected'), |
961 command: ethernetOptions, | 961 iconURL: ethernetConnection.iconURL, |
962 policyManaged: ethernetConnection.policyManaged}); | 962 command: ethernetOptions, |
| 963 policyManaged: ethernetConnection.policyManaged } |
| 964 ); |
963 } else { | 965 } else { |
964 networkList.deleteItem('Ethernet'); | 966 networkList.deleteItem('Ethernet'); |
965 } | 967 } |
966 | 968 |
967 if (data.wifiEnabled) | 969 if (data.wifiEnabled) |
968 loadData_('WiFi', data.wirelessList, data.rememberedList); | 970 loadData_('WiFi', data.wirelessList, data.rememberedList); |
969 else | 971 else |
970 addEnableNetworkButton_('WiFi', 'enableWifi', 'WiFi'); | 972 addEnableNetworkButton_('WiFi', 'enableWifi', 'WiFi'); |
971 | 973 |
972 // Only show cellular control if available. | 974 // Only show cellular control if available. |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1145 * Whether the Network list is disabled. Only used for display purpose. | 1147 * Whether the Network list is disabled. Only used for display purpose. |
1146 * @type {boolean} | 1148 * @type {boolean} |
1147 */ | 1149 */ |
1148 cr.defineProperty(NetworkList, 'disabled', cr.PropertyKind.BOOL_ATTR); | 1150 cr.defineProperty(NetworkList, 'disabled', cr.PropertyKind.BOOL_ATTR); |
1149 | 1151 |
1150 // Export | 1152 // Export |
1151 return { | 1153 return { |
1152 NetworkList: NetworkList | 1154 NetworkList: NetworkList |
1153 }; | 1155 }; |
1154 }); | 1156 }); |
OLD | NEW |