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

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: refactor to create BluetoothOutOfBandClient 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..8d7acb2aaad5daf6d6a55c666bffa66c523bdcb4 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"
@@ -251,7 +252,6 @@ void BluetoothAdapter::AdapterPropertyChanged(
} else if (property_name == properties->devices.name()) {
DevicesChanged(properties->devices.value());
-
keybuk 2012/06/08 20:06:39 why removed?
bryeung 2012/06/14 15:31:07 not sure how that happened, fixed
}
}
@@ -276,7 +276,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 +333,32 @@ const BluetoothDevice* BluetoothAdapter::GetDevice(
return NULL;
}
+void BluetoothAdapter::ReadLocalOutOfBandPairingData(
+ const BluetoothOutOfBandClient::DataCallback& callback) const {
+ DBusThreadManager::Get()->GetBluetoothOutOfBandClient()->
+ ReadLocalData(object_path_, callback);
+}
+
+void BluetoothAdapter::SetOutOfBandPairingData(const std::string& address,
+ const chromeos::BluetoothOutOfBandPairingData& data,
+ const chromeos::BluetoothOutOfBandClient::SuccessCallback& callback) {
+ DBusThreadManager::Get()->GetBluetoothOutOfBandClient()->
+ AddRemoteData(
+ object_path_,
+ address,
+ data,
+ callback);
+}
+
+void BluetoothAdapter::ClearOutOfBandPairingData(const std::string& address,
+ const chromeos::BluetoothOutOfBandClient::SuccessCallback& callback) {
+ DBusThreadManager::Get()->GetBluetoothOutOfBandClient()->
+ RemoveRemoteData(
+ object_path_,
+ address,
+ callback);
+}
+
void BluetoothAdapter::ClearDevices() {
for (DevicesMap::iterator iter = devices_.begin();
iter != devices_.end(); ++iter) {

Powered by Google App Engine
This is Rietveld 408576698