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

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: . Created 3 years, 7 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 454a12352227911ef69a31e6010895188b732bb4..2e317284c69dba45c766fe49ab90f975d3a4c37e 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 {
@@ -159,17 +160,26 @@ 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(HostPairingController::AUTH_ERROR) +
achuithb 2017/05/25 19:25:53 What's going on here?
achuithb 2017/05/25 19:27:34 I think I understand. Can't we multiply the prefi
xdai1 2017/06/08 22:18:40 Added comments in the definition in the header fil
+ 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(HostPairingController::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(HostPairingController::OTHER_ERROR) +
+ std::to_string(error));
OnAnyEnrollmentError();
}
@@ -199,6 +209,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