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

Unified Diff: chrome/browser/chromeos/login/wizard_controller.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/wizard_controller.cc
diff --git a/chrome/browser/chromeos/login/wizard_controller.cc b/chrome/browser/chromeos/login/wizard_controller.cc
index 4470346a3ee793660ea4bacd61a0ac1b0d738cda..eadd4b2b8dee03da0928c4ff6bf94410599aca9e 100644
--- a/chrome/browser/chromeos/login/wizard_controller.cc
+++ b/chrome/browser/chromeos/login/wizard_controller.cc
@@ -15,6 +15,7 @@
#include "base/bind.h"
#include "base/callback_helpers.h"
#include "base/command_line.h"
+#include "base/json/json_string_value_serializer.h"
#include "base/location.h"
#include "base/logging.h"
#include "base/macros.h"
@@ -1277,7 +1278,8 @@ void WizardController::AddNetworkRequested(const std::string& onc_spec) {
if (NetworkAllowUpdate(network_state)) {
network_screen->CreateAndConnectNetworkFromOnc(
- onc_spec, base::Bind(&base::DoNothing), base::Bind(&base::DoNothing));
+ onc_spec, base::Bind(&base::DoNothing),
+ network_handler::ErrorCallback());
} else {
network_screen->CreateAndConnectNetworkFromOnc(
onc_spec, base::Bind(&WizardController::OnSetHostNetworkSuccessful,
@@ -1525,7 +1527,19 @@ void WizardController::OnSetHostNetworkSuccessful() {
InitiateOOBEUpdate();
}
-void WizardController::OnSetHostNetworkFailed() {
+void WizardController::OnSetHostNetworkFailed(
+ const std::string& error_name,
+ std::unique_ptr<base::DictionaryValue> error_data) {
+ std::string error_message;
+ JSONStringValueSerializer serializer(&error_message);
+ serializer.Serialize(*error_data);
+ error_message = error_name + ": " + error_message;
+
+ remora_controller_->SetErrorCodeAndMessage(
+ static_cast<int>(
+ pairing_chromeos::HostPairingController::ErrorCode::NETWORK_ERROR),
+ error_message);
+
remora_controller_->OnNetworkConnectivityChanged(
pairing_chromeos::HostPairingController::CONNECTIVITY_NONE);
}

Powered by Google App Engine
This is Rietveld 408576698