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