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

Unified Diff: chrome/browser/chromeos/preferences.cc

Issue 1843523002: ChromeOS: Add SystemTimezoneAutomaticDetection policy. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@596690--Implement-better-timezone-detection--refactoring-before-policy
Patch Set: Rebased. Created 4 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/chromeos/preferences.cc
diff --git a/chrome/browser/chromeos/preferences.cc b/chrome/browser/chromeos/preferences.cc
index c2cb52ddb1f9a0d8be14eb026cd778417428b0c6..4e91620aab898f05c39252acf391d0121d576a86 100644
--- a/chrome/browser/chromeos/preferences.cc
+++ b/chrome/browser/chromeos/preferences.cc
@@ -23,6 +23,7 @@
#include "chrome/browser/chromeos/input_method/input_method_syncer.h"
#include "chrome/browser/chromeos/login/session/user_session_manager.h"
#include "chrome/browser/chromeos/net/wake_on_wifi_manager.h"
+#include "chrome/browser/chromeos/policy/proto/chrome_device_policy.pb.h"
#include "chrome/browser/chromeos/system/input_device_settings.h"
#include "chrome/browser/chromeos/system/timezone_resolver_manager.h"
#include "chrome/browser/download/download_prefs.h"
@@ -96,6 +97,9 @@ void Preferences::RegisterPrefs(PrefRegistrySimple* registry) {
registry->RegisterStringPref(prefs::kLogoutStartedLast, std::string());
registry->RegisterBooleanPref(prefs::kResolveDeviceTimezoneByGeolocation,
true);
+ registry->RegisterIntegerPref(
+ prefs::kSystemTimezoneAutomaticDetectionPolicy,
+ enterprise_management::SystemTimezoneProto::USERS_DECIDE);
}
// static
@@ -374,6 +378,12 @@ void Preferences::Init(Profile* profile, const user_manager::User* user) {
DCHECK(session_manager);
ime_state_ = session_manager->GetDefaultIMEState(profile);
+ if (user_is_primary_) {
+ g_browser_process->platform_part()
+ ->GetTimezoneResolverManager()
+ ->SetPrimaryUserPrefs(prefs_);
+ }
+
// Initialize preferences to currently saved state.
ApplyPreferences(REASON_INITIALIZATION, "");
@@ -641,10 +651,9 @@ void Preferences::ApplyPreferences(ApplyReason reason,
prefs::kResolveDeviceTimezoneByGeolocation, value);
}
if (user_is_primary_) {
- system::TimeZoneResolverManager* manager =
- g_browser_process->platform_part()->GetTimezoneResolverManager();
- manager->SetPrimaryUserPrefs(prefs_);
- manager->UpdateTimezoneResolver();
+ g_browser_process->platform_part()
+ ->GetTimezoneResolverManager()
+ ->UpdateTimezoneResolver();
if (!value && reason == REASON_PREF_CHANGED) {
// Allow immediate timezone update on Stop + Start.
g_browser_process->local_state()->ClearPref(

Powered by Google App Engine
This is Rietveld 408576698