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

Unified Diff: chrome/browser/ui/webui/options/browser_options_handler.cc

Issue 834073002: ChromeOS: Implement periodic timezone refresh on geolocation data. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update after review. 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/ui/webui/options/browser_options_handler.cc
diff --git a/chrome/browser/ui/webui/options/browser_options_handler.cc b/chrome/browser/ui/webui/options/browser_options_handler.cc
index d230ca7c1ebe03bb3db3c3a49e5d52ee07b86f6b..06349797d8ad01d0a0fbd08a5c42837b9a5100e0 100644
--- a/chrome/browser/ui/webui/options/browser_options_handler.cc
+++ b/chrome/browser/ui/webui/options/browser_options_handler.cc
@@ -505,6 +505,10 @@ void BrowserOptionsHandler::GetLocalizedValues(base::DictionaryValue* values) {
{ "cloudPrintEnableNotificationsLabel",
IDS_LOCAL_DISCOVERY_NOTIFICATIONS_ENABLE_CHECKBOX_LABEL },
#endif
+#if defined(OS_CHROMEOS)
+ { "resolveTimezoneByGeoLocation",
+ IDS_OPTIONS_RESOLVE_TIMEZONE_BY_GEOLOCATION_DESCRIPTION },
+#endif
};
#if defined(ENABLE_SETTINGS_APP)
@@ -672,6 +676,12 @@ void BrowserOptionsHandler::GetLocalizedValues(base::DictionaryValue* values) {
"showWakeOnWifi",
chromeos::WakeOnWifiManager::Get()->WakeOnWifiSupported() &&
chromeos::switches::WakeOnWifiEnabled());
+ const bool have_enable_time_zone_tracking_option_switch =
+ base::CommandLine::ForCurrentProcess()->HasSwitch(
+ chromeos::switches::kEnableTimeZoneTrackingOption);
+ values->SetBoolean("enableTimeZoneTrackingOption",
+ have_enable_time_zone_tracking_option_switch &&
+ !chromeos::system::HasSystemTimezonePolicy());
#endif
}
@@ -957,6 +967,10 @@ void BrowserOptionsHandler::InitializeHandler() {
base::Bind(&BrowserOptionsHandler::OnWallpaperPolicyChanged,
base::Unretained(this)));
}
+ chromeos::CrosSettings::Get()->AddSettingsObserver(
+ chromeos::kSystemTimezonePolicy,
+ base::Bind(&BrowserOptionsHandler::OnSystemTimezonePolicyChanged,
+ weak_ptr_factory_.GetWeakPtr()));
#else // !defined(OS_CHROMEOS)
profile_pref_registrar_.Add(
prefs::kProxy,
@@ -1416,6 +1430,12 @@ void BrowserOptionsHandler::OnWallpaperManagedChanged(bool managed) {
web_ui()->CallJavascriptFunction("BrowserOptions.setWallpaperManaged",
base::FundamentalValue(managed));
}
+
+void BrowserOptionsHandler::OnSystemTimezonePolicyChanged() {
+ web_ui()->CallJavascriptFunction(
+ "BrowserOptions.setSystemTimezoneManaged",
+ base::FundamentalValue(chromeos::system::HasSystemTimezonePolicy()));
+}
#endif
scoped_ptr<base::DictionaryValue>

Powered by Google App Engine
This is Rietveld 408576698