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

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: 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 2ffd17f0dd2d6922ce7e9a5b682b6eb5a80c2523..a3be3fab660ab8e883d440f84d7f4f8db9b21b2c 100644
--- a/chrome/browser/chromeos/bluetooth/bluetooth_adapter.cc
+++ b/chrome/browser/chromeos/bluetooth/bluetooth_adapter.cc
@@ -76,6 +76,13 @@ void BluetoothAdapter::AdapterCallback(const dbus::ObjectPath& adapter_path,
}
}
+void BluetoothAdapter::AdapterCallbackToResultCallback(
+ const ResultCallback& callback,
+ const dbus::ObjectPath& adapter_path,
+ bool success) {
+ callback.Run(success);
+}
+
void BluetoothAdapter::DefaultAdapterChanged(
const dbus::ObjectPath& adapter_path) {
if (track_default_)
@@ -251,7 +258,6 @@ void BluetoothAdapter::AdapterPropertyChanged(
} else if (property_name == properties->devices.name()) {
DevicesChanged(properties->devices.value());
-
}
}
@@ -276,7 +282,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())
@@ -333,6 +339,34 @@ const BluetoothDevice* BluetoothAdapter::GetDevice(
return NULL;
}
+void BluetoothAdapter::ReadLocalOutOfBandPairingData(
+ const OutOfBandPairingDataCallback& callback) const {
+ DBusThreadManager::Get()->GetBluetoothAdapterClient()->
+ ReadLocalOutOfBandPairingData(object_path_, callback);
+}
+
+void BluetoothAdapter::SetOutOfBandPairingData(const std::string& address,
+ const chromeos::OutOfBandPairingData& data,
+ const ResultCallback& callback) {
+ DBusThreadManager::Get()->GetBluetoothAdapterClient()->
+ AddRemoteOutOfBandPairingData(
+ object_path_,
+ address,
+ data,
+ base::Bind(&BluetoothAdapter::AdapterCallbackToResultCallback,
+ weak_ptr_factory_.GetWeakPtr(), callback));
+}
+
+void BluetoothAdapter::ClearOutOfBandPairingData(const std::string& address,
+ const ResultCallback& callback) {
+ DBusThreadManager::Get()->GetBluetoothAdapterClient()->
+ RemoveRemoteOutOfBandPairingData(
+ object_path_,
+ address,
+ base::Bind(&BluetoothAdapter::AdapterCallbackToResultCallback,
+ weak_ptr_factory_.GetWeakPtr(), callback));
+}
+
void BluetoothAdapter::ClearDevices() {
for (DevicesMap::iterator iter = devices_.begin();
iter != devices_.end(); ++iter) {

Powered by Google App Engine
This is Rietveld 408576698