| 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 655 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 666 $('inetUsername').textContent = data.username; | 666 $('inetUsername').textContent = data.username; |
| 667 } else { | 667 } else { |
| 668 OptionsPage.showTab($('internetNavTab')); | 668 OptionsPage.showTab($('internetNavTab')); |
| 669 detailsPage.ethernet = true; | 669 detailsPage.ethernet = true; |
| 670 detailsPage.wireless = false; | 670 detailsPage.wireless = false; |
| 671 detailsPage.vpn = false; | 671 detailsPage.vpn = false; |
| 672 detailsPage.cellular = false; | 672 detailsPage.cellular = false; |
| 673 detailsPage.gsm = false; | 673 detailsPage.gsm = false; |
| 674 } | 674 } |
| 675 | 675 |
| 676 // Update controlled option indicators. | 676 detailsPage.initializeControlledSettingIndicators(data) |
| 677 indicators = cr.doc.querySelectorAll( | |
| 678 '#detailsInternetPage .controlled-setting-indicator'); | |
| 679 for (var i = 0; i < indicators.length; i++) { | |
| 680 var dataProperty = indicators[i].getAttribute('data'); | |
| 681 if (dataProperty && data[dataProperty]) { | |
| 682 var controlledBy = data[dataProperty].controlledBy; | |
| 683 if (controlledBy) { | |
| 684 indicators[i].controlledBy = controlledBy; | |
| 685 var forElement = $(indicators[i].getAttribute('for')); | |
| 686 if (forElement) | |
| 687 forElement.disabled = true; | |
| 688 if (forElement.type == 'radio' && !forElement.checked) | |
| 689 indicators[i].hidden = true; | |
| 690 } else { | |
| 691 indicators[i].controlledBy = null; | |
| 692 } | |
| 693 } | |
| 694 } | |
| 695 | 677 |
| 696 // Don't show page name in address bar and in history to prevent people | 678 // Don't show page name in address bar and in history to prevent people |
| 697 // navigate here by hand and solve issue with page session restore. | 679 // navigate here by hand and solve issue with page session restore. |
| 698 OptionsPage.showPageByName('detailsInternetPage', false); | 680 OptionsPage.showPageByName('detailsInternetPage', false); |
| 699 }; | 681 }; |
| 700 | 682 |
| 701 InternetOptions.invalidNetworkSettings = function () { | 683 InternetOptions.invalidNetworkSettings = function () { |
| 702 alert(localStrings.getString('invalidNetworkSettings')); | 684 alert(localStrings.getString('invalidNetworkSettings')); |
| 703 }; | 685 }; |
| 704 | 686 |
| 705 // Export | 687 // Export |
| 706 return { | 688 return { |
| 707 InternetOptions: InternetOptions | 689 InternetOptions: InternetOptions |
| 708 }; | 690 }; |
| 709 }); | 691 }); |
| OLD | NEW |