| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef EXTENSIONS_BROWSER_API_BLUETOOTH_LOW_ENERGY_BLUETOOTH_LOW_ENERGY_API_H_ | 5 #ifndef EXTENSIONS_BROWSER_API_BLUETOOTH_LOW_ENERGY_BLUETOOTH_LOW_ENERGY_API_H_ |
| 6 #define EXTENSIONS_BROWSER_API_BLUETOOTH_LOW_ENERGY_BLUETOOTH_LOW_ENERGY_API_H_ | 6 #define EXTENSIONS_BROWSER_API_BLUETOOTH_LOW_ENERGY_BLUETOOTH_LOW_ENERGY_API_H_ |
| 7 | 7 |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "extensions/browser/api/bluetooth_low_energy/bluetooth_low_energy_event
_router.h" | 9 #include "extensions/browser/api/bluetooth_low_energy/bluetooth_low_energy_event
_router.h" |
| 10 #include "extensions/browser/browser_context_keyed_api_factory.h" | 10 #include "extensions/browser/browser_context_keyed_api_factory.h" |
| (...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 322 private: | 322 private: |
| 323 // Success and error callbacks, called by | 323 // Success and error callbacks, called by |
| 324 // BluetoothLowEnergyEventRouter::WriteDescriptorValue. | 324 // BluetoothLowEnergyEventRouter::WriteDescriptorValue. |
| 325 void SuccessCallback(); | 325 void SuccessCallback(); |
| 326 void ErrorCallback(BluetoothLowEnergyEventRouter::Status status); | 326 void ErrorCallback(BluetoothLowEnergyEventRouter::Status status); |
| 327 | 327 |
| 328 // The instance ID of the requested descriptor. | 328 // The instance ID of the requested descriptor. |
| 329 std::string instance_id_; | 329 std::string instance_id_; |
| 330 }; | 330 }; |
| 331 | 331 |
| 332 class BluetoothLowEnergyRegisterAdvertisementFunction |
| 333 : public BluetoothLowEnergyExtensionFunction { |
| 334 public: |
| 335 DECLARE_EXTENSION_FUNCTION("bluetoothLowEnergy.registerAdvertisement", |
| 336 BLUETOOTHLOWENERGY_REGISTERADVERTISEMENT); |
| 337 |
| 338 protected: |
| 339 ~BluetoothLowEnergyRegisterAdvertisementFunction() override {} |
| 340 |
| 341 // BluetoothLowEnergyExtensionFunction override. |
| 342 bool DoWork() override; |
| 343 |
| 344 private: |
| 345 // Success and error callbacks, called by |
| 346 // BluetoothLowEnergyEventRouter::WriteDescriptorValue. |
| 347 void SuccessCallback(); |
| 348 void ErrorCallback(BluetoothLowEnergyEventRouter::Status status); |
| 349 |
| 350 // The instance ID of the requested descriptor. |
| 351 std::string instance_id_; |
| 352 }; |
| 353 |
| 354 class BluetoothLowEnergyUnregisterAdvertisementFunction |
| 355 : public BluetoothLowEnergyExtensionFunction { |
| 356 public: |
| 357 DECLARE_EXTENSION_FUNCTION("bluetoothLowEnergy.unregisterAdvertisement", |
| 358 BLUETOOTHLOWENERGY_UNREGISTERADVERTISEMENT); |
| 359 |
| 360 protected: |
| 361 ~BluetoothLowEnergyUnregisterAdvertisementFunction() override {} |
| 362 |
| 363 // BluetoothLowEnergyExtensionFunction override. |
| 364 bool DoWork() override; |
| 365 |
| 366 private: |
| 367 // Success and error callbacks, called by |
| 368 // BluetoothLowEnergyEventRouter::WriteDescriptorValue. |
| 369 void SuccessCallback(); |
| 370 void ErrorCallback(BluetoothLowEnergyEventRouter::Status status); |
| 371 |
| 372 // The instance ID of the requested descriptor. |
| 373 std::string instance_id_; |
| 374 }; |
| 375 |
| 332 } // namespace core_api | 376 } // namespace core_api |
| 333 } // namespace extensions | 377 } // namespace extensions |
| 334 | 378 |
| 335 #endif // EXTENSIONS_BROWSER_API_BLUETOOTH_LOW_ENERGY_BLUETOOTH_LOW_ENERGY_API_
H_ | 379 #endif // EXTENSIONS_BROWSER_API_BLUETOOTH_LOW_ENERGY_BLUETOOTH_LOW_ENERGY_API_
H_ |
| OLD | NEW |