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

Unified Diff: chrome/browser/chromeos/policy/device_cloud_policy_store_chromeos.cc

Issue 2486813002: Add DeviceADPolicyManager to provide AD policy. (Closed)
Patch Set: Address Bernhard's comments Created 4 years, 1 month 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/policy/device_cloud_policy_store_chromeos.cc
diff --git a/chrome/browser/chromeos/policy/device_cloud_policy_store_chromeos.cc b/chrome/browser/chromeos/policy/device_cloud_policy_store_chromeos.cc
index 0f600faa3585e00c74a81d6c712766d0195589fb..5317131bef6b17561c5f49c484cfb9bc333e5971 100644
--- a/chrome/browser/chromeos/policy/device_cloud_policy_store_chromeos.cc
+++ b/chrome/browser/chromeos/policy/device_cloud_policy_store_chromeos.cc
@@ -36,6 +36,7 @@ DeviceCloudPolicyStoreChromeOS::DeviceCloudPolicyStoreChromeOS(
background_task_runner_(background_task_runner),
weak_factory_(this) {
device_settings_service_->AddObserver(this);
+ device_settings_service_->SetDeviceMode(install_attributes_->GetMode());
}
DeviceCloudPolicyStoreChromeOS::~DeviceCloudPolicyStoreChromeOS() {
@@ -49,7 +50,7 @@ void DeviceCloudPolicyStoreChromeOS::Store(
scoped_refptr<ownership::PublicKey> public_key(
device_settings_service_->GetPublicKey());
- if (!install_attributes_->IsEnterpriseDevice() ||
+ if (!install_attributes_->IsCloudManaged() ||
!device_settings_service_->policy_data() || !public_key.get() ||
!public_key->is_loaded()) {
status_ = STATUS_BAD_STATE;
@@ -81,7 +82,7 @@ void DeviceCloudPolicyStoreChromeOS::InstallInitialPolicy(
// Cancel all pending requests.
weak_factory_.InvalidateWeakPtrs();
- if (!install_attributes_->IsEnterpriseDevice()) {
+ if (!install_attributes_->IsCloudManaged()) {
status_ = STATUS_BAD_STATE;
NotifyStoreError();
return;
@@ -139,7 +140,7 @@ void DeviceCloudPolicyStoreChromeOS::OnPolicyStored() {
}
void DeviceCloudPolicyStoreChromeOS::UpdateFromService() {
- if (!install_attributes_->IsEnterpriseDevice()) {
+ if (!install_attributes_->IsEnterpriseManaged()) {
status_ = STATUS_BAD_STATE;
NotifyStoreError();
return;
@@ -214,6 +215,11 @@ void DeviceCloudPolicyStoreChromeOS::CheckDMToken() {
}
dm_token_checked_ = true;
+ // PolicyData from Active Directory doesn't contain a DM token.
+ if (install_attributes_->IsActiveDirectoryManaged()) {
+ return;
+ }
+
// At the time LoginDisplayHostImpl decides whether enrollment flow is to be
// started, policy hasn't been read yet. To work around this, once the need
// for recovery is detected upon policy load, a flag is stored in prefs which

Powered by Google App Engine
This is Rietveld 408576698