| 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 555 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 566 true); | 566 true); |
| 567 this.addExtensionControlledBox_('extension-controlled-container', | 567 this.addExtensionControlledBox_('extension-controlled-container', |
| 568 'homepage-controlled', | 568 'homepage-controlled', |
| 569 true); | 569 true); |
| 570 this.addExtensionControlledBox_('startup-section-content', | 570 this.addExtensionControlledBox_('startup-section-content', |
| 571 'startpage-controlled', | 571 'startpage-controlled', |
| 572 false); | 572 false); |
| 573 this.addExtensionControlledBox_('newtab-section-content', | 573 this.addExtensionControlledBox_('newtab-section-content', |
| 574 'newtab-controlled', | 574 'newtab-controlled', |
| 575 false); | 575 false); |
| 576 this.addExtensionControlledBox_('proxy-section-content', |
| 577 'proxy-controlled', |
| 578 true); |
| 576 | 579 |
| 577 document.body.addEventListener('click', function(e) { | 580 document.body.addEventListener('click', function(e) { |
| 578 var button = findAncestor(e.target, function(el) { | 581 var button = findAncestor(e.target, function(el) { |
| 579 return el.tagName == 'BUTTON' && | 582 return el.tagName == 'BUTTON' && |
| 580 el.dataset.extensionId !== undefined && | 583 el.dataset.extensionId !== undefined && |
| 581 el.dataset.extensionId.length; | 584 el.dataset.extensionId.length; |
| 582 }); | 585 }); |
| 583 if (button) | 586 if (button) |
| 584 chrome.send('disableExtension', [button.dataset.extensionId]); | 587 chrome.send('disableExtension', [button.dataset.extensionId]); |
| 585 }); | 588 }); |
| (...skipping 915 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1501 $('auto-open-file-types-container')); | 1504 $('auto-open-file-types-container')); |
| 1502 } else { | 1505 } else { |
| 1503 this.hideSectionWithAnimation_( | 1506 this.hideSectionWithAnimation_( |
| 1504 $('auto-open-file-types-section'), | 1507 $('auto-open-file-types-section'), |
| 1505 $('auto-open-file-types-container')); | 1508 $('auto-open-file-types-container')); |
| 1506 } | 1509 } |
| 1507 } | 1510 } |
| 1508 }, | 1511 }, |
| 1509 | 1512 |
| 1510 /** | 1513 /** |
| 1511 * Set the enabled state for the proxy settings button. | 1514 * Set the enabled state for the proxy settings button and its associated |
| 1515 * message when extension controlled. |
| 1516 * @param {boolean} disabled Whether the button should be disabled. |
| 1517 * @param {boolean} extensionControlled Whether the proxy is extension |
| 1518 * controlled. |
| 1512 * @private | 1519 * @private |
| 1513 */ | 1520 */ |
| 1514 setupProxySettingsSection_: function(disabled, extensionControlled) { | 1521 setupProxySettingsButton_: function(disabled, extensionControlled) { |
| 1515 if (!cr.isChromeOS) { | 1522 if (!cr.isChromeOS) { |
| 1516 $('proxiesConfigureButton').disabled = disabled; | 1523 $('proxiesConfigureButton').disabled = disabled; |
| 1517 $('proxiesLabel').textContent = | 1524 $('proxiesLabel').textContent = |
| 1518 loadTimeData.getString(extensionControlled ? | 1525 loadTimeData.getString(extensionControlled ? |
| 1519 'proxiesLabelExtension' : 'proxiesLabelSystem'); | 1526 'proxiesLabelExtension' : 'proxiesLabelSystem'); |
| 1520 } | 1527 } |
| 1521 }, | 1528 }, |
| 1522 | 1529 |
| 1523 /** | 1530 /** |
| 1524 * Set the initial state of the spoken feedback checkbox. | 1531 * Set the initial state of the spoken feedback checkbox. |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1619 details.homePage.id, | 1626 details.homePage.id, |
| 1620 details.homePage.name); | 1627 details.homePage.name); |
| 1621 this.toggleExtensionControlledBox_('startup-section-content', | 1628 this.toggleExtensionControlledBox_('startup-section-content', |
| 1622 'startpage-controlled', | 1629 'startpage-controlled', |
| 1623 details.startUpPage.id, | 1630 details.startUpPage.id, |
| 1624 details.startUpPage.name); | 1631 details.startUpPage.name); |
| 1625 this.toggleExtensionControlledBox_('newtab-section-content', | 1632 this.toggleExtensionControlledBox_('newtab-section-content', |
| 1626 'newtab-controlled', | 1633 'newtab-controlled', |
| 1627 details.newTabPage.id, | 1634 details.newTabPage.id, |
| 1628 details.newTabPage.name); | 1635 details.newTabPage.name); |
| 1636 this.toggleExtensionControlledBox_('proxy-section-content', |
| 1637 'proxy-controlled', |
| 1638 details.proxy.id, |
| 1639 details.proxy.name); |
| 1640 |
| 1641 // The proxy section contains just the warning box and nothing else, so |
| 1642 // if we're hiding the proxy warning box, we should also hide its header |
| 1643 // section. |
| 1644 $('proxy-section').hidden = details.proxy.id.length == 0; |
| 1629 }, | 1645 }, |
| 1630 | 1646 |
| 1631 | 1647 |
| 1632 /** | 1648 /** |
| 1633 * Show/hide touchpad-related settings. | 1649 * Show/hide touchpad-related settings. |
| 1634 * @private | 1650 * @private |
| 1635 */ | 1651 */ |
| 1636 showTouchpadControls_: function(show) { | 1652 showTouchpadControls_: function(show) { |
| 1637 $('touchpad-settings').hidden = !show; | 1653 $('touchpad-settings').hidden = !show; |
| 1638 $('accessibility-tap-dragging').hidden = !show; | 1654 $('accessibility-tap-dragging').hidden = !show; |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1787 'setFontSize', | 1803 'setFontSize', |
| 1788 'setNativeThemeButtonEnabled', | 1804 'setNativeThemeButtonEnabled', |
| 1789 'setHighContrastCheckboxState', | 1805 'setHighContrastCheckboxState', |
| 1790 'setMetricsReportingCheckboxState', | 1806 'setMetricsReportingCheckboxState', |
| 1791 'setMetricsReportingSettingVisibility', | 1807 'setMetricsReportingSettingVisibility', |
| 1792 'setProfilesInfo', | 1808 'setProfilesInfo', |
| 1793 'setSpokenFeedbackCheckboxState', | 1809 'setSpokenFeedbackCheckboxState', |
| 1794 'setThemesResetButtonEnabled', | 1810 'setThemesResetButtonEnabled', |
| 1795 'setVirtualKeyboardCheckboxState', | 1811 'setVirtualKeyboardCheckboxState', |
| 1796 'setupPageZoomSelector', | 1812 'setupPageZoomSelector', |
| 1797 'setupProxySettingsSection', | 1813 'setupProxySettingsButton', |
| 1798 'showBluetoothSettings', | 1814 'showBluetoothSettings', |
| 1799 'showCreateProfileError', | 1815 'showCreateProfileError', |
| 1800 'showCreateProfileSuccess', | 1816 'showCreateProfileSuccess', |
| 1801 'showCreateProfileWarning', | 1817 'showCreateProfileWarning', |
| 1802 'showHotwordSection', | 1818 'showHotwordSection', |
| 1803 'showManagedUserImportError', | 1819 'showManagedUserImportError', |
| 1804 'showManagedUserImportSuccess', | 1820 'showManagedUserImportSuccess', |
| 1805 'showMouseControls', | 1821 'showMouseControls', |
| 1806 'showTouchpadControls', | 1822 'showTouchpadControls', |
| 1807 'toggleExtensionIndicators', | 1823 'toggleExtensionIndicators', |
| (...skipping 21 matching lines...) Expand all Loading... |
| 1829 BrowserOptions.getLoggedInUsername = function() { | 1845 BrowserOptions.getLoggedInUsername = function() { |
| 1830 return BrowserOptions.getInstance().username_; | 1846 return BrowserOptions.getInstance().username_; |
| 1831 }; | 1847 }; |
| 1832 } | 1848 } |
| 1833 | 1849 |
| 1834 // Export | 1850 // Export |
| 1835 return { | 1851 return { |
| 1836 BrowserOptions: BrowserOptions | 1852 BrowserOptions: BrowserOptions |
| 1837 }; | 1853 }; |
| 1838 }); | 1854 }); |
| OLD | NEW |