Chromium Code Reviews| Index: chrome/browser/ui/webui/options/chromeos/system_settings_provider.cc |
| diff --git a/chrome/browser/ui/webui/options/chromeos/system_settings_provider.cc b/chrome/browser/ui/webui/options/chromeos/system_settings_provider.cc |
| index 1d629565bcd9c363e1abaae63136d8c45603fad3..2e957959a6ae7c4fc65debf29227325cb39c6e16 100644 |
| --- a/chrome/browser/ui/webui/options/chromeos/system_settings_provider.cc |
| +++ b/chrome/browser/ui/webui/options/chromeos/system_settings_provider.cc |
| @@ -189,7 +189,8 @@ SystemSettingsProvider::SystemSettingsProvider() { |
| icu::UnicodeString(kTimeZones[i], -1, US_INV))); |
| } |
| system::TimezoneSettings::GetInstance()->AddObserver(this); |
| - |
| + timezone_value_.reset(base::Value::CreateStringValue(GetKnownTimezoneID( |
| + system::TimezoneSettings::GetInstance()->GetTimezone()))); |
| } |
| SystemSettingsProvider::~SystemSettingsProvider() { |
| @@ -211,22 +212,21 @@ void SystemSettingsProvider::DoSet(const std::string& path, |
| if (!timezone) |
| return; |
| system::TimezoneSettings::GetInstance()->SetTimezone(*timezone); |
| + timezone_value_.reset( |
| + base::Value::CreateStringValue(GetKnownTimezoneID(*timezone))); |
| } |
| } |
| const base::Value* SystemSettingsProvider::Get(const std::string& path) const { |
| if (path == kSystemTimezone) { |
|
Mattias Nissler (ping if slow)
2011/12/02 12:13:37
no need for curlies.
pastarmovj
2011/12/02 14:43:38
Done.
|
| - // TODO(pastarmovj): Cache this in the local_state instead of locally. |
| - system_timezone_.reset(base::Value::CreateStringValue(GetKnownTimezoneID( |
| - system::TimezoneSettings::GetInstance()->GetTimezone()))); |
| - return system_timezone_.get(); |
| + return timezone_value_.get(); |
| } |
| return NULL; |
| } |
| // The timezone is always trusted. |
| bool SystemSettingsProvider::GetTrusted(const std::string& path, |
| - const base::Closure& callback) const { |
| + const base::Closure& callback) { |
| return true; |
| } |
| @@ -234,8 +234,15 @@ bool SystemSettingsProvider::HandlesSetting(const std::string& path) const { |
| return path == kSystemTimezone; |
| } |
| +void SystemSettingsProvider::Reload() { |
| + // TODO(pastarmovj): We can actually cache the timezone here to make returning |
| + // it faster. |
| +} |
| + |
| void SystemSettingsProvider::TimezoneChanged(const icu::TimeZone& timezone) { |
| // Fires system setting change notification. |
| + timezone_value_.reset( |
| + base::Value::CreateStringValue(GetKnownTimezoneID(timezone))); |
| CrosSettings::Get()->FireObservers(kSystemTimezone); |
| } |