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

Unified Diff: chrome/browser/extensions/api/bluetooth_low_energy/bluetooth_low_energy_api.h

Issue 349433002: chrome.bluetoothLowEnergy: Introduce connect and disconnect methods. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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/extensions/api/bluetooth_low_energy/bluetooth_low_energy_api.h
diff --git a/chrome/browser/extensions/api/bluetooth_low_energy/bluetooth_low_energy_api.h b/chrome/browser/extensions/api/bluetooth_low_energy/bluetooth_low_energy_api.h
index 48e8f1348089daea52bd36bc62404dbbad65d170..a807ea7fbac3977c0a7ae9d65411e36ece043a83 100644
--- a/chrome/browser/extensions/api/bluetooth_low_energy/bluetooth_low_energy_api.h
+++ b/chrome/browser/extensions/api/bluetooth_low_energy/bluetooth_low_energy_api.h
@@ -74,6 +74,43 @@ class BluetoothLowEnergyExtensionFunction : public AsyncExtensionFunction {
DISALLOW_COPY_AND_ASSIGN(BluetoothLowEnergyExtensionFunction);
};
+class BluetoothLowEnergyConnectFunction
+ : public BluetoothLowEnergyExtensionFunction {
+ public:
+ DECLARE_EXTENSION_FUNCTION("bluetoothLowEnergy.connect",
+ BLUETOOTHLOWENERGY_CONNECT);
+
+ protected:
+ virtual ~BluetoothLowEnergyConnectFunction() {}
+
+ // BluetoothLowEnergyExtensionFunction override.
+ virtual bool DoWork() OVERRIDE;
+
+ private:
+ // Success and error callbacks, called by
+ // BluetoothLowEnergyEventRouter::Connect.
+ void SuccessCallback();
+ void ErrorCallback(BluetoothLowEnergyEventRouter::Status status);
+};
+
+class BluetoothLowEnergyDisconnectFunction
+ : public BluetoothLowEnergyExtensionFunction {
+ public:
+ DECLARE_EXTENSION_FUNCTION("bluetoothLowEnergy.disconnect",
+ BLUETOOTHLOWENERGY_DISCONNECT);
+
+ protected:
+ virtual ~BluetoothLowEnergyDisconnectFunction() {}
+
+ // BluetoothLowEnergyExtensionFunction override.
+ virtual bool DoWork() OVERRIDE;
+
+ private:
+ // Callback called by BluetoothLowEnergyEventRouter::Disconnect when the
+ // operation has completed.
+ void SuccessCallback();
+};
+
class BluetoothLowEnergyGetServiceFunction
: public BluetoothLowEnergyExtensionFunction {
public:

Powered by Google App Engine
This is Rietveld 408576698