Chromium Code Reviews| Index: chrome/browser/resources/options/browser_options.js |
| diff --git a/chrome/browser/resources/options/browser_options.js b/chrome/browser/resources/options/browser_options.js |
| index c057e664676b66ad2ec28ab6b45d3225f547c714..84db162d412136604bcc5c794c7b49f7b9e6fb96 100644 |
| --- a/chrome/browser/resources/options/browser_options.js |
| +++ b/chrome/browser/resources/options/browser_options.js |
| @@ -295,6 +295,10 @@ cr.define('options', function() { |
| } |
| } |
| + // Date and time section (CrOS only). |
| + if ($('set-time-button')) |
|
Nikita (slow)
2014/04/24 14:31:53
nit: Hide behind if (cr.isChromeOS) ?
michaelpg
2014/04/24 18:52:32
That's what I had originally, I think dbeam was su
Dan Beam
2014/04/24 21:32:23
that makes little sense to me
Nikita (slow)
2014/04/25 17:06:18
Ok, since button is already wrapped in chromeos if
|
| + $('set-time-button').onclick = this.handleSetTime_.bind(this); |
| + |
| // Default browser section. |
| if (!cr.isChromeOS) { |
| if (!loadTimeData.getBoolean('showSetDefault')) { |
| @@ -1727,7 +1731,27 @@ cr.define('options', function() { |
| $('profiles-section').hidden && |
| $('sync-section').hidden && |
| $('profiles-supervised-dashboard-tip').hidden; |
| + }, |
| + |
| + /** |
| + * Updates the date and time section with time sync information. |
| + * @param {boolean} canSetTime Whether the system time can be set. |
| + * @private |
| + */ |
| + toggleCanSetTime_: function(canSetTime) { |
| + // If the time has been network-synced, it cannot be set manually. |
| + $('time-synced-explanation').hidden = canSetTime; |
| + $('set-time').hidden = !canSetTime; |
| + }, |
| + |
| + /** |
| + * Handle the 'set date and time' button click. |
| + * @private |
| + */ |
| + handleSetTime_: function() { |
| + chrome.send('showSetTime'); |
| } |
| + |
| }; |
| //Forward public APIs to private implementations. |
| @@ -1765,6 +1789,7 @@ cr.define('options', function() { |
| 'showManagedUserImportSuccess', |
| 'showMouseControls', |
| 'showTouchpadControls', |
| + 'toggleCanSetTime', |
| 'toggleHomepageControlled', |
| 'toggleSearchEngineControlled', |
| 'toggleStartupPagesControlled', |