Chromium Code Reviews| 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()) { |