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

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: Clear the enrollment related local state when the enrollment succeeds or an error occurs. 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..394f27185ed88f2544028d608a30eaf7497e7315 100644
--- a/components/pairing/bluetooth_host_pairing_controller.cc
+++ b/components/pairing/bluetooth_host_pairing_controller.cc
@@ -308,17 +308,20 @@ 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;
+ ChangeStage(STAGE_CONTROLLER_CONNECTION_ERROR);
dzhioev (left Google) 2015/12/17 23:33:32 I don't think we should call this if |enrollment_s
xdai1 2015/12/17 23:49:08 Agreed. Addressed your comment.
}
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 +355,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;
}

Powered by Google App Engine
This is Rietveld 408576698