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

Unified Diff: chrome/browser/chromeos/bluetooth/bluetooth_adapter.cc

Issue 10546010: Implement support for the OOB Pairing APIs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 6 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: 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) {
« no previous file with comments | « chrome/browser/chromeos/bluetooth/bluetooth_adapter.h ('k') | chrome/browser/chromeos/bluetooth/bluetooth_device.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698