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

Unified Diff: components/proximity_auth/bluetooth_connection.cc

Issue 652403002: [Clean up] Expose ConnectToServiceInsecurely as a BluetoothDevice API on all platforms. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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/proximity_auth/bluetooth_connection.cc
diff --git a/components/proximity_auth/bluetooth_connection.cc b/components/proximity_auth/bluetooth_connection.cc
index fdc7103219096d24372cc73747949a532a922bd2..fb604e252b918ebbfd0f974dd6aeed38166e3288 100644
--- a/components/proximity_auth/bluetooth_connection.cc
+++ b/components/proximity_auth/bluetooth_connection.cc
@@ -7,7 +7,6 @@
#include "base/bind.h"
#include "base/message_loop/message_loop.h"
#include "base/numerics/safe_conversions.h"
-#include "components/proximity_auth/bluetooth_util.h"
#include "components/proximity_auth/remote_device.h"
#include "components/proximity_auth/wire_message.h"
#include "device/bluetooth/bluetooth_adapter_factory.h"
@@ -96,16 +95,6 @@ void BluetoothConnection::DeviceRemoved(device::BluetoothAdapter* adapter,
Disconnect();
}
-void BluetoothConnection::ConnectToService(
- device::BluetoothDevice* device,
- const device::BluetoothUUID& uuid,
- const device::BluetoothDevice::ConnectToServiceCallback& callback,
- const device::BluetoothDevice::ConnectToServiceErrorCallback&
- error_callback) {
- bluetooth_util::ConnectToServiceInsecurely(
- device, uuid, callback, error_callback);
-}
-
void BluetoothConnection::StartReceive() {
base::WeakPtr<BluetoothConnection> weak_this = weak_ptr_factory_.GetWeakPtr();
socket_->Receive(kReceiveBufferSizeBytes,
@@ -128,8 +117,7 @@ void BluetoothConnection::OnAdapterInitialized(
adapter_->AddObserver(this);
base::WeakPtr<BluetoothConnection> weak_this = weak_ptr_factory_.GetWeakPtr();
- ConnectToService(
- bluetooth_device,
+ bluetooth_device->ConnectToServiceInsecurely(
uuid_,
base::Bind(&BluetoothConnection::OnConnected, weak_this),
base::Bind(&BluetoothConnection::OnConnectionError, weak_this));

Powered by Google App Engine
This is Rietveld 408576698