Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/login/enrollment/enterprise_enrollment_helper_ impl.h" | 5 #include "chrome/browser/chromeos/login/enrollment/enterprise_enrollment_helper_ impl.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/location.h" | 8 #include "base/location.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 139 } | 139 } |
| 140 | 140 |
| 141 void EnterpriseEnrollmentHelperImpl::DoEnroll(const std::string& token) { | 141 void EnterpriseEnrollmentHelperImpl::DoEnroll(const std::string& token) { |
| 142 DCHECK(token == oauth_token_ || oauth_token_.empty()); | 142 DCHECK(token == oauth_token_ || oauth_token_.empty()); |
| 143 DCHECK(enrollment_config_.is_mode_attestation() || | 143 DCHECK(enrollment_config_.is_mode_attestation() || |
| 144 oauth_status_ == OAUTH_STARTED_WITH_AUTH_CODE || | 144 oauth_status_ == OAUTH_STARTED_WITH_AUTH_CODE || |
| 145 oauth_status_ == OAUTH_STARTED_WITH_TOKEN); | 145 oauth_status_ == OAUTH_STARTED_WITH_TOKEN); |
| 146 oauth_token_ = token; | 146 oauth_token_ = token; |
| 147 policy::BrowserPolicyConnectorChromeOS* connector = | 147 policy::BrowserPolicyConnectorChromeOS* connector = |
| 148 g_browser_process->platform_part()->browser_policy_connector_chromeos(); | 148 g_browser_process->platform_part()->browser_policy_connector_chromeos(); |
| 149 if (connector->IsEnterpriseManaged() && | 149 // Re-enrollment not (yet?) supported for Active Directory. |
|
achuithb
2016/11/25 10:10:48
Is this intended to be a TODO? If so, we should ad
Thiemo Nagel
2016/11/25 14:26:10
Good point. It's not intended as a TODO. I've ch
| |
| 150 if (connector->IsCloudManaged() && | |
| 150 connector->GetEnterpriseDomain() != enrolling_user_domain_) { | 151 connector->GetEnterpriseDomain() != enrolling_user_domain_) { |
| 151 LOG(ERROR) << "Trying to re-enroll to a different domain than " | 152 LOG(ERROR) << "Trying to re-enroll to a different domain than " |
| 152 << connector->GetEnterpriseDomain(); | 153 << connector->GetEnterpriseDomain(); |
| 153 UMA(policy::kMetricEnrollmentPrecheckDomainMismatch); | 154 UMA(policy::kMetricEnrollmentPrecheckDomainMismatch); |
| 154 if (oauth_status_ != OAUTH_NOT_STARTED) | 155 if (oauth_status_ != OAUTH_NOT_STARTED) |
| 155 oauth_status_ = OAUTH_FINISHED; | 156 oauth_status_ = OAUTH_FINISHED; |
| 156 status_consumer()->OnOtherError(OTHER_ERROR_DOMAIN_MISMATCH); | 157 status_consumer()->OnOtherError(OTHER_ERROR_DOMAIN_MISMATCH); |
| 157 return; | 158 return; |
| 158 } | 159 } |
| 159 | 160 |
| (...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 427 EnrollmentUMA(sample, enrollment_config_.mode); | 428 EnrollmentUMA(sample, enrollment_config_.mode); |
| 428 } | 429 } |
| 429 | 430 |
| 430 void EnterpriseEnrollmentHelperImpl::OnSigninProfileCleared( | 431 void EnterpriseEnrollmentHelperImpl::OnSigninProfileCleared( |
| 431 const base::Closure& callback) { | 432 const base::Closure& callback) { |
| 432 oauth_data_cleared_ = true; | 433 oauth_data_cleared_ = true; |
| 433 callback.Run(); | 434 callback.Run(); |
| 434 } | 435 } |
| 435 | 436 |
| 436 } // namespace chromeos | 437 } // namespace chromeos |
| OLD | NEW |