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 }, |
1731 }; | 1754 }; |
1732 | 1755 |
1733 //Forward public APIs to private implementations. | 1756 //Forward public APIs to private implementations. |
1734 [ | 1757 [ |
1735 'addBluetoothDevice', | 1758 'addBluetoothDevice', |
1736 'enableCertificateButton', | 1759 'enableCertificateButton', |
1737 'enableFactoryResetSection', | 1760 'enableFactoryResetSection', |
1738 'getCurrentProfile', | 1761 'getCurrentProfile', |
1739 'getStartStopSyncButton', | 1762 'getStartStopSyncButton', |
1740 'hideBluetoothSettings', | 1763 'hideBluetoothSettings', |
1741 'notifyInitializationComplete', | 1764 'notifyInitializationComplete', |
1742 'removeBluetoothDevice', | 1765 'removeBluetoothDevice', |
1743 'scrollToSection', | 1766 'scrollToSection', |
1744 'setAccountPictureManaged', | 1767 'setAccountPictureManaged', |
1745 'setWallpaperManaged', | 1768 'setWallpaperManaged', |
1746 'setAutoOpenFileTypesDisplayed', | 1769 'setAutoOpenFileTypesDisplayed', |
1747 'setBluetoothState', | 1770 'setBluetoothState', |
| 1771 'setCanSetTime', |
1748 'setFontSize', | 1772 'setFontSize', |
1749 'setNativeThemeButtonEnabled', | 1773 'setNativeThemeButtonEnabled', |
1750 'setHighContrastCheckboxState', | 1774 'setHighContrastCheckboxState', |
1751 'setMetricsReportingCheckboxState', | 1775 'setMetricsReportingCheckboxState', |
1752 'setMetricsReportingSettingVisibility', | 1776 'setMetricsReportingSettingVisibility', |
1753 'setProfilesInfo', | 1777 'setProfilesInfo', |
1754 'setSpokenFeedbackCheckboxState', | 1778 'setSpokenFeedbackCheckboxState', |
1755 'setThemesResetButtonEnabled', | 1779 'setThemesResetButtonEnabled', |
1756 'setVirtualKeyboardCheckboxState', | 1780 'setVirtualKeyboardCheckboxState', |
1757 'setupPageZoomSelector', | 1781 'setupPageZoomSelector', |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1792 BrowserOptions.getLoggedInUsername = function() { | 1816 BrowserOptions.getLoggedInUsername = function() { |
1793 return BrowserOptions.getInstance().username_; | 1817 return BrowserOptions.getInstance().username_; |
1794 }; | 1818 }; |
1795 } | 1819 } |
1796 | 1820 |
1797 // Export | 1821 // Export |
1798 return { | 1822 return { |
1799 BrowserOptions: BrowserOptions | 1823 BrowserOptions: BrowserOptions |
1800 }; | 1824 }; |
1801 }); | 1825 }); |
OLD | NEW |