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

Unified 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 side-by-side diff with in-line comments
Download patch
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..fd092f8f4b6ba859273c2a77e05cf4ae9923f13a 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 (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
+ $('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) {
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.
+ // 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');
}
Dan Beam 2014/04/24 21:54:33 nit: },
michaelpg 2014/04/24 22:42:48 Done.
+
};
//Forward public APIs to private implementations.
@@ -1765,6 +1789,7 @@ cr.define('options', function() {
'showManagedUserImportSuccess',
'showMouseControls',
'showTouchpadControls',
+ 'toggleCanSetTime',
'toggleHomepageControlled',
'toggleSearchEngineControlled',
'toggleStartupPagesControlled',

Powered by Google App Engine
This is Rietveld 408576698