| 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 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 } | 179 } |
| 180 validator->ValidateDMToken(client->dm_token(), | 180 validator->ValidateDMToken(client->dm_token(), |
| 181 CloudPolicyValidatorBase::DM_TOKEN_REQUIRED); | 181 CloudPolicyValidatorBase::DM_TOKEN_REQUIRED); |
| 182 validator->ValidatePolicyType(dm_protocol::kChromeDevicePolicyType); | 182 validator->ValidatePolicyType(dm_protocol::kChromeDevicePolicyType); |
| 183 validator->ValidatePayload(); | 183 validator->ValidatePayload(); |
| 184 // If |domain| is empty here, the policy validation code will just use the | 184 // If |domain| is empty here, the policy validation code will just use the |
| 185 // domain from the username field in the policy itself to do key validation. | 185 // domain from the username field in the policy itself to do key validation. |
| 186 // TODO(mnissler): Plumb the enrolling user's username into this object so we | 186 // TODO(mnissler): Plumb the enrolling user's username into this object so we |
| 187 // can validate the username on the resulting policy, and use the domain from | 187 // can validate the username on the resulting policy, and use the domain from |
| 188 // that username to validate the key below (http://crbug.com/343074). | 188 // that username to validate the key below (http://crbug.com/343074). |
| 189 validator->ValidateInitialKey(GetPolicyVerificationKey(), domain); | 189 validator->ValidateInitialKey(domain); |
| 190 validator.release()->StartValidation( | 190 validator.release()->StartValidation( |
| 191 base::Bind(&EnrollmentHandlerChromeOS::HandlePolicyValidationResult, | 191 base::Bind(&EnrollmentHandlerChromeOS::HandlePolicyValidationResult, |
| 192 weak_ptr_factory_.GetWeakPtr())); | 192 weak_ptr_factory_.GetWeakPtr())); |
| 193 } | 193 } |
| 194 | 194 |
| 195 void EnrollmentHandlerChromeOS::OnRegistrationStateChanged( | 195 void EnrollmentHandlerChromeOS::OnRegistrationStateChanged( |
| 196 CloudPolicyClient* client) { | 196 CloudPolicyClient* client) { |
| 197 DCHECK_EQ(client_.get(), client); | 197 DCHECK_EQ(client_.get(), client); |
| 198 | 198 |
| 199 if (enrollment_step_ == STEP_REGISTRATION && client_->is_registered()) { | 199 if (enrollment_step_ == STEP_REGISTRATION && client_->is_registered()) { |
| (...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 520 callback.Run(status); | 520 callback.Run(status); |
| 521 } | 521 } |
| 522 | 522 |
| 523 void EnrollmentHandlerChromeOS::SetStep(EnrollmentStep step) { | 523 void EnrollmentHandlerChromeOS::SetStep(EnrollmentStep step) { |
| 524 DCHECK_LE(enrollment_step_, step); | 524 DCHECK_LE(enrollment_step_, step); |
| 525 VLOG(1) << "Step: " << step; | 525 VLOG(1) << "Step: " << step; |
| 526 enrollment_step_ = step; | 526 enrollment_step_ = step; |
| 527 } | 527 } |
| 528 | 528 |
| 529 } // namespace policy | 529 } // namespace policy |
| OLD | NEW |