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

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

Issue 8899002: [cros] Add --stub-cros-settings option for testing. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge Created 9 years 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/device_settings_provider.cc
diff --git a/chrome/browser/chromeos/device_settings_provider.cc b/chrome/browser/chromeos/device_settings_provider.cc
index 0557831b9cf36a58075c4da48baad2649d348b6f..9f340db0d3789189947f5812c788fc38662ecb46 100644
--- a/chrome/browser/chromeos/device_settings_provider.cc
+++ b/chrome/browser/chromeos/device_settings_provider.cc
@@ -92,8 +92,10 @@ bool HasOldMetricsFile() {
} // namespace
-DeviceSettingsProvider::DeviceSettingsProvider()
- : ownership_status_(OwnershipService::GetSharedInstance()->GetStatus(true)),
+DeviceSettingsProvider::DeviceSettingsProvider(
+ const NotifyObserversCallback& notify_cb)
+ : CrosSettingsProvider(notify_cb),
+ ownership_status_(OwnershipService::GetSharedInstance()->GetStatus(true)),
migration_helper_(new SignedSettingsMigrationHelper()),
retries_left_(kNumRetriesLimit),
trusted_(false) {
@@ -130,7 +132,7 @@ void DeviceSettingsProvider::DoSet(const std::string& path,
LOG(WARNING) << "Changing settings from non-owner, setting=" << path;
// Revert UI change.
- CrosSettings::Get()->FireObservers(path.c_str());
+ NotifyObservers(path);
return;
}
@@ -180,7 +182,7 @@ void DeviceSettingsProvider::SetInPolicy(const std::string& prop,
if (value.GetAsString(&owner)) {
policy_.set_username(owner);
values_cache_.SetValue(prop, value.DeepCopy());
- CrosSettings::Get()->FireObservers(prop.c_str());
+ NotifyObservers(prop);
// We can't trust this value anymore until we reload the real username.
trusted_ = false;
} else {
@@ -273,7 +275,7 @@ void DeviceSettingsProvider::SetInPolicy(const std::string& prop,
// Set the cache to the updated value.
policy_ = data;
UpdateValuesCache();
- CrosSettings::Get()->FireObservers(prop.c_str());
+ NotifyObservers(prop);
if (!signed_settings_cache::Store(data, g_browser_process->local_state()))
LOG(ERROR) << "Couldn't store to the temp storage.";
« no previous file with comments | « chrome/browser/chromeos/device_settings_provider.h ('k') | chrome/browser/chromeos/login/ownership_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698