| 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 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 weak_ptr_factory_.GetWeakPtr())); | 195 weak_ptr_factory_.GetWeakPtr())); |
| 196 } | 196 } |
| 197 | 197 |
| 198 void EnrollmentHandlerChromeOS::OnRegistrationStateChanged( | 198 void EnrollmentHandlerChromeOS::OnRegistrationStateChanged( |
| 199 CloudPolicyClient* client) { | 199 CloudPolicyClient* client) { |
| 200 DCHECK_EQ(client_.get(), client); | 200 DCHECK_EQ(client_.get(), client); |
| 201 | 201 |
| 202 if (enrollment_step_ == STEP_REGISTRATION && client_->is_registered()) { | 202 if (enrollment_step_ == STEP_REGISTRATION && client_->is_registered()) { |
| 203 SetStep(STEP_POLICY_FETCH); | 203 SetStep(STEP_POLICY_FETCH); |
| 204 device_mode_ = client_->device_mode(); | 204 device_mode_ = client_->device_mode(); |
| 205 if (device_mode_ != DEVICE_MODE_ENTERPRISE && | 205 if (!((device_mode_ == DEVICE_MODE_ENTERPRISE && |
| 206 device_mode_ != DEVICE_MODE_ENTERPRISE_AD) { | 206 enrollment_config_.management_realm.empty()) || |
| 207 (device_mode_ == DEVICE_MODE_ENTERPRISE_AD && |
| 208 !enrollment_config_.management_realm.empty()))) { |
| 207 LOG(ERROR) << "Bad device mode " << device_mode_; | 209 LOG(ERROR) << "Bad device mode " << device_mode_; |
| 208 ReportResult( | 210 ReportResult( |
| 209 EnrollmentStatus::ForStatus(EnrollmentStatus::REGISTRATION_BAD_MODE)); | 211 EnrollmentStatus::ForStatus(EnrollmentStatus::REGISTRATION_BAD_MODE)); |
| 210 return; | 212 return; |
| 211 } | 213 } |
| 212 client_->FetchPolicy(); | 214 client_->FetchPolicy(); |
| 213 } else { | 215 } else { |
| 214 LOG(FATAL) << "Registration state changed to " << client_->is_registered() | 216 LOG(FATAL) << "Registration state changed to " << client_->is_registered() |
| 215 << " in step " << enrollment_step_ << "."; | 217 << " in step " << enrollment_step_ << "."; |
| 216 } | 218 } |
| (...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 559 callback.Run(status); | 561 callback.Run(status); |
| 560 } | 562 } |
| 561 | 563 |
| 562 void EnrollmentHandlerChromeOS::SetStep(EnrollmentStep step) { | 564 void EnrollmentHandlerChromeOS::SetStep(EnrollmentStep step) { |
| 563 DCHECK_LE(enrollment_step_, step); | 565 DCHECK_LE(enrollment_step_, step); |
| 564 VLOG(1) << "Step: " << step; | 566 VLOG(1) << "Step: " << step; |
| 565 enrollment_step_ = step; | 567 enrollment_step_ = step; |
| 566 } | 568 } |
| 567 | 569 |
| 568 } // namespace policy | 570 } // namespace policy |
| OLD | NEW |