| Index: components/proximity_auth/bluetooth_connection_finder.cc
|
| diff --git a/components/proximity_auth/bluetooth_connection_finder.cc b/components/proximity_auth/bluetooth_connection_finder.cc
|
| index 39f240fe7127dc6c17e760595f213b018be999d8..8429eb900b027d8277e3663e403dc8e266517b64 100644
|
| --- a/components/proximity_auth/bluetooth_connection_finder.cc
|
| +++ b/components/proximity_auth/bluetooth_connection_finder.cc
|
| @@ -11,6 +11,7 @@
|
| #include "base/logging.h"
|
| #include "base/single_thread_task_runner.h"
|
| #include "base/threading/thread_task_runner_handle.h"
|
| +#include "components/cryptauth/connection.h"
|
| #include "components/proximity_auth/bluetooth_connection.h"
|
| #include "components/proximity_auth/logging/logging.h"
|
| #include "device/bluetooth/bluetooth_adapter_factory.h"
|
| @@ -50,8 +51,9 @@ void BluetoothConnectionFinder::Find(
|
| weak_ptr_factory_.GetWeakPtr()));
|
| }
|
|
|
| -std::unique_ptr<Connection> BluetoothConnectionFinder::CreateConnection() {
|
| - return std::unique_ptr<Connection>(
|
| +std::unique_ptr<cryptauth::Connection>
|
| +BluetoothConnectionFinder::CreateConnection() {
|
| + return std::unique_ptr<cryptauth::Connection>(
|
| new BluetoothConnection(remote_device_, uuid_));
|
| }
|
|
|
| @@ -84,7 +86,8 @@ void BluetoothConnectionFinder::PollIfReady() {
|
|
|
| // If the |connection_| is pending, wait for it to connect or fail prior to
|
| // polling again.
|
| - if (connection_ && connection_->status() != Connection::DISCONNECTED)
|
| + if (connection_ &&
|
| + connection_->status() != cryptauth::Connection::DISCONNECTED)
|
| return;
|
|
|
| // This SeekDeviceByAddress operation is needed to connect to a device if
|
| @@ -174,9 +177,9 @@ void BluetoothConnectionFinder::AdapterPoweredChanged(BluetoothAdapter* adapter,
|
| }
|
|
|
| void BluetoothConnectionFinder::OnConnectionStatusChanged(
|
| - Connection* connection,
|
| - Connection::Status old_status,
|
| - Connection::Status new_status) {
|
| + cryptauth::Connection* connection,
|
| + cryptauth::Connection::Status old_status,
|
| + cryptauth::Connection::Status new_status) {
|
| DCHECK_EQ(connection, connection_.get());
|
|
|
| if (connection_->IsConnected()) {
|
| @@ -186,13 +189,14 @@ void BluetoothConnectionFinder::OnConnectionStatusChanged(
|
| UnregisterAsObserver();
|
|
|
| // If we invoke the callback now, the callback function may install its own
|
| - // observer to |connection_|. Because we are in the ConnectionObserver
|
| + // observer to |connection_|. Because we are in the
|
| + // cryptauth::ConnectionObserver
|
| // callstack, this new observer will receive this connection event.
|
| // Therefore, we need to invoke the callback asynchronously.
|
| base::ThreadTaskRunnerHandle::Get()->PostTask(
|
| FROM_HERE, base::Bind(&BluetoothConnectionFinder::InvokeCallbackAsync,
|
| weak_ptr_factory_.GetWeakPtr()));
|
| - } else if (old_status == Connection::IN_PROGRESS) {
|
| + } else if (old_status == cryptauth::Connection::IN_PROGRESS) {
|
| PA_LOG(WARNING)
|
| << "Connection failed! Scheduling another polling iteration.";
|
| PostDelayedPoll();
|
|
|