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

Unified Diff: chrome/browser/chromeos/ownership/owner_settings_service_chromeos.cc

Issue 666363002: DeviceSettingsProvider's write path uses OwnerSettingsService now. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixes. Created 6 years, 2 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/ownership/owner_settings_service_chromeos.cc
diff --git a/chrome/browser/chromeos/ownership/owner_settings_service_chromeos.cc b/chrome/browser/chromeos/ownership/owner_settings_service_chromeos.cc
index ea82e03b7b72912c0736dbfb4921433f737a101d..2bd669581bc19d2b879155fd9cf2e48d98b0ba62 100644
--- a/chrome/browser/chromeos/ownership/owner_settings_service_chromeos.cc
+++ b/chrome/browser/chromeos/ownership/owner_settings_service_chromeos.cc
@@ -224,6 +224,24 @@ bool OwnerSettingsServiceChromeOS::Set(const std::string& setting,
return true;
}
+bool OwnerSettingsServiceChromeOS::CommitTentativeDeviceSettings(
+ scoped_ptr<enterprise_management::PolicyData> policy) {
+ if (!IsOwner() && !IsOwnerInTests(user_id_))
+ return false;
+ if (policy->username() != user_id_) {
+ LOG(ERROR) << "Username mismatch: " << policy->username() << " vs. "
+ << user_id_;
+ return false;
+ }
+ CHECK(device_settings_.ParseFromString(policy->policy_value()));
+ FOR_EACH_OBSERVER(OwnerSettingsService::Observer,
+ observers_,
+ OnTentativeChangesInPolicy(*policy));
+ has_pending_changes_ = true;
+ StoreDeviceSettings();
+ return true;
+}
+
void OwnerSettingsServiceChromeOS::Observe(
int type,
const content::NotificationSource& source,

Powered by Google App Engine
This is Rietveld 408576698