| 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 CHROME_BROWSER_EXTENSIONS_API_BLUETOOTH_LOW_ENERGY_BLUETOOTH_LOW_ENERGY_
API_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_BLUETOOTH_LOW_ENERGY_BLUETOOTH_LOW_ENERGY_
API_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_API_BLUETOOTH_LOW_ENERGY_BLUETOOTH_LOW_ENERGY_
API_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_BLUETOOTH_LOW_ENERGY_BLUETOOTH_LOW_ENERGY_
API_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 | 121 |
| 122 // ExtensionFunction override. | 122 // ExtensionFunction override. |
| 123 ResponseAction Run() override; | 123 ResponseAction Run() override; |
| 124 | 124 |
| 125 // Implemented by individual bluetoothLowEnergy extension functions to perform | 125 // Implemented by individual bluetoothLowEnergy extension functions to perform |
| 126 // the body of the function. This invoked asynchonously after Run after | 126 // the body of the function. This invoked asynchonously after Run after |
| 127 // the BluetoothLowEnergyEventRouter has obtained a handle on the | 127 // the BluetoothLowEnergyEventRouter has obtained a handle on the |
| 128 // BluetoothAdapter. | 128 // BluetoothAdapter. |
| 129 virtual void DoWork() = 0; | 129 virtual void DoWork() = 0; |
| 130 | 130 |
| 131 BluetoothLowEnergyEventRouter* event_router_; |
| 132 |
| 131 private: | 133 private: |
| 134 // Internal method to do common setup before actual DoWork is called. |
| 135 void PreDoWork(); |
| 136 |
| 132 DISALLOW_COPY_AND_ASSIGN(BluetoothLowEnergyExtensionFunction); | 137 DISALLOW_COPY_AND_ASSIGN(BluetoothLowEnergyExtensionFunction); |
| 133 }; | 138 }; |
| 134 | 139 |
| 135 // Base class for bluetoothLowEnergy API peripheral mode functions. This class | 140 // Base class for bluetoothLowEnergy API peripheral mode functions. This class |
| 136 // handles some of the common logic involved in all API peripheral mode | 141 // handles some of the common logic involved in all API peripheral mode |
| 137 // functions, such as checking for peripheral permissions and returning the | 142 // functions, such as checking for peripheral permissions and returning the |
| 138 // correct error. | 143 // correct error. |
| 139 template <typename Params> | 144 template <typename Params> |
| 140 class BLEPeripheralExtensionFunction | 145 class BLEPeripheralExtensionFunction |
| 141 : public BluetoothLowEnergyExtensionFunction { | 146 : public BluetoothLowEnergyExtensionFunction { |
| (...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 554 ~BluetoothLowEnergySendRequestResponseFunction() override {} | 559 ~BluetoothLowEnergySendRequestResponseFunction() override {} |
| 555 | 560 |
| 556 // BluetoothLowEnergyPeripheralExtensionFunction override. | 561 // BluetoothLowEnergyPeripheralExtensionFunction override. |
| 557 void DoWork() override; | 562 void DoWork() override; |
| 558 }; | 563 }; |
| 559 | 564 |
| 560 } // namespace api | 565 } // namespace api |
| 561 } // namespace extensions | 566 } // namespace extensions |
| 562 | 567 |
| 563 #endif // CHROME_BROWSER_EXTENSIONS_API_BLUETOOTH_LOW_ENERGY_BLUETOOTH_LOW_ENER
GY_API_H_ | 568 #endif // CHROME_BROWSER_EXTENSIONS_API_BLUETOOTH_LOW_ENERGY_BLUETOOTH_LOW_ENER
GY_API_H_ |
| OLD | NEW |