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

Unified Diff: components/pairing/bluetooth_host_pairing_controller.cc

Issue 1535573002: 1) Add initialization error page; 2) Add connection error page. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: We don't need to set enrollment related local state for a host device since Enrollment Screen doesn… Created 5 years 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: components/pairing/bluetooth_host_pairing_controller.cc
diff --git a/components/pairing/bluetooth_host_pairing_controller.cc b/components/pairing/bluetooth_host_pairing_controller.cc
index 37e4854239b87c7a8199820c9ca0c6cf5d01050c..4a0e6fe907f61c91029985816209a4c6b4220268 100644
--- a/components/pairing/bluetooth_host_pairing_controller.cc
+++ b/components/pairing/bluetooth_host_pairing_controller.cc
@@ -308,17 +308,23 @@ void BluetoothHostPairingController::OnSetError() {
void BluetoothHostPairingController::OnAcceptError(
const std::string& error_message) {
LOG(ERROR) << error_message;
+ ChangeStage(STAGE_CONTROLLER_CONNECTION_ERROR);
}
void BluetoothHostPairingController::OnSendError(
const std::string& error_message) {
LOG(ERROR) << error_message;
+ if (enrollment_status_ != ENROLLMENT_STATUS_ENROLLING &&
+ enrollment_status_ != ENROLLMENT_STATUS_SUCCESS) {
+ ChangeStage(STAGE_CONTROLLER_CONNECTION_ERROR);
+ }
}
void BluetoothHostPairingController::OnReceiveError(
device::BluetoothSocket::ErrorReason reason,
const std::string& error_message) {
LOG(ERROR) << reason << ", " << error_message;
+ ChangeStage(STAGE_CONTROLLER_CONNECTION_ERROR);
}
void BluetoothHostPairingController::OnHostStatusMessage(
@@ -352,6 +358,7 @@ void BluetoothHostPairingController::OnCompleteSetupMessage(
const pairing_api::CompleteSetup& message) {
DCHECK(thread_checker_.CalledOnValidThread());
if (current_stage_ != STAGE_ENROLLMENT_SUCCESS) {
+ ChangeStage(STAGE_ENROLLMENT_ERROR);
AbortWithError(PAIRING_ERROR_PAIRING_OR_ENROLLMENT, kErrorInvalidProtocol);
return;
}
« no previous file with comments | « chrome/browser/ui/webui/chromeos/login/host_pairing_screen_handler.cc ('k') | components/pairing/host_pairing_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698