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

Unified Diff: chrome/browser/chromeos/bluetooth/bluetooth_device.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_device.cc
diff --git a/chrome/browser/chromeos/bluetooth/bluetooth_device.cc b/chrome/browser/chromeos/bluetooth/bluetooth_device.cc
index 0f42e73a58c9a64bf80cb8484b9207da901aaa6c..3c2e120eb8d7eedea1bbb8dbf65ca91921d2b9a1 100644
--- a/chrome/browser/chromeos/bluetooth/bluetooth_device.cc
+++ b/chrome/browser/chromeos/bluetooth/bluetooth_device.cc
@@ -22,6 +22,7 @@
#include "chromeos/dbus/bluetooth_agent_service_provider.h"
#include "chromeos/dbus/bluetooth_device_client.h"
#include "chromeos/dbus/bluetooth_input_client.h"
+#include "chromeos/dbus/bluetooth_out_of_band_client.h"
#include "chromeos/dbus/dbus_thread_manager.h"
#include "chromeos/dbus/introspectable_client.h"
#include "dbus/bus.h"
@@ -551,6 +552,15 @@ void BluetoothDevice::ConnectToMatchingService(
callback.Run(NULL);
}
+void BluetoothDevice::OnRemoteDataCallback(const base::Closure& callback,
+ const ErrorCallback& error_callback,
+ bool success) {
+ if (success)
+ callback.Run();
+ else
+ error_callback.Run();
+}
+
void BluetoothDevice::ConnectToService(const std::string& service_uuid,
const SocketCallback& callback) {
DBusThreadManager::Get()->GetBluetoothDeviceClient()->
@@ -563,6 +573,34 @@ void BluetoothDevice::ConnectToService(const std::string& service_uuid,
callback));
}
+void BluetoothDevice::SetOutOfBandPairingData(
+ const chromeos::BluetoothOutOfBandPairingData& data,
+ const base::Closure& callback,
+ const ErrorCallback& error_callback) {
+ DBusThreadManager::Get()->GetBluetoothOutOfBandClient()->
+ AddRemoteData(
+ object_path_,
+ address(),
+ data,
+ base::Bind(&BluetoothDevice::OnRemoteDataCallback,
+ weak_ptr_factory_.GetWeakPtr(),
+ callback,
+ error_callback));
+}
+
+void BluetoothDevice::ClearOutOfBandPairingData(
+ const base::Closure& callback,
+ const ErrorCallback& error_callback) {
+ DBusThreadManager::Get()->GetBluetoothOutOfBandClient()->
+ RemoveRemoteData(
+ object_path_,
+ address(),
+ base::Bind(&BluetoothDevice::OnRemoteDataCallback,
+ weak_ptr_factory_.GetWeakPtr(),
+ callback,
+ error_callback));
+}
+
void BluetoothDevice::ForgetCallback(const ErrorCallback& error_callback,
const dbus::ObjectPath& adapter_path,
bool success) {
« no previous file with comments | « chrome/browser/chromeos/bluetooth/bluetooth_device.h ('k') | chrome/browser/chromeos/bluetooth/test/mock_bluetooth_adapter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698