| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/chromeos/policy/device_cloud_policy_store_chromeos.h" | 5 #include "chrome/browser/chromeos/policy/device_cloud_policy_store_chromeos.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 NotifyStoreError(); | 61 NotifyStoreError(); |
| 62 return; | 62 return; |
| 63 } | 63 } |
| 64 | 64 |
| 65 std::unique_ptr<DeviceCloudPolicyValidator> validator( | 65 std::unique_ptr<DeviceCloudPolicyValidator> validator( |
| 66 CreateValidator(policy)); | 66 CreateValidator(policy)); |
| 67 validator->ValidateSignatureAllowingRotation( | 67 validator->ValidateSignatureAllowingRotation( |
| 68 public_key->as_string(), install_attributes_->GetDomain()); | 68 public_key->as_string(), install_attributes_->GetDomain()); |
| 69 validator->ValidateAgainstCurrentPolicy( | 69 validator->ValidateAgainstCurrentPolicy( |
| 70 device_settings_service_->policy_data(), | 70 device_settings_service_->policy_data(), |
| 71 CloudPolicyValidatorBase::TIMESTAMP_FULLY_VALIDATED, | 71 CloudPolicyValidatorBase::TIMESTAMP_VALIDATED, |
| 72 CloudPolicyValidatorBase::DM_TOKEN_REQUIRED, | 72 CloudPolicyValidatorBase::DM_TOKEN_REQUIRED, |
| 73 CloudPolicyValidatorBase::DEVICE_ID_REQUIRED); | 73 CloudPolicyValidatorBase::DEVICE_ID_REQUIRED); |
| 74 validator.release()->StartValidation( | 74 validator.release()->StartValidation( |
| 75 base::Bind(&DeviceCloudPolicyStoreChromeOS::OnPolicyToStoreValidated, | 75 base::Bind(&DeviceCloudPolicyStoreChromeOS::OnPolicyToStoreValidated, |
| 76 weak_factory_.GetWeakPtr())); | 76 weak_factory_.GetWeakPtr())); |
| 77 } | 77 } |
| 78 | 78 |
| 79 void DeviceCloudPolicyStoreChromeOS::Load() { | 79 void DeviceCloudPolicyStoreChromeOS::Load() { |
| 80 device_settings_service_->Load(); | 80 device_settings_service_->Load(); |
| 81 } | 81 } |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 236 UMA_HISTOGRAM_BOOLEAN(kDMTokenCheckHistogram, true); | 236 UMA_HISTOGRAM_BOOLEAN(kDMTokenCheckHistogram, true); |
| 237 } else { | 237 } else { |
| 238 LOG(ERROR) << "Device policy read on enrolled device yields " | 238 LOG(ERROR) << "Device policy read on enrolled device yields " |
| 239 << "no DM token! Status: " << service_status << "."; | 239 << "no DM token! Status: " << service_status << "."; |
| 240 chromeos::StartupUtils::MarkEnrollmentRecoveryRequired(); | 240 chromeos::StartupUtils::MarkEnrollmentRecoveryRequired(); |
| 241 UMA_HISTOGRAM_BOOLEAN(kDMTokenCheckHistogram, false); | 241 UMA_HISTOGRAM_BOOLEAN(kDMTokenCheckHistogram, false); |
| 242 } | 242 } |
| 243 } | 243 } |
| 244 | 244 |
| 245 } // namespace policy | 245 } // namespace policy |
| OLD | NEW |