Index: chrome/browser/resources/settings/date_time_page/date_time_page.js |
diff --git a/chrome/browser/resources/settings/date_time_page/date_time_page.js b/chrome/browser/resources/settings/date_time_page/date_time_page.js |
index 3b004f22eabfd72b0a33f42437fe37b9ca52e093..032db244871b5eddfede191133f2f89bf55590f9 100644 |
--- a/chrome/browser/resources/settings/date_time_page/date_time_page.js |
+++ b/chrome/browser/resources/settings/date_time_page/date_time_page.js |
@@ -42,16 +42,6 @@ Polymer({ |
}, |
/** |
- * Whether a policy controls the time zone auto-detect setting. |
- * @private |
- */ |
- hasTimeZoneAutoDetectPolicy_: { |
- type: Boolean, |
- computed: |
- 'computeHasTimeZoneAutoDetectPolicy_(timeZoneAutoDetectPolicy_)', |
- }, |
- |
- /** |
* The effective time zone auto-detect setting. |
* @private |
*/ |
@@ -91,7 +81,7 @@ Polymer({ |
observers: [ |
'maybeGetTimeZoneList_(' + |
- 'prefs.cros.system.timezone.value, timeZoneAutoDetect_)', |
+ 'prefs.settings.timezone.value, timeZoneAutoDetect_)', |
], |
/** @override */ |
@@ -146,15 +136,6 @@ Polymer({ |
/** |
* @param {settings.TimeZoneAutoDetectPolicy} timeZoneAutoDetectPolicy |
- * @return {boolean} |
- * @private |
- */ |
- computeHasTimeZoneAutoDetectPolicy_: function(timeZoneAutoDetectPolicy) { |
- return timeZoneAutoDetectPolicy != settings.TimeZoneAutoDetectPolicy.NONE; |
- }, |
- |
- /** |
- * @param {settings.TimeZoneAutoDetectPolicy} timeZoneAutoDetectPolicy |
* @param {boolean} prefValue Value of the geolocation pref. |
* @return {boolean} Whether time zone auto-detect is enabled. |
* @private |
@@ -183,7 +164,7 @@ Polymer({ |
// If auto-detect is enabled, we only need the current time zone. |
if (this.timeZoneAutoDetect_ && |
- this.getPref('cros.system.timezone').value == |
+ this.getPref('settings.timezone').value == |
this.timeZoneList_[0].value) { |
return; |
} |
@@ -204,4 +185,17 @@ Polymer({ |
}; |
}); |
}, |
+ |
+ |
+ /** |
+ * Computes visibility of user timezone preference. |
+ * @param prefUserTimezone Object pref.settings.timezone |
+ * @param prefResolveValue Boolean |
+ * prefs.settings.resolve_timezone_by_geolocation.value |
+ * @private |
+ */ |
+ isUserTimeZoneSelectorHidden_: function(prefUserTimezone, prefResolveValue) { |
+ return (prefUserTimezone && prefUserTimezone.controlledBy != null) || |
+ (prefResolveValue == true); |
+ }, |
}); |