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

Unified Diff: chrome/browser/ui/webui/options/chromeos/system_settings_provider.cc

Issue 8727037: Signed settings refactoring: Proper caching and more tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased to ToT and removed some debug output left. Created 9 years, 1 month 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/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..a01c2a7b612d389695f4db38762b5b7ce9a27c2d 100644
--- a/chrome/browser/ui/webui/options/chromeos/system_settings_provider.cc
+++ b/chrome/browser/ui/webui/options/chromeos/system_settings_provider.cc
@@ -214,19 +214,17 @@ void SystemSettingsProvider::DoSet(const std::string& path,
}
}
-const base::Value* SystemSettingsProvider::Get(const std::string& path) const {
+base::Value* SystemSettingsProvider::Get(const std::string& path) const {
if (path == kSystemTimezone) {
- // 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 base::Value::CreateStringValue(GetKnownTimezoneID(
+ system::TimezoneSettings::GetInstance()->GetTimezone()));
}
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,6 +232,11 @@ 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. This is not really so critical so for now we can leave it as is.
Mattias Nissler (ping if slow) 2011/11/30 12:25:50 Just remove the second sentence.
pastarmovj 2011/11/30 17:21:16 Done.
+}
+
void SystemSettingsProvider::TimezoneChanged(const icu::TimeZone& timezone) {
// Fires system setting change notification.
CrosSettings::Get()->FireObservers(kSystemTimezone);

Powered by Google App Engine
This is Rietveld 408576698