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

Unified Diff: chrome/browser/resources/options/browser_options.js

Issue 834073002: ChromeOS: Implement periodic timezone refresh on geolocation data. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix rebase. Created 5 years, 11 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 2506341ae024f19556aedea1723f921342b0a5e9..b0ee23544eca53b636b701c916ef0e7bec7af366 100644
--- a/chrome/browser/resources/options/browser_options.js
+++ b/chrome/browser/resources/options/browser_options.js
@@ -386,8 +386,16 @@ cr.define('options', function() {
}
// Date and time section (CrOS only).
- if ($('set-time-button'))
- $('set-time-button').onclick = this.handleSetTime_.bind(this);
+ if (cr.isChromeOS) {
+ if ($('set-time-button'))
+ $('set-time-button').onclick = this.handleSetTime_.bind(this);
+
+ // Timezone
+ if (loadTimeData.getBoolean('enableTimeZoneTrackingOption')) {
+ $('resolve-timezone-by-geolocation-selection').hidden = false;
+ this.setSystemTimezoneManaged_(false);
+ }
+ }
// Default browser section.
if (!cr.isChromeOS) {
@@ -1614,6 +1622,29 @@ cr.define('options', function() {
},
/**
+ * This is called from chromium code when system timezone "managed" state
+ * is changed. Enables or disables dependent settings.
+ * @param {boolean} managed Is true when system Timezone is managed by
+ * enterprise policy. False otherwize.
+ */
+ setSystemTimezoneManaged_: function(managed) {
+ if (loadTimeData.getBoolean('enableTimeZoneTrackingOption')) {
+ if (managed) {
+ $('resolve-timezone-by-geolocation-selection').disabled = true;
+ $('resolve-timezone-by-geolocation').onclick = function(event) {};
+ } else {
+ this.enableElementIfPossible_(
+ getRequiredElement('resolve-timezone-by-geolocation-selection'));
+ $('resolve-timezone-by-geolocation').onclick = function(event) {
+ $('timezone-value-select').disabled = event.currentTarget.checked;
+ };
+ $('timezone-value-select').disabled =
+ $('resolve-timezone-by-geolocation').checked;
+ }
+ }
+ },
+
+ /**
* Handle the 'add device' button click.
* @private
*/
« no previous file with comments | « chrome/browser/resources/options/browser_options.html ('k') | chrome/browser/ui/webui/options/browser_options_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698