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', function() { | 5 cr.define('options', function() { |
6 var OptionsPage = options.OptionsPage; | 6 var OptionsPage = options.OptionsPage; |
7 var ArrayDataModel = cr.ui.ArrayDataModel; | 7 var ArrayDataModel = cr.ui.ArrayDataModel; |
8 var RepeatingButton = cr.ui.RepeatingButton; | 8 var RepeatingButton = cr.ui.RepeatingButton; |
9 var HotwordSearchSettingIndicator = options.HotwordSearchSettingIndicator; | 9 var HotwordSearchSettingIndicator = options.HotwordSearchSettingIndicator; |
10 | 10 |
(...skipping 552 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
563 true); | 563 true); |
564 this.addExtensionControlledBox_('extension-controlled-container', | 564 this.addExtensionControlledBox_('extension-controlled-container', |
565 'homepage-controlled', | 565 'homepage-controlled', |
566 true); | 566 true); |
567 this.addExtensionControlledBox_('startup-section-content', | 567 this.addExtensionControlledBox_('startup-section-content', |
568 'startpage-controlled', | 568 'startpage-controlled', |
569 false); | 569 false); |
570 this.addExtensionControlledBox_('newtab-section-content', | 570 this.addExtensionControlledBox_('newtab-section-content', |
571 'newtab-controlled', | 571 'newtab-controlled', |
572 false); | 572 false); |
| 573 this.addExtensionControlledBox_('proxy-section-content', |
| 574 'proxy-controlled', |
| 575 true); |
573 | 576 |
574 document.body.addEventListener('click', function(e) { | 577 document.body.addEventListener('click', function(e) { |
575 var button = findAncestor(e.target, function(el) { | 578 var button = findAncestor(e.target, function(el) { |
576 return el.tagName == 'BUTTON' && | 579 return el.tagName == 'BUTTON' && |
577 el.dataset.extensionId !== undefined && | 580 el.dataset.extensionId !== undefined && |
578 el.dataset.extensionId.length; | 581 el.dataset.extensionId.length; |
579 }); | 582 }); |
580 if (button) | 583 if (button) |
581 chrome.send('disableExtension', [button.dataset.extensionId]); | 584 chrome.send('disableExtension', [button.dataset.extensionId]); |
582 }); | 585 }); |
(...skipping 911 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1494 $('auto-open-file-types-container')); | 1497 $('auto-open-file-types-container')); |
1495 } else { | 1498 } else { |
1496 this.hideSectionWithAnimation_( | 1499 this.hideSectionWithAnimation_( |
1497 $('auto-open-file-types-section'), | 1500 $('auto-open-file-types-section'), |
1498 $('auto-open-file-types-container')); | 1501 $('auto-open-file-types-container')); |
1499 } | 1502 } |
1500 } | 1503 } |
1501 }, | 1504 }, |
1502 | 1505 |
1503 /** | 1506 /** |
1504 * Set the enabled state for the proxy settings button. | 1507 * Set the enabled state for the proxy settings button and its associated |
| 1508 * message when extension controlled. |
| 1509 * @param {boolean} disabled Whether the button should be disabled. |
| 1510 * @param {boolean} extensionControlled Whether the proxy is extension |
| 1511 * controlled. |
1505 * @private | 1512 * @private |
1506 */ | 1513 */ |
1507 setupProxySettingsSection_: function(disabled, extensionControlled) { | 1514 setupProxySettingsButton_: function(disabled, extensionControlled) { |
1508 if (!cr.isChromeOS) { | 1515 if (!cr.isChromeOS) { |
1509 $('proxiesConfigureButton').disabled = disabled; | 1516 $('proxiesConfigureButton').disabled = disabled; |
1510 $('proxiesLabel').textContent = | 1517 $('proxiesLabel').textContent = |
1511 loadTimeData.getString(extensionControlled ? | 1518 loadTimeData.getString(extensionControlled ? |
1512 'proxiesLabelExtension' : 'proxiesLabelSystem'); | 1519 'proxiesLabelExtension' : 'proxiesLabelSystem'); |
1513 } | 1520 } |
1514 }, | 1521 }, |
1515 | 1522 |
1516 /** | 1523 /** |
1517 * Set the initial state of the spoken feedback checkbox. | 1524 * Set the initial state of the spoken feedback checkbox. |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1612 details.homePage.id, | 1619 details.homePage.id, |
1613 details.homePage.name); | 1620 details.homePage.name); |
1614 this.toggleExtensionControlledBox_('startup-section-content', | 1621 this.toggleExtensionControlledBox_('startup-section-content', |
1615 'startpage-controlled', | 1622 'startpage-controlled', |
1616 details.startUpPage.id, | 1623 details.startUpPage.id, |
1617 details.startUpPage.name); | 1624 details.startUpPage.name); |
1618 this.toggleExtensionControlledBox_('newtab-section-content', | 1625 this.toggleExtensionControlledBox_('newtab-section-content', |
1619 'newtab-controlled', | 1626 'newtab-controlled', |
1620 details.newTabPage.id, | 1627 details.newTabPage.id, |
1621 details.newTabPage.name); | 1628 details.newTabPage.name); |
| 1629 this.toggleExtensionControlledBox_('proxy-section-content', |
| 1630 'proxy-controlled', |
| 1631 details.proxy.id, |
| 1632 details.proxy.name); |
| 1633 |
| 1634 // The proxy section contains just the warning box and nothing else, so |
| 1635 // if we're hiding the proxy warning box, we should also hide its header |
| 1636 // section. |
| 1637 $('proxy-section').hidden = details.proxy.id.length == 0; |
1622 }, | 1638 }, |
1623 | 1639 |
1624 | 1640 |
1625 /** | 1641 /** |
1626 * Show/hide touchpad-related settings. | 1642 * Show/hide touchpad-related settings. |
1627 * @private | 1643 * @private |
1628 */ | 1644 */ |
1629 showTouchpadControls_: function(show) { | 1645 showTouchpadControls_: function(show) { |
1630 $('touchpad-settings').hidden = !show; | 1646 $('touchpad-settings').hidden = !show; |
1631 $('accessibility-tap-dragging').hidden = !show; | 1647 $('accessibility-tap-dragging').hidden = !show; |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1780 'setFontSize', | 1796 'setFontSize', |
1781 'setNativeThemeButtonEnabled', | 1797 'setNativeThemeButtonEnabled', |
1782 'setHighContrastCheckboxState', | 1798 'setHighContrastCheckboxState', |
1783 'setMetricsReportingCheckboxState', | 1799 'setMetricsReportingCheckboxState', |
1784 'setMetricsReportingSettingVisibility', | 1800 'setMetricsReportingSettingVisibility', |
1785 'setProfilesInfo', | 1801 'setProfilesInfo', |
1786 'setSpokenFeedbackCheckboxState', | 1802 'setSpokenFeedbackCheckboxState', |
1787 'setThemesResetButtonEnabled', | 1803 'setThemesResetButtonEnabled', |
1788 'setVirtualKeyboardCheckboxState', | 1804 'setVirtualKeyboardCheckboxState', |
1789 'setupPageZoomSelector', | 1805 'setupPageZoomSelector', |
1790 'setupProxySettingsSection', | 1806 'setupProxySettingsButton', |
1791 'showBluetoothSettings', | 1807 'showBluetoothSettings', |
1792 'showCreateProfileError', | 1808 'showCreateProfileError', |
1793 'showCreateProfileSuccess', | 1809 'showCreateProfileSuccess', |
1794 'showCreateProfileWarning', | 1810 'showCreateProfileWarning', |
1795 'showHotwordSection', | 1811 'showHotwordSection', |
1796 'showManagedUserImportError', | 1812 'showManagedUserImportError', |
1797 'showManagedUserImportSuccess', | 1813 'showManagedUserImportSuccess', |
1798 'showMouseControls', | 1814 'showMouseControls', |
1799 'showTouchpadControls', | 1815 'showTouchpadControls', |
1800 'toggleExtensionIndicators', | 1816 'toggleExtensionIndicators', |
(...skipping 21 matching lines...) Expand all Loading... |
1822 BrowserOptions.getLoggedInUsername = function() { | 1838 BrowserOptions.getLoggedInUsername = function() { |
1823 return BrowserOptions.getInstance().username_; | 1839 return BrowserOptions.getInstance().username_; |
1824 }; | 1840 }; |
1825 } | 1841 } |
1826 | 1842 |
1827 // Export | 1843 // Export |
1828 return { | 1844 return { |
1829 BrowserOptions: BrowserOptions | 1845 BrowserOptions: BrowserOptions |
1830 }; | 1846 }; |
1831 }); | 1847 }); |
OLD | NEW |