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