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

Unified Diff: components/pairing/bluetooth_host_pairing_controller.cc

Issue 555003002: Add method for telling the Pairing API that enrollment is complete (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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: 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(
« no previous file with comments | « components/pairing/bluetooth_host_pairing_controller.h ('k') | components/pairing/bluetooth_pairing_constants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698