Index: device/bluetooth/bluetooth_device_chromeos.cc |
diff --git a/device/bluetooth/bluetooth_device_chromeos.cc b/device/bluetooth/bluetooth_device_chromeos.cc |
index f668e9a5855bda582e3bb8297240961d898a94b0..a3c53ac492e2babe280effb61d7323433951e85c 100644 |
--- a/device/bluetooth/bluetooth_device_chromeos.cc |
+++ b/device/bluetooth/bluetooth_device_chromeos.cc |
@@ -19,7 +19,6 @@ |
#include "dbus/bus.h" |
#include "device/bluetooth/bluetooth_adapter_chromeos.h" |
#include "device/bluetooth/bluetooth_pairing_chromeos.h" |
-#include "device/bluetooth/bluetooth_profile_chromeos.h" |
#include "device/bluetooth/bluetooth_remote_gatt_service_chromeos.h" |
#include "device/bluetooth/bluetooth_socket.h" |
#include "device/bluetooth/bluetooth_socket_chromeos.h" |
@@ -426,7 +425,7 @@ void BluetoothDeviceChromeOS::Forget(const ErrorCallback& error_callback) { |
VLOG(1) << object_path_.value() << ": Removing device"; |
DBusThreadManager::Get()->GetBluetoothAdapterClient()-> |
RemoveDevice( |
- adapter_->object_path_, |
+ adapter_->object_path(), |
object_path_, |
base::Bind(&base::DoNothing), |
base::Bind(&BluetoothDeviceChromeOS::OnForgetError, |
@@ -438,32 +437,25 @@ void BluetoothDeviceChromeOS::ConnectToProfile( |
device::BluetoothProfile* profile, |
const base::Closure& callback, |
const ConnectToProfileErrorCallback& error_callback) { |
- BluetoothProfileChromeOS* profile_chromeos = |
- static_cast<BluetoothProfileChromeOS*>(profile); |
- VLOG(1) << object_path_.value() << ": Connecting profile: " |
- << profile_chromeos->uuid().canonical_value(); |
- DBusThreadManager::Get()->GetBluetoothDeviceClient()-> |
- ConnectProfile( |
- object_path_, |
- profile_chromeos->uuid().canonical_value(), |
- base::Bind( |
- &BluetoothDeviceChromeOS::OnConnectProfile, |
- weak_ptr_factory_.GetWeakPtr(), |
- profile, |
- callback), |
- base::Bind( |
- &BluetoothDeviceChromeOS::OnConnectProfileError, |
- weak_ptr_factory_.GetWeakPtr(), |
- profile, |
- error_callback)); |
+ // TODO(keybuK): Remove. |
+ error_callback.Run("Removed. Use chrome.bluetoothSocket.connect() instead."); |
armansito
2014/05/13 19:44:59
Does it make sense to refer to the JS API in an er
keybuk
2014/05/13 20:03:53
Since the only thing using this method is the JS A
|
} |
void BluetoothDeviceChromeOS::ConnectToService( |
const BluetoothUUID& uuid, |
const ConnectToServiceCallback& callback, |
const ConnectToServiceErrorCallback& error_callback) { |
- // TODO(keybuk): implement |
- NOTIMPLEMENTED(); |
+ VLOG(1) << object_path_.value() << ": Connecting to service: " |
+ << uuid.canonical_value(); |
+ scoped_refptr<BluetoothSocketChromeOS> socket = |
+ BluetoothSocketChromeOS::CreateBluetoothSocket( |
+ ui_task_runner_, |
+ socket_thread_, |
+ NULL, |
+ net::NetLog::Source()); |
+ socket->Connect(this, uuid, |
+ base::Bind(callback, socket), |
+ error_callback); |
} |
void BluetoothDeviceChromeOS::SetOutOfBandPairingData( |
@@ -729,27 +721,4 @@ void BluetoothDeviceChromeOS::OnForgetError( |
error_callback.Run(); |
} |
-void BluetoothDeviceChromeOS::OnConnectProfile( |
- device::BluetoothProfile* profile, |
- const base::Closure& callback) { |
- BluetoothProfileChromeOS* profile_chromeos = |
- static_cast<BluetoothProfileChromeOS*>(profile); |
- VLOG(1) << object_path_.value() << ": Profile connected: " |
- << profile_chromeos->uuid().canonical_value(); |
- callback.Run(); |
-} |
- |
-void BluetoothDeviceChromeOS::OnConnectProfileError( |
- device::BluetoothProfile* profile, |
- const ConnectToProfileErrorCallback& error_callback, |
- const std::string& error_name, |
- const std::string& error_message) { |
- BluetoothProfileChromeOS* profile_chromeos = |
- static_cast<BluetoothProfileChromeOS*>(profile); |
- VLOG(1) << object_path_.value() << ": Profile connection failed: " |
- << profile_chromeos->uuid().canonical_value() << ": " |
- << error_name << ": " << error_message; |
- error_callback.Run(error_message); |
-} |
- |
} // namespace chromeos |