Index: chrome/browser/chromeos/preferences.cc |
diff --git a/chrome/browser/chromeos/preferences.cc b/chrome/browser/chromeos/preferences.cc |
index c52e7baaadb93f8aabffa809bb27fb010f040401..9c19ad4f002fd50bf0792df907b1a9865b7ef4e4 100644 |
--- a/chrome/browser/chromeos/preferences.cc |
+++ b/chrome/browser/chromeos/preferences.cc |
@@ -87,6 +87,8 @@ void Preferences::RegisterPrefs(PrefRegistrySimple* registry) { |
registry->RegisterBooleanPref(prefs::kAccessibilityVirtualKeyboardEnabled, |
false); |
registry->RegisterStringPref(prefs::kLogoutStartedLast, std::string()); |
+ registry->RegisterBooleanPref(prefs::kResolveDeviceTimezoneByGeolocation, |
+ true); |
} |
// static |
@@ -315,6 +317,10 @@ void Preferences::RegisterProfilePrefs( |
false, |
user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
+ registry->RegisterBooleanPref( |
+ prefs::kResolveTimezoneByGeolocation, true, |
+ user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
+ |
input_method::InputMethodSyncer::RegisterProfilePrefs(registry); |
} |
@@ -355,6 +361,9 @@ void Preferences::InitUserPrefs(PrefServiceSyncable* prefs) { |
prefs::kLanguageXkbAutoRepeatInterval, prefs, callback); |
wake_on_wifi_ssid_.Init(prefs::kWakeOnWifiSsid, prefs, callback); |
+ |
+ resolve_timezone_by_geolocation_.Init(prefs::kResolveTimezoneByGeolocation, |
+ prefs, callback); |
} |
void Preferences::Init(Profile* profile, const user_manager::User* user) { |
@@ -609,6 +618,22 @@ void Preferences::ApplyPreferences(ApplyReason reason, |
WakeOnWifiManager::Get()->OnPreferenceChanged( |
static_cast<WakeOnWifiManager::WakeOnWifiFeature>(features)); |
} |
+ |
+ if (pref_name == prefs::kResolveTimezoneByGeolocation && |
+ reason != REASON_ACTIVE_USER_CHANGED) { |
+ const bool value = resolve_timezone_by_geolocation_.GetValue(); |
+ if (user_is_owner) { |
+ g_browser_process->local_state()->SetBoolean( |
+ prefs::kResolveDeviceTimezoneByGeolocation, value); |
+ } |
+ if (user_is_primary_) { |
+ if (value == true) { |
Bernhard Bauer
2015/01/05 10:22:33
== true isn't necessary.
Alexander Alekseev
2015/01/15 18:59:02
Done.
|
+ g_browser_process->platform_part()->timezone_resolver()->Start(); |
+ } else { |
+ g_browser_process->platform_part()->timezone_resolver()->Stop(); |
+ } |
+ } |
+ } |
} |
void Preferences::OnIsSyncingChanged() { |