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 430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
441 inetAddress = data.ipconfigDHCP.address; | 441 inetAddress = data.ipconfigDHCP.address; |
442 inetSubnetAddress = data.ipconfigDHCP.subnetAddress; | 442 inetSubnetAddress = data.ipconfigDHCP.subnetAddress; |
443 inetGateway = data.ipconfigDHCP.gateway; | 443 inetGateway = data.ipconfigDHCP.gateway; |
444 inetDns = data.ipconfigDHCP.dns; | 444 inetDns = data.ipconfigDHCP.dns; |
445 } | 445 } |
446 | 446 |
447 // Hide the dhcp/static radio if needed. | 447 // Hide the dhcp/static radio if needed. |
448 $('ipTypeDHCPDiv').hidden = !data.showStaticIPConfig; | 448 $('ipTypeDHCPDiv').hidden = !data.showStaticIPConfig; |
449 $('ipTypeStaticDiv').hidden = !data.showStaticIPConfig; | 449 $('ipTypeStaticDiv').hidden = !data.showStaticIPConfig; |
450 | 450 |
451 // Hide change-proxy-button if proxy is not configurable. | 451 // Hide change-proxy-button and change-proxy-section if not showing proxy. |
452 $('change-proxy-button').hidden = !data.proxyConfigurable; | 452 $('change-proxy-button').hidden = !data.showProxy; |
453 // If necessary, set text for change-proxy-text and show it. | 453 $('change-proxy-section').hidden = !data.showProxy; |
454 var changeProxyText = $('change-proxy-text'); | |
455 if (data.changeProxyText != '') { | |
456 changeProxyText.textContent = | |
457 localStrings.getString(data.changeProxyText); | |
458 changeProxyText.hidden = false; | |
459 } else { | |
460 changeProxyText.hidden = true; | |
461 } | |
462 // Hide change-proxy-section if button and text are hidden. | |
463 $('change-proxy-section').hidden = !data.proxyConfigurable && | |
464 changeProxyText.hidden; | |
465 | 454 |
466 var ipConfigList = $('ipConfigList'); | 455 var ipConfigList = $('ipConfigList'); |
467 ipConfigList.disabled = $('ipTypeDHCP').checked || !data.showStaticIPConfig; | 456 ipConfigList.disabled = $('ipTypeDHCP').checked || !data.showStaticIPConfig; |
468 options.internet.IPConfigList.decorate(ipConfigList); | 457 options.internet.IPConfigList.decorate(ipConfigList); |
469 ipConfigList.autoExpands = true; | 458 ipConfigList.autoExpands = true; |
470 var model = new ArrayDataModel([]); | 459 var model = new ArrayDataModel([]); |
471 model.push({ | 460 model.push({ |
472 'property': 'inetAddress', | 461 'property': 'inetAddress', |
473 'name': localStrings.getString('inetAddress'), | 462 'name': localStrings.getString('inetAddress'), |
474 'value': inetAddress, | 463 'value': inetAddress, |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
668 // Don't show page name in address bar and in history to prevent people | 657 // Don't show page name in address bar and in history to prevent people |
669 // navigate here by hand and solve issue with page session restore. | 658 // navigate here by hand and solve issue with page session restore. |
670 OptionsPage.showPageByName('detailsInternetPage', false); | 659 OptionsPage.showPageByName('detailsInternetPage', false); |
671 }; | 660 }; |
672 | 661 |
673 // Export | 662 // Export |
674 return { | 663 return { |
675 InternetOptions: InternetOptions | 664 InternetOptions: InternetOptions |
676 }; | 665 }; |
677 }); | 666 }); |
OLD | NEW |