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

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: Rebase: Restore deps rather than public_deps 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 d5a2b653101ebbb1d4ca2619a3dc16b8f538d2a2..435793eeab2b752f8110770ab3707ea861274282 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,
@@ -130,8 +119,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));
« no previous file with comments | « components/proximity_auth/bluetooth_connection.h ('k') | components/proximity_auth/bluetooth_connection_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698