Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(746)

Side by Side Diff: chrome/browser/resources/options/browser_options.js

Issue 247663003: Date and Time dialog for when the clock isn't synced. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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 && $('set-time-button'))
Dan Beam 2014/04/24 21:54:33 i still think this makes more sense to be based on
michaelpg 2014/04/24 22:42:48 Yep. The HTML is already ifdef'd out, so there's n
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
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;
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 toggleCanSetTime_: function(canSetTime) {
Dan Beam 2014/04/24 21:54:33 if this were a toggle function, it'd look somethin
michaelpg 2014/04/24 22:42:48 Done.
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');
1730 } 1753 }
Dan Beam 2014/04/24 21:54:33 nit: },
michaelpg 2014/04/24 22:42:48 Done.
1754
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',
(...skipping 17 matching lines...) Expand all
1758 'setupProxySettingsSection', 1782 'setupProxySettingsSection',
1759 'showBluetoothSettings', 1783 'showBluetoothSettings',
1760 'showCreateProfileError', 1784 'showCreateProfileError',
1761 'showCreateProfileSuccess', 1785 'showCreateProfileSuccess',
1762 'showCreateProfileWarning', 1786 'showCreateProfileWarning',
1763 'showHotwordSection', 1787 'showHotwordSection',
1764 'showManagedUserImportError', 1788 'showManagedUserImportError',
1765 'showManagedUserImportSuccess', 1789 'showManagedUserImportSuccess',
1766 'showMouseControls', 1790 'showMouseControls',
1767 'showTouchpadControls', 1791 'showTouchpadControls',
1792 'toggleCanSetTime',
1768 'toggleHomepageControlled', 1793 'toggleHomepageControlled',
1769 'toggleSearchEngineControlled', 1794 'toggleSearchEngineControlled',
1770 'toggleStartupPagesControlled', 1795 'toggleStartupPagesControlled',
1771 'updateAccountPicture', 1796 'updateAccountPicture',
1772 'updateAutoLaunchState', 1797 'updateAutoLaunchState',
1773 'updateDefaultBrowserState', 1798 'updateDefaultBrowserState',
1774 'updateEasyUnlock', 1799 'updateEasyUnlock',
1775 'updateManagesSupervisedUsers', 1800 'updateManagesSupervisedUsers',
1776 'updateSearchEngines', 1801 'updateSearchEngines',
1777 'updateStartupPages', 1802 'updateStartupPages',
(...skipping 14 matching lines...) Expand all
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 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698