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 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
288 chrome.send('coreOptionsUserMetricsAction', ['Import_ShowDlg']); | 288 chrome.send('coreOptionsUserMetricsAction', ['Import_ShowDlg']); |
289 }; | 289 }; |
290 | 290 |
291 if ($('themes-native-button')) { | 291 if ($('themes-native-button')) { |
292 $('themes-native-button').onclick = function(event) { | 292 $('themes-native-button').onclick = function(event) { |
293 chrome.send('themesSetNative'); | 293 chrome.send('themesSetNative'); |
294 }; | 294 }; |
295 } | 295 } |
296 } | 296 } |
297 | 297 |
298 // Date and time section (CrOS only). | |
299 if ($('set-time-button')) | |
300 $('set-time-button').onclick = this.handleSetTime_.bind(this); | |
301 | |
298 // Default browser section. | 302 // Default browser section. |
299 if (!cr.isChromeOS) { | 303 if (!cr.isChromeOS) { |
300 if (!loadTimeData.getBoolean('showSetDefault')) { | 304 if (!loadTimeData.getBoolean('showSetDefault')) { |
301 $('set-default-browser-section').hidden = true; | 305 $('set-default-browser-section').hidden = true; |
302 } | 306 } |
303 $('set-as-default-browser').onclick = function(event) { | 307 $('set-as-default-browser').onclick = function(event) { |
304 chrome.send('becomeDefaultBrowser'); | 308 chrome.send('becomeDefaultBrowser'); |
305 }; | 309 }; |
306 | 310 |
307 $('auto-launch').onclick = this.handleAutoLaunchChanged_; | 311 $('auto-launch').onclick = this.handleAutoLaunchChanged_; |
(...skipping 1412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1720 /** | 1724 /** |
1721 * Shows (or not) the "User" section of the settings page based on whether | 1725 * Shows (or not) the "User" section of the settings page based on whether |
1722 * any of the sub-sections are present (or not). | 1726 * any of the sub-sections are present (or not). |
1723 * @private | 1727 * @private |
1724 */ | 1728 */ |
1725 maybeShowUserSection_: function() { | 1729 maybeShowUserSection_: function() { |
1726 $('sync-users-section').hidden = | 1730 $('sync-users-section').hidden = |
1727 $('profiles-section').hidden && | 1731 $('profiles-section').hidden && |
1728 $('sync-section').hidden && | 1732 $('sync-section').hidden && |
1729 $('profiles-supervised-dashboard-tip').hidden; | 1733 $('profiles-supervised-dashboard-tip').hidden; |
1730 } | 1734 }, |
1735 | |
1736 /** | |
1737 * Updates the date and time section with time sync information. | |
1738 * @param {boolean} canSetTime Whether the system time can be set. | |
1739 * @private | |
1740 */ | |
1741 setCanSetTime_: function(canSetTime) { | |
1742 // If the time has been network-synced, it cannot be set manually. | |
1743 $('time-synced-explanation').hidden = canSetTime; | |
1744 $('set-time').hidden = !canSetTime; | |
1745 }, | |
1746 | |
1747 /** | |
1748 * Handle the 'set date and time' button click. | |
1749 * @private | |
1750 */ | |
1751 handleSetTime_: function() { | |
1752 chrome.send('showSetTime'); | |
1753 }, | |
1754 | |
Dan Beam
2014/04/25 22:02:43
nit: remove \n
michaelpg
2014/04/25 23:50:29
Done.
| |
1731 }; | 1755 }; |
1732 | 1756 |
1733 //Forward public APIs to private implementations. | 1757 //Forward public APIs to private implementations. |
1734 [ | 1758 [ |
1735 'addBluetoothDevice', | 1759 'addBluetoothDevice', |
1736 'enableCertificateButton', | 1760 'enableCertificateButton', |
1737 'enableFactoryResetSection', | 1761 'enableFactoryResetSection', |
1738 'getCurrentProfile', | 1762 'getCurrentProfile', |
1739 'getStartStopSyncButton', | 1763 'getStartStopSyncButton', |
1740 'hideBluetoothSettings', | 1764 'hideBluetoothSettings', |
1741 'notifyInitializationComplete', | 1765 'notifyInitializationComplete', |
1742 'removeBluetoothDevice', | 1766 'removeBluetoothDevice', |
1743 'scrollToSection', | 1767 'scrollToSection', |
1744 'setAccountPictureManaged', | 1768 'setAccountPictureManaged', |
1745 'setWallpaperManaged', | 1769 'setWallpaperManaged', |
1746 'setAutoOpenFileTypesDisplayed', | 1770 'setAutoOpenFileTypesDisplayed', |
1747 'setBluetoothState', | 1771 'setBluetoothState', |
1772 'setCanSetTime', | |
1748 'setFontSize', | 1773 'setFontSize', |
1749 'setNativeThemeButtonEnabled', | 1774 'setNativeThemeButtonEnabled', |
1750 'setHighContrastCheckboxState', | 1775 'setHighContrastCheckboxState', |
1751 'setMetricsReportingCheckboxState', | 1776 'setMetricsReportingCheckboxState', |
1752 'setMetricsReportingSettingVisibility', | 1777 'setMetricsReportingSettingVisibility', |
1753 'setProfilesInfo', | 1778 'setProfilesInfo', |
1754 'setSpokenFeedbackCheckboxState', | 1779 'setSpokenFeedbackCheckboxState', |
1755 'setThemesResetButtonEnabled', | 1780 'setThemesResetButtonEnabled', |
1756 'setVirtualKeyboardCheckboxState', | 1781 'setVirtualKeyboardCheckboxState', |
1757 'setupPageZoomSelector', | 1782 'setupPageZoomSelector', |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1792 BrowserOptions.getLoggedInUsername = function() { | 1817 BrowserOptions.getLoggedInUsername = function() { |
1793 return BrowserOptions.getInstance().username_; | 1818 return BrowserOptions.getInstance().username_; |
1794 }; | 1819 }; |
1795 } | 1820 } |
1796 | 1821 |
1797 // Export | 1822 // Export |
1798 return { | 1823 return { |
1799 BrowserOptions: BrowserOptions | 1824 BrowserOptions: BrowserOptions |
1800 }; | 1825 }; |
1801 }); | 1826 }); |
OLD | NEW |