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

Unified Diff: chrome/browser/chromeos/settings/device_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: Rearrange device settings list. Created 5 years, 9 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/device_settings_provider.cc
diff --git a/chrome/browser/chromeos/settings/device_settings_provider.cc b/chrome/browser/chromeos/settings/device_settings_provider.cc
index 02bb836d980022db8a2b9daf7871ef30528fcb7d..ee6739704613499941ac3ea5655e1906e7da9ad6 100644
--- a/chrome/browser/chromeos/settings/device_settings_provider.cc
+++ b/chrome/browser/chromeos/settings/device_settings_provider.cc
@@ -55,10 +55,14 @@ const char* const kKnownSettings[] = {
kAllowedConnectionTypesForUpdate,
kAttestationForContentProtectionEnabled,
kDeviceAttestationEnabled,
+ kDeviceDisabled,
+ kDeviceDisabledMessage,
kDeviceOwner,
+ kExtensionCacheSize,
kHeartbeatEnabled,
kHeartbeatFrequency,
kPolicyMissingMitigationMode,
+ kRebootOnShutdown,
kReleaseChannel,
kReleaseChannelDelegated,
kReportDeviceActivityTimes,
@@ -78,10 +82,6 @@ const char* const kKnownSettings[] = {
kSystemUse24HourClock,
kUpdateDisabled,
kVariationsRestrictParameter,
- kDeviceDisabled,
- kDeviceDisabledMessage,
- kRebootOnShutdown,
- kExtensionCacheSize,
};
bool HasOldMetricsFile() {
@@ -451,6 +451,7 @@ DeviceSettingsProvider::DeviceSettingsProvider(
device_settings_service_(device_settings_service),
trusted_status_(TEMPORARILY_UNTRUSTED),
ownership_status_(device_settings_service_->GetOwnershipStatus()),
+ trusted_for_test_(false),
store_callback_factory_(this) {
device_settings_service_->AddObserver(this);
if (!UpdateFromService()) {
@@ -718,6 +719,8 @@ const base::Value* DeviceSettingsProvider::Get(const std::string& path) const {
DeviceSettingsProvider::TrustedStatus
DeviceSettingsProvider::PrepareTrustedValues(const base::Closure& cb) {
+ if (trusted_for_test_)
Mattias Nissler (ping if slow) 2015/03/27 12:42:06 Uh, why is this needed?
Ivan Podogov 2015/03/27 12:51:14 Because the first time the owner settings observer
Mattias Nissler (ping if slow) 2015/03/27 12:58:52 There are a number of tests that prepare device se
Ivan Podogov 2015/03/27 13:10:50 Off the top of my head those would be HeartbeatSch
Mattias Nissler (ping if slow) 2015/03/27 13:45:58 I think it's fine to actually retain StubSettingsP
+ return TRUSTED;
TrustedStatus status = RequestTrustedEntity();
if (status == TEMPORARILY_UNTRUSTED && !cb.is_null())
callbacks_.push_back(cb);

Powered by Google App Engine
This is Rietveld 408576698