Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1052)

Unified Diff: chrome/browser/chromeos/login/screens/host_pairing_screen.cc

Issue 2890383003: Bootstrapping: Send meaningful error code/message from Slave to Master (Closed)
Patch Set: Rebase. Address achuith@'s comments. Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/login/screens/host_pairing_screen.cc
diff --git a/chrome/browser/chromeos/login/screens/host_pairing_screen.cc b/chrome/browser/chromeos/login/screens/host_pairing_screen.cc
index 64b431cb67a3ffce1f09aff849ea50322e469ae2..4575794ccd9be4681f3a5c03b2f7e09652efd1d3 100644
--- a/chrome/browser/chromeos/login/screens/host_pairing_screen.cc
+++ b/chrome/browser/chromeos/login/screens/host_pairing_screen.cc
@@ -11,6 +11,7 @@
#include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h"
#include "chrome/browser/chromeos/policy/enrollment_status_chromeos.h"
#include "components/pairing/host_pairing_controller.h"
+#include "google_apis/gaia/google_service_auth_error.h"
namespace chromeos {
@@ -164,17 +165,29 @@ void HostPairingScreen::OnViewDestroyed(HostPairingScreenView* view) {
void HostPairingScreen::OnAuthError(const GoogleServiceAuthError& error) {
enrollment_error_string_ = view_->GetErrorStringFromAuthError(error);
+ enrollment_error_code_ =
+ std::stoi(std::to_string(static_cast<int>(
achuithb 2017/06/17 00:11:59 As per offline discussion, pull this out into a ut
xdai1 2017/06/19 18:14:59 Done.
+ HostPairingController::ErrorCode::AUTH_ERROR)) +
+ std::to_string(error.state()));
OnAnyEnrollmentError();
}
void HostPairingScreen::OnEnrollmentError(policy::EnrollmentStatus status) {
enrollment_error_string_ = view_->GetErrorStringFromEnrollmentError(status);
+ enrollment_error_code_ =
+ std::stoi(std::to_string(static_cast<int>(
+ HostPairingController::ErrorCode::ENROLL_ERROR)) +
+ std::to_string(status.status()));
OnAnyEnrollmentError();
}
void HostPairingScreen::OnOtherError(
EnterpriseEnrollmentHelper::OtherError error) {
enrollment_error_string_ = view_->GetErrorStringFromOtherError(error);
+ enrollment_error_code_ =
+ std::stoi(std::to_string(static_cast<int>(
+ HostPairingController::ErrorCode::OTHER_ERROR)) +
+ std::to_string(error));
OnAnyEnrollmentError();
}
@@ -204,6 +217,8 @@ void HostPairingScreen::OnAuthCleared() {
void HostPairingScreen::OnAnyEnrollmentError() {
enrollment_helper_->ClearAuth(base::Bind(&HostPairingScreen::OnAuthCleared,
weak_ptr_factory_.GetWeakPtr()));
+ remora_controller_->SetErrorCodeAndMessage(enrollment_error_code_,
+ enrollment_error_string_);
remora_controller_->OnEnrollmentStatusChanged(
HostPairingController::ENROLLMENT_STATUS_FAILURE);
}

Powered by Google App Engine
This is Rietveld 408576698