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

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

Issue 2902183002: Improve determination of managed state in DeviceSettingsProvider (Closed)
Patch Set: Addressed comments Created 3 years, 7 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
« no previous file with comments | « no previous file | components/policy/proto/device_management_backend.proto » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 de64b1aec1bc0c6229d10eaa525cd7fbc3351dda..316d6321607474bafb3c135067fe452b6dacfb53 100644
--- a/chrome/browser/chromeos/settings/device_settings_provider.cc
+++ b/chrome/browser/chromeos/settings/device_settings_provider.cc
@@ -742,8 +742,18 @@ void DeviceSettingsProvider::UpdateValuesCache(
TrustedStatus trusted_status) {
PrefValueMap new_values_cache;
+ // Determine whether device is unmanaged. See PolicyData::management_mode
+ // docs for details.
+ bool unmanaged = false;
Roman Sorokin (ftl) 2017/05/29 16:19:53 why not "managed = true" ? Negative name is confu
Thiemo Nagel 2017/05/30 12:25:07 Done.
+ if (policy_data.has_management_mode()) {
+ if (policy_data.management_mode() != em::PolicyData::ENTERPRISE_MANAGED)
+ unmanaged = true;
+ } else if (!policy_data.has_request_token()) {
+ unmanaged = true;
+ }
+
// If the device is not managed, we set the device owner value.
- if (policy_data.has_username() && !policy_data.has_request_token())
+ if (policy_data.has_username() && unmanaged)
new_values_cache.SetString(kDeviceOwner, policy_data.username());
if (policy_data.has_service_account_identity()) {
« no previous file with comments | « no previous file | components/policy/proto/device_management_backend.proto » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698