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 (cr.isChromeOS) { | |
Dan Beam
2014/04/23 17:51:45
nit:
if ($('set-time-button'))
just like theme
michaelpg
2014/04/24 01:32:23
get rid of the isChromeOS check? or just add this
Dan Beam
2014/04/24 21:32:23
get right of the isChromeOS check, full code would
michaelpg
2014/04/24 22:42:47
OK, we'll do it that way (the HTML already is wrap
| |
300 $('set-time-button').onclick = this.handleSetTime_.bind(this); | |
301 } | |
Dan Beam
2014/04/23 17:51:45
nit: no curlies
michaelpg
2014/04/24 01:32:23
based on this comment I guess you mean "get rid of
Dan Beam
2014/04/24 21:32:23
right
michaelpg
2014/04/24 22:42:47
Done.
| |
302 | |
298 // Default browser section. | 303 // Default browser section. |
299 if (!cr.isChromeOS) { | 304 if (!cr.isChromeOS) { |
300 if (!loadTimeData.getBoolean('showSetDefault')) { | 305 if (!loadTimeData.getBoolean('showSetDefault')) { |
301 $('set-default-browser-section').hidden = true; | 306 $('set-default-browser-section').hidden = true; |
302 } | 307 } |
303 $('set-as-default-browser').onclick = function(event) { | 308 $('set-as-default-browser').onclick = function(event) { |
304 chrome.send('becomeDefaultBrowser'); | 309 chrome.send('becomeDefaultBrowser'); |
305 }; | 310 }; |
306 | 311 |
307 $('auto-launch').onclick = this.handleAutoLaunchChanged_; | 312 $('auto-launch').onclick = this.handleAutoLaunchChanged_; |
(...skipping 1412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1720 /** | 1725 /** |
1721 * Shows (or not) the "User" section of the settings page based on whether | 1726 * Shows (or not) the "User" section of the settings page based on whether |
1722 * any of the sub-sections are present (or not). | 1727 * any of the sub-sections are present (or not). |
1723 * @private | 1728 * @private |
1724 */ | 1729 */ |
1725 maybeShowUserSection_: function() { | 1730 maybeShowUserSection_: function() { |
1726 $('sync-users-section').hidden = | 1731 $('sync-users-section').hidden = |
1727 $('profiles-section').hidden && | 1732 $('profiles-section').hidden && |
1728 $('sync-section').hidden && | 1733 $('sync-section').hidden && |
1729 $('profiles-supervised-dashboard-tip').hidden; | 1734 $('profiles-supervised-dashboard-tip').hidden; |
1735 }, | |
1736 | |
1737 /** | |
1738 * Updates the date and time section with time sync information. | |
1739 * @param {bool} canSetTime Whether the system time can be set. | |
Dan Beam
2014/04/23 17:51:45
{boolean}
michaelpg
2014/04/24 01:32:23
Done.
| |
1740 * @private | |
1741 */ | |
1742 canSetTimeChanged_: function(canSetTime) { | |
Dan Beam
2014/04/23 17:51:45
nit: can* methods sound like they'll return a bool
michaelpg
2014/04/24 01:32:23
How about toggleCanSetTime?
Dan Beam
2014/04/24 21:32:23
I think it's better to set it explicitly one way o
michaelpg
2014/04/24 22:42:47
Done.
| |
1743 // If the time cannot be set, it has been network-synced. | |
1744 $('time-synced-explanation').hidden = canSetTime; | |
1745 $('set-time').hidden = !canSetTime; | |
1746 }, | |
1747 | |
1748 /** | |
1749 * Handle the 'set date and time' button click. | |
1750 * @private | |
1751 */ | |
1752 handleSetTime_: function() { | |
1753 chrome.send('showSetTime'); | |
1730 } | 1754 } |
1755 | |
1731 }; | 1756 }; |
1732 | 1757 |
1733 //Forward public APIs to private implementations. | 1758 //Forward public APIs to private implementations. |
1734 [ | 1759 [ |
1735 'addBluetoothDevice', | 1760 'addBluetoothDevice', |
1761 'canSetTimeChanged', | |
1736 'enableCertificateButton', | 1762 'enableCertificateButton', |
1737 'enableFactoryResetSection', | 1763 'enableFactoryResetSection', |
1738 'getCurrentProfile', | 1764 'getCurrentProfile', |
1739 'getStartStopSyncButton', | 1765 'getStartStopSyncButton', |
1740 'hideBluetoothSettings', | 1766 'hideBluetoothSettings', |
1741 'notifyInitializationComplete', | 1767 'notifyInitializationComplete', |
1742 'removeBluetoothDevice', | 1768 'removeBluetoothDevice', |
1743 'scrollToSection', | 1769 'scrollToSection', |
1744 'setAccountPictureManaged', | 1770 'setAccountPictureManaged', |
1745 'setWallpaperManaged', | 1771 'setWallpaperManaged', |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1792 BrowserOptions.getLoggedInUsername = function() { | 1818 BrowserOptions.getLoggedInUsername = function() { |
1793 return BrowserOptions.getInstance().username_; | 1819 return BrowserOptions.getInstance().username_; |
1794 }; | 1820 }; |
1795 } | 1821 } |
1796 | 1822 |
1797 // Export | 1823 // Export |
1798 return { | 1824 return { |
1799 BrowserOptions: BrowserOptions | 1825 BrowserOptions: BrowserOptions |
1800 }; | 1826 }; |
1801 }); | 1827 }); |
OLD | NEW |