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/screens/host_pairing_screen.h" | 5 #include "chrome/browser/chromeos/login/screens/host_pairing_screen.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/logging.h" | |
8 #include "chrome/browser/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
9 #include "chrome/browser/chromeos/login/startup_utils.h" | 10 #include "chrome/browser/chromeos/login/startup_utils.h" |
10 #include "chrome/browser/chromeos/login/wizard_controller.h" | 11 #include "chrome/browser/chromeos/login/wizard_controller.h" |
11 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" | 12 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" |
12 #include "chrome/browser/chromeos/policy/enrollment_status_chromeos.h" | 13 #include "chrome/browser/chromeos/policy/enrollment_status_chromeos.h" |
13 #include "components/pairing/host_pairing_controller.h" | 14 #include "components/pairing/host_pairing_controller.h" |
14 #include "google_apis/gaia/google_service_auth_error.h" | 15 #include "google_apis/gaia/google_service_auth_error.h" |
15 | 16 |
16 namespace chromeos { | 17 namespace chromeos { |
17 | 18 |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
180 } | 181 } |
181 | 182 |
182 void HostPairingScreen::OnAuthError(const GoogleServiceAuthError& error) { | 183 void HostPairingScreen::OnAuthError(const GoogleServiceAuthError& error) { |
183 enrollment_error_string_ = view_->GetErrorStringFromAuthError(error); | 184 enrollment_error_string_ = view_->GetErrorStringFromAuthError(error); |
184 enrollment_error_code_ = | 185 enrollment_error_code_ = |
185 GetEnrollmentErrorCode(HostPairingController::ErrorCode::AUTH_ERROR, | 186 GetEnrollmentErrorCode(HostPairingController::ErrorCode::AUTH_ERROR, |
186 static_cast<int>(error.state())); | 187 static_cast<int>(error.state())); |
187 OnAnyEnrollmentError(); | 188 OnAnyEnrollmentError(); |
188 } | 189 } |
189 | 190 |
191 void HostPairingScreen::OnMultipleLicensesAvailable( | |
192 const EnrollmentLicenseMap& licenses) { | |
193 LOG(ERROR) << "Host-paired enrollment is not yet compatible " | |
194 << "with Mixed Licenses Enrollment Flow"; | |
195 enrollment_error_string_ = view_->GetErrorStringFromOtherError( | |
196 EnterpriseEnrollmentHelper::OTHER_ERROR_FATAL); | |
achuithb
2017/07/31 21:03:23
Could we add a more specific error here?
Denis Kuznetsov (DE-MUC)
2017/08/01 10:50:54
Well, we have logged detailed explanation above. A
| |
197 enrollment_error_code_ = GetEnrollmentErrorCode( | |
198 HostPairingController::ErrorCode::OTHER_ERROR, | |
199 static_cast<int>(EnterpriseEnrollmentHelper::OTHER_ERROR_FATAL)); | |
200 OnAnyEnrollmentError(); | |
201 } | |
202 | |
190 void HostPairingScreen::OnEnrollmentError(policy::EnrollmentStatus status) { | 203 void HostPairingScreen::OnEnrollmentError(policy::EnrollmentStatus status) { |
191 enrollment_error_string_ = view_->GetErrorStringFromEnrollmentError(status); | 204 enrollment_error_string_ = view_->GetErrorStringFromEnrollmentError(status); |
192 enrollment_error_code_ = | 205 enrollment_error_code_ = |
193 GetEnrollmentErrorCode(HostPairingController::ErrorCode::ENROLL_ERROR, | 206 GetEnrollmentErrorCode(HostPairingController::ErrorCode::ENROLL_ERROR, |
194 static_cast<int>(status.status())); | 207 static_cast<int>(status.status())); |
195 OnAnyEnrollmentError(); | 208 OnAnyEnrollmentError(); |
196 } | 209 } |
197 | 210 |
198 void HostPairingScreen::OnOtherError( | 211 void HostPairingScreen::OnOtherError( |
199 EnterpriseEnrollmentHelper::OtherError error) { | 212 EnterpriseEnrollmentHelper::OtherError error) { |
(...skipping 29 matching lines...) Expand all Loading... | |
229 void HostPairingScreen::OnAnyEnrollmentError() { | 242 void HostPairingScreen::OnAnyEnrollmentError() { |
230 enrollment_helper_->ClearAuth(base::Bind(&HostPairingScreen::OnAuthCleared, | 243 enrollment_helper_->ClearAuth(base::Bind(&HostPairingScreen::OnAuthCleared, |
231 weak_ptr_factory_.GetWeakPtr())); | 244 weak_ptr_factory_.GetWeakPtr())); |
232 remora_controller_->SetErrorCodeAndMessage(enrollment_error_code_, | 245 remora_controller_->SetErrorCodeAndMessage(enrollment_error_code_, |
233 enrollment_error_string_); | 246 enrollment_error_string_); |
234 remora_controller_->OnEnrollmentStatusChanged( | 247 remora_controller_->OnEnrollmentStatusChanged( |
235 HostPairingController::ENROLLMENT_STATUS_FAILURE); | 248 HostPairingController::ENROLLMENT_STATUS_FAILURE); |
236 } | 249 } |
237 | 250 |
238 } // namespace chromeos | 251 } // namespace chromeos |
OLD | NEW |