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

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

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.h
diff --git a/chrome/browser/chromeos/bluetooth/bluetooth_adapter.h b/chrome/browser/chromeos/bluetooth/bluetooth_adapter.h
index e61768a080df197169927746c113f33e6d0366ec..f6337c3725e53d71d900b1b5c56a4b648e374f41 100644
--- a/chrome/browser/chromeos/bluetooth/bluetooth_adapter.h
+++ b/chrome/browser/chromeos/bluetooth/bluetooth_adapter.h
@@ -16,6 +16,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_pairing_data.h"
#include "dbus/object_path.h"
namespace chromeos {
@@ -91,6 +92,10 @@ class BluetoothAdapter : private BluetoothManagerClient::Observer,
// is called, in the success case the callback is simply not called.
typedef base::Callback<void()> ErrorCallback;
+ // The ResultCallback is used for methods that return a boolean value
+ // indicating success (true) or failure (false).
+ typedef base::Callback<void(bool result)> ResultCallback;
+
// The address of this adapter. The address format is "XX:XX:XX:XX:XX:XX",
// where each XX is a hexadecimal number.
const std::string& address() const { return address_; }
@@ -131,6 +136,19 @@ class BluetoothAdapter : private BluetoothManagerClient::Observer,
BluetoothDevice* GetDevice(const std::string& address);
const BluetoothDevice* GetDevice(const std::string& address) const;
+ // Requests the local Out Of Band pairing data.
+ virtual void ReadLocalOutOfBandPairingData(
+ const OutOfBandPairingDataCallback& callback) const;
+
+ // Sets the Out Of Band pairing data for the device at |address| to |data|.
+ void SetOutOfBandPairingData(const std::string& address,
+ const chromeos::OutOfBandPairingData& data,
+ const ResultCallback& callback);
+
+ // Clears the Out Of Band pairing data for the device at |address|.
+ virtual void ClearOutOfBandPairingData(const std::string& address,
+ const ResultCallback& callback);
+
// Creates the instance for the default adapter, whichever that may
// be at the time. Use IsPresent() and the AdapterPresentChanged() observer
// method to determine whether an adapter is actually available or not.
@@ -160,6 +178,13 @@ class BluetoothAdapter : private BluetoothManagerClient::Observer,
// dbus object path of the requested adapter when |success| is true.
void AdapterCallback(const dbus::ObjectPath& adapter_path, bool success);
+ // Translates from an AdapterCallback to a ResultCallback, by ignoring the
+ // |adapter_path| and passing |success| on to |callback|.
+ void AdapterCallbackToResultCallback(
+ const ResultCallback& callback,
+ const dbus::ObjectPath& adapter_path,
+ bool success);
+
// BluetoothManagerClient::Observer override.
//
// Called when the default local bluetooth adapter changes.
« no previous file with comments | « no previous file | chrome/browser/chromeos/bluetooth/bluetooth_adapter.cc » ('j') | chromeos/dbus/bluetooth_adapter_client.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698