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 74f1a5e21dc0b26ae2224b6f1a9c5f5c23272bb3..29d2bca6e77ea47c89ccb65cd8da0d8cb52350cf 100644 |
--- a/components/pairing/bluetooth_host_pairing_controller.cc |
+++ b/components/pairing/bluetooth_host_pairing_controller.cc |
@@ -269,9 +269,19 @@ void BluetoothHostPairingController::OnPairDevicesMessage( |
// TODO(zork,achuith): Enroll device, send error on error. |
// (http://crbug.com/374990) |
// For now, test domain is sent in the access token. |
- enrollment_domain_ = message.parameters().admin_access_token(); |
- ChangeStage(STAGE_PAIRING_DONE); |
- SendHostStatus(); |
+ FOR_EACH_OBSERVER(Observer, observers_, |
+ EnrollHost(message.parameters().admin_access_token())); |
+} |
+ |
+void BluetoothHostPairingController::SetEnrollmentComplete(bool success) { |
+ DCHECK_EQ(current_stage_, STAGE_ENROLLING); |
+ DCHECK(thread_checker_.CalledOnValidThread()); |
+ if (success) { |
+ ChangeStage(STAGE_PAIRING_DONE); |
+ SendHostStatus(); |
+ } else { |
+ AbortWithError(PAIRING_ERROR_PAIRING_OR_ENROLLMENT, kErrorEnrollmentFailed); |
+ } |
} |
void BluetoothHostPairingController::OnCompleteSetupMessage( |