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

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

Issue 1019283004: Switch to direct use of OwnerSettingsServiceChromeOS::Set() in tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 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/settings/stub_cros_settings_provider.cc
diff --git a/chrome/browser/chromeos/settings/stub_cros_settings_provider.cc b/chrome/browser/chromeos/settings/stub_cros_settings_provider.cc
index c11e3c306c2b64dcc97e7dfe84979b0c515dc11e..3b6a89a24aa7cb0d33184de3d58a0e566d9acf9f 100644
--- a/chrome/browser/chromeos/settings/stub_cros_settings_provider.cc
+++ b/chrome/browser/chromeos/settings/stub_cros_settings_provider.cc
@@ -37,17 +37,27 @@ const base::Value* StubCrosSettingsProvider::Get(
CrosSettingsProvider::TrustedStatus
StubCrosSettingsProvider::PrepareTrustedValues(const base::Closure& cb) {
- // We don't have a trusted store so all values are available immediately.
- return TRUSTED;
+ return trusted_status_;
}
bool StubCrosSettingsProvider::HandlesSetting(const std::string& path) const {
return DeviceSettingsProvider::IsDeviceSetting(path);
}
+void StubCrosSettingsProvider::SetTrustedStatus(TrustedStatus status) {
+ trusted_status_ = status;
+}
+
+void StubCrosSettingsProvider::SetCurrentUserIsOwner(bool owner) {
+ current_user_is_owner_ = owner;
+}
+
void StubCrosSettingsProvider::DoSet(const std::string& path,
const base::Value& value) {
- values_.SetValue(path, value.DeepCopy());
+ if (current_user_is_owner_)
+ values_.SetValue(path, value.DeepCopy());
+ else
+ LOG(WARNING) << "Changing settings from non-owner, setting=" << path;
NotifyObservers(path);
}

Powered by Google App Engine
This is Rietveld 408576698