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

Unified Diff: chrome/browser/chromeos/settings/system_settings_provider.cc

Issue 2849823003: ChromeOS: implement per-user time zone preferences. (Closed)
Patch Set: Rebased. Created 3 years, 4 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/settings/system_settings_provider.cc
diff --git a/chrome/browser/chromeos/settings/system_settings_provider.cc b/chrome/browser/chromeos/settings/system_settings_provider.cc
index e636b91a50f57d49c30ddba7e394dd28162047d2..02b9d119771810335613da447b7d7700ecd616ad 100644
--- a/chrome/browser/chromeos/settings/system_settings_provider.cc
+++ b/chrome/browser/chromeos/settings/system_settings_provider.cc
@@ -7,6 +7,7 @@
#include "base/strings/string16.h"
#include "base/time/time.h"
#include "base/values.h"
+#include "chrome/browser/chromeos/system/timezone_util.h"
#include "chromeos/login/login_state.h"
#include "chromeos/settings/cros_settings_names.h"
@@ -20,6 +21,8 @@ SystemSettingsProvider::SystemSettingsProvider(
timezone_settings->AddObserver(this);
timezone_value_.reset(
new base::Value(timezone_settings->GetCurrentTimezoneID()));
+ per_user_timezone_enabled_value_.reset(
+ new base::Value(system::PerUserTimezoneEnabled()));
}
SystemSettingsProvider::~SystemSettingsProvider() {
@@ -41,11 +44,16 @@ void SystemSettingsProvider::DoSet(const std::string& path,
// This will call TimezoneChanged.
system::TimezoneSettings::GetInstance()->SetTimezoneFromID(timezone_id);
}
+ // kPerUserTimezoneEnabled is read-only.
}
const base::Value* SystemSettingsProvider::Get(const std::string& path) const {
if (path == kSystemTimezone)
return timezone_value_.get();
+
+ if (path == kPerUserTimezoneEnabled)
+ return per_user_timezone_enabled_value_.get();
+
return NULL;
}
@@ -56,7 +64,7 @@ CrosSettingsProvider::TrustedStatus
}
bool SystemSettingsProvider::HandlesSetting(const std::string& path) const {
- return path == kSystemTimezone;
+ return path == kSystemTimezone || path == kPerUserTimezoneEnabled;
}
void SystemSettingsProvider::TimezoneChanged(const icu::TimeZone& timezone) {
« no previous file with comments | « chrome/browser/chromeos/settings/system_settings_provider.h ('k') | chrome/browser/chromeos/system/timezone_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698