| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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', function() { | 5 cr.define('options', function() { |
| 6 var OptionsPage = options.OptionsPage; | 6 var OptionsPage = options.OptionsPage; |
| 7 const ArrayDataModel = cr.ui.ArrayDataModel; | 7 const ArrayDataModel = cr.ui.ArrayDataModel; |
| 8 | 8 |
| 9 ///////////////////////////////////////////////////////////////////////////// | 9 ///////////////////////////////////////////////////////////////////////////// |
| 10 // InternetOptions class: | 10 // InternetOptions class: |
| (...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 448 inetAddress = data.ipconfigDHCP.address; | 448 inetAddress = data.ipconfigDHCP.address; |
| 449 inetSubnetAddress = data.ipconfigDHCP.subnetAddress; | 449 inetSubnetAddress = data.ipconfigDHCP.subnetAddress; |
| 450 inetGateway = data.ipconfigDHCP.gateway; | 450 inetGateway = data.ipconfigDHCP.gateway; |
| 451 inetDns = data.ipconfigDHCP.dns; | 451 inetDns = data.ipconfigDHCP.dns; |
| 452 } | 452 } |
| 453 | 453 |
| 454 // Hide the dhcp/static radio if needed. | 454 // Hide the dhcp/static radio if needed. |
| 455 $('ipTypeDHCPDiv').hidden = !data.showStaticIPConfig; | 455 $('ipTypeDHCPDiv').hidden = !data.showStaticIPConfig; |
| 456 $('ipTypeStaticDiv').hidden = !data.showStaticIPConfig; | 456 $('ipTypeStaticDiv').hidden = !data.showStaticIPConfig; |
| 457 | 457 |
| 458 // Hide change-proxy-button if proxy is not configurable. | 458 // Hide change-proxy-button and change-proxy-section if not showing proxy. |
| 459 $('change-proxy-button').hidden = !data.proxyConfigurable; | 459 $('change-proxy-button').hidden = !data.showProxy; |
| 460 // If necessary, set text for change-proxy-text and show it. | 460 $('change-proxy-section').hidden = !data.showProxy; |
| 461 var changeProxyText = $('change-proxy-text'); | |
| 462 if (data.changeProxyText != '') { | |
| 463 changeProxyText.textContent = | |
| 464 localStrings.getString(data.changeProxyText); | |
| 465 changeProxyText.hidden = false; | |
| 466 } else { | |
| 467 changeProxyText.hidden = true; | |
| 468 } | |
| 469 // Hide change-proxy-section if button and text are hidden. | |
| 470 $('change-proxy-section').hidden = !data.proxyConfigurable && | |
| 471 changeProxyText.hidden; | |
| 472 | 461 |
| 473 var ipConfigList = $('ipConfigList'); | 462 var ipConfigList = $('ipConfigList'); |
| 474 ipConfigList.disabled = $('ipTypeDHCP').checked || !data.showStaticIPConfig; | 463 ipConfigList.disabled = $('ipTypeDHCP').checked || !data.showStaticIPConfig; |
| 475 options.internet.IPConfigList.decorate(ipConfigList); | 464 options.internet.IPConfigList.decorate(ipConfigList); |
| 476 ipConfigList.autoExpands = true; | 465 ipConfigList.autoExpands = true; |
| 477 var model = new ArrayDataModel([]); | 466 var model = new ArrayDataModel([]); |
| 478 model.push({ | 467 model.push({ |
| 479 'property': 'inetAddress', | 468 'property': 'inetAddress', |
| 480 'name': localStrings.getString('inetAddress'), | 469 'name': localStrings.getString('inetAddress'), |
| 481 'value': inetAddress, | 470 'value': inetAddress, |
| (...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 678 | 667 |
| 679 InternetOptions.invalidNetworkSettings = function () { | 668 InternetOptions.invalidNetworkSettings = function () { |
| 680 alert(localStrings.getString('invalidNetworkSettings')); | 669 alert(localStrings.getString('invalidNetworkSettings')); |
| 681 }; | 670 }; |
| 682 | 671 |
| 683 // Export | 672 // Export |
| 684 return { | 673 return { |
| 685 InternetOptions: InternetOptions | 674 InternetOptions: InternetOptions |
| 686 }; | 675 }; |
| 687 }); | 676 }); |
| OLD | NEW |