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..d0b691b9d03f1223321b208854247f9ac057dcb9 100644 |
--- a/chrome/browser/resources/options/browser_options.js |
+++ b/chrome/browser/resources/options/browser_options.js |
@@ -295,6 +295,11 @@ cr.define('options', function() { |
} |
} |
+ // Date and time section (CrOS only). |
+ 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
|
+ $('set-time-button').onclick = this.handleSetTime_.bind(this); |
+ } |
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.
|
+ |
// Default browser section. |
if (!cr.isChromeOS) { |
if (!loadTimeData.getBoolean('showSetDefault')) { |
@@ -1727,12 +1732,33 @@ 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 {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.
|
+ * @private |
+ */ |
+ 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.
|
+ // If the time cannot be set, it has been network-synced. |
+ $('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. |
[ |
'addBluetoothDevice', |
+ 'canSetTimeChanged', |
'enableCertificateButton', |
'enableFactoryResetSection', |
'getCurrentProfile', |