| 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/enrollment_handler_chromeos.h" | 5 #include "chrome/browser/chromeos/policy/enrollment_handler_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/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 ReportResult(EnrollmentStatus::ForFetchError( | 192 ReportResult(EnrollmentStatus::ForFetchError( |
| 193 DM_STATUS_RESPONSE_DECODING_ERROR)); | 193 DM_STATUS_RESPONSE_DECODING_ERROR)); |
| 194 return; | 194 return; |
| 195 } | 195 } |
| 196 | 196 |
| 197 std::unique_ptr<DeviceCloudPolicyValidator> validator( | 197 std::unique_ptr<DeviceCloudPolicyValidator> validator( |
| 198 DeviceCloudPolicyValidator::Create( | 198 DeviceCloudPolicyValidator::Create( |
| 199 base::MakeUnique<em::PolicyFetchResponse>(*policy), | 199 base::MakeUnique<em::PolicyFetchResponse>(*policy), |
| 200 background_task_runner_)); | 200 background_task_runner_)); |
| 201 | 201 |
| 202 validator->ValidateTimestamp( | 202 validator->ValidateTimestamp(base::Time(), |
| 203 base::Time(), base::Time::NowFromSystemTime(), | 203 CloudPolicyValidatorBase::TIMESTAMP_VALIDATED); |
| 204 CloudPolicyValidatorBase::TIMESTAMP_FULLY_VALIDATED); | |
| 205 | 204 |
| 206 // If this is re-enrollment, make sure that the new policy matches the | 205 // If this is re-enrollment, make sure that the new policy matches the |
| 207 // previously-enrolled domain. (Currently only implemented for cloud | 206 // previously-enrolled domain. (Currently only implemented for cloud |
| 208 // management.) | 207 // management.) |
| 209 std::string domain; | 208 std::string domain; |
| 210 if (install_attributes_->IsCloudManaged()) { | 209 if (install_attributes_->IsCloudManaged()) { |
| 211 domain = install_attributes_->GetDomain(); | 210 domain = install_attributes_->GetDomain(); |
| 212 validator->ValidateDomain(domain); | 211 validator->ValidateDomain(domain); |
| 213 } | 212 } |
| 214 validator->ValidateDMToken(client->dm_token(), | 213 validator->ValidateDMToken(client->dm_token(), |
| (...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 662 callback.Run(status); | 661 callback.Run(status); |
| 663 } | 662 } |
| 664 | 663 |
| 665 void EnrollmentHandlerChromeOS::SetStep(EnrollmentStep step) { | 664 void EnrollmentHandlerChromeOS::SetStep(EnrollmentStep step) { |
| 666 DCHECK_LE(enrollment_step_, step); | 665 DCHECK_LE(enrollment_step_, step); |
| 667 VLOG(1) << "Step: " << step; | 666 VLOG(1) << "Step: " << step; |
| 668 enrollment_step_ = step; | 667 enrollment_step_ = step; |
| 669 } | 668 } |
| 670 | 669 |
| 671 } // namespace policy | 670 } // namespace policy |
| OLD | NEW |