Index: chrome/browser/chromeos/bluetooth/bluetooth_adapter.cc |
diff --git a/chrome/browser/chromeos/bluetooth/bluetooth_adapter.cc b/chrome/browser/chromeos/bluetooth/bluetooth_adapter.cc |
index 5088b00c0ff4ad1100642cbaf2a5faf2f2a03c5f..218f45717bde2055fdd90a698f3628d6ea39522c 100644 |
--- a/chrome/browser/chromeos/bluetooth/bluetooth_adapter.cc |
+++ b/chrome/browser/chromeos/bluetooth/bluetooth_adapter.cc |
@@ -12,6 +12,7 @@ |
#include "chromeos/dbus/bluetooth_adapter_client.h" |
#include "chromeos/dbus/bluetooth_device_client.h" |
#include "chromeos/dbus/bluetooth_manager_client.h" |
+#include "chromeos/dbus/bluetooth_out_of_band_client.h" |
#include "chromeos/dbus/dbus_thread_manager.h" |
#include "dbus/object_path.h" |
@@ -246,6 +247,17 @@ void BluetoothAdapter::DiscoveringChanged(bool discovering) { |
AdapterDiscoveringChanged(this, discovering_)); |
} |
+void BluetoothAdapter::OnReadLocalData( |
+ const BluetoothOutOfBandPairingDataCallback& callback, |
+ const ErrorCallback& error_callback, |
+ const BluetoothOutOfBandPairingData& data, |
+ bool success) { |
+ if (success) |
+ callback.Run(data); |
+ else |
+ error_callback.Run(); |
+} |
+ |
void BluetoothAdapter::AdapterPropertyChanged( |
const dbus::ObjectPath& adapter_path, |
const std::string& property_name) { |
@@ -289,7 +301,7 @@ void BluetoothAdapter::UpdateDevice(const dbus::ObjectPath& device_path) { |
// or it may be the device going from discovered to connected and gaining |
// an object path. Update the existing object and notify observers. |
DevicesMap::iterator iter = devices_.find(address); |
- if (iter != devices_.end()){ |
+ if (iter != devices_.end()) { |
BluetoothDevice* device = iter->second; |
if (!device->IsPaired()) |
@@ -346,6 +358,17 @@ const BluetoothDevice* BluetoothAdapter::GetDevice( |
return NULL; |
} |
+void BluetoothAdapter::ReadLocalOutOfBandPairingData( |
+ const BluetoothOutOfBandPairingDataCallback& callback, |
+ const ErrorCallback& error_callback) { |
+ DBusThreadManager::Get()->GetBluetoothOutOfBandClient()-> |
+ ReadLocalData(object_path_, |
+ base::Bind(&BluetoothAdapter::OnReadLocalData, |
+ weak_ptr_factory_.GetWeakPtr(), |
+ callback, |
+ error_callback)); |
+} |
+ |
void BluetoothAdapter::ClearDevices() { |
for (DevicesMap::iterator iter = devices_.begin(); |
iter != devices_.end(); ++iter) { |