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

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

Issue 2861533004: Implement chrome.bluetoothLowEnergy.resetAdvertising(). (Closed)
Patch Set: Implement chrome.bluetoothLowEnergy.resetAllAdvertisements(). Created 3 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: extensions/browser/api/bluetooth_low_energy/bluetooth_low_energy_api.h
diff --git a/extensions/browser/api/bluetooth_low_energy/bluetooth_low_energy_api.h b/extensions/browser/api/bluetooth_low_energy/bluetooth_low_energy_api.h
index b56d3bfd055301432f683cc5b4a21905300b4e4c..26c3303df356965b057e2a957f0b9dd999754200 100644
--- a/extensions/browser/api/bluetooth_low_energy/bluetooth_low_energy_api.h
+++ b/extensions/browser/api/bluetooth_low_energy/bluetooth_low_energy_api.h
@@ -438,6 +438,7 @@ class BluetoothLowEnergyAdvertisementFunction
int AddAdvertisement(BluetoothApiAdvertisement* advertisement);
BluetoothApiAdvertisement* GetAdvertisement(int advertisement_id);
void RemoveAdvertisement(int advertisement_id);
+ const base::hash_set<int>* GetAdvertisementIds();
// ExtensionFunction override.
bool RunAsync() override;
@@ -485,6 +486,23 @@ class BluetoothLowEnergyUnregisterAdvertisementFunction
device::BluetoothAdvertisement::ErrorCode status);
};
+class BluetoothLowEnergyResetAdvertisingFunction
+ : public BluetoothLowEnergyAdvertisementFunction {
+ public:
+ DECLARE_EXTENSION_FUNCTION("bluetoothLowEnergy.resetAdvertising",
+ BLUETOOTHLOWENERGY_RESETADVERTISING);
+
+ protected:
+ ~BluetoothLowEnergyResetAdvertisingFunction() override {}
+
+ // BluetoothLowEnergyExtensionFunctionDeprecated override.
+ bool DoWork() override;
+
+ private:
+ void SuccessCallback();
+ void ErrorCallback(device::BluetoothAdvertisement::ErrorCode status);
+};
+
class BluetoothLowEnergySetAdvertisingIntervalFunction
: public BLEPeripheralExtensionFunction<
extensions::api::bluetooth_low_energy::SetAdvertisingInterval::

Powered by Google App Engine
This is Rietveld 408576698