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

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

Issue 2353133005: Add the chrome.bluetoothLowEnergy.setAdvertisingInterval API. (Closed)
Patch Set: . Created 4 years, 3 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 277a5fb575e75016019aa7f89dbd5c5cd478f9a6..9743dd21206aea77f9b578cee3fc38328bd575c0 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
@@ -5,6 +5,7 @@
#ifndef CHROME_BROWSER_EXTENSIONS_API_BLUETOOTH_LOW_ENERGY_BLUETOOTH_LOW_ENERGY_API_H_
#define CHROME_BROWSER_EXTENSIONS_API_BLUETOOTH_LOW_ENERGY_BLUETOOTH_LOW_ENERGY_API_H_
+#include <memory>
#include <string>
#include "base/macros.h"
@@ -464,9 +465,6 @@ class BluetoothLowEnergyRegisterAdvertisementFunction
private:
void SuccessCallback(scoped_refptr<device::BluetoothAdvertisement>);
void ErrorCallback(device::BluetoothAdvertisement::ErrorCode status);
-
- // The instance ID of the requested descriptor.
- std::string instance_id_;
};
class BluetoothLowEnergyUnregisterAdvertisementFunction
@@ -485,9 +483,25 @@ class BluetoothLowEnergyUnregisterAdvertisementFunction
void SuccessCallback(int advertisement_id);
void ErrorCallback(int advertisement_id,
device::BluetoothAdvertisement::ErrorCode status);
+};
- // The instance ID of the requested descriptor.
- std::string instance_id_;
+class BluetoothLowEnergySetAdvertisingIntervalFunction
+ : public BLEPeripheralExtensionFunction<
+ extensions::api::bluetooth_low_energy::SetAdvertisingInterval::
+ Params> {
+ public:
+ DECLARE_EXTENSION_FUNCTION("bluetoothLowEnergy.setAdvertisingInterval",
+ BLUETOOTHLOWENERGY_SETADVERTISINGINTERVAL);
+
+ protected:
+ ~BluetoothLowEnergySetAdvertisingIntervalFunction() override {}
+
+ // BluetoothLowEnergyExtensionFunctionDeprecated override.
+ void DoWork() override;
+
+ private:
+ void SuccessCallback();
+ void ErrorCallback(device::BluetoothAdvertisement::ErrorCode status);
};
class BluetoothLowEnergyCreateServiceFunction

Powered by Google App Engine
This is Rietveld 408576698