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 "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "extensions/browser/browser_context_keyed_api_factory.h" | 9 #include "extensions/browser/browser_context_keyed_api_factory.h" |
10 #include "extensions/browser/extension_function.h" | 10 #include "extensions/browser/extension_function.h" |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 : public BluetoothLowEnergyExtensionFunction { | 190 : public BluetoothLowEnergyExtensionFunction { |
191 public: | 191 public: |
192 DECLARE_EXTENSION_FUNCTION("bluetoothLowEnergy.writeCharacteristicValue", | 192 DECLARE_EXTENSION_FUNCTION("bluetoothLowEnergy.writeCharacteristicValue", |
193 BLUETOOTHLOWENERGY_WRITECHARACTERISTICVALUE); | 193 BLUETOOTHLOWENERGY_WRITECHARACTERISTICVALUE); |
194 | 194 |
195 protected: | 195 protected: |
196 virtual ~BluetoothLowEnergyWriteCharacteristicValueFunction() {} | 196 virtual ~BluetoothLowEnergyWriteCharacteristicValueFunction() {} |
197 | 197 |
198 // BluetoothLowEnergyExtensionFunction override. | 198 // BluetoothLowEnergyExtensionFunction override. |
199 virtual bool DoWork() OVERRIDE; | 199 virtual bool DoWork() OVERRIDE; |
| 200 |
| 201 private: |
| 202 // Success and error callbacks, called by |
| 203 // BluetoothLowEnergyEventRouter::WriteCharacteristicValue. |
| 204 void SuccessCallback(); |
| 205 void ErrorCallback(); |
| 206 |
| 207 // The instance ID of the requested characteristic. |
| 208 std::string instance_id_; |
200 }; | 209 }; |
201 | 210 |
202 class BluetoothLowEnergyReadDescriptorValueFunction | 211 class BluetoothLowEnergyReadDescriptorValueFunction |
203 : public BluetoothLowEnergyExtensionFunction { | 212 : public BluetoothLowEnergyExtensionFunction { |
204 public: | 213 public: |
205 DECLARE_EXTENSION_FUNCTION("bluetoothLowEnergy.readDescriptorValue", | 214 DECLARE_EXTENSION_FUNCTION("bluetoothLowEnergy.readDescriptorValue", |
206 BLUETOOTHLOWENERGY_READDESCRIPTORVALUE); | 215 BLUETOOTHLOWENERGY_READDESCRIPTORVALUE); |
207 | 216 |
208 protected: | 217 protected: |
209 virtual ~BluetoothLowEnergyReadDescriptorValueFunction() {} | 218 virtual ~BluetoothLowEnergyReadDescriptorValueFunction() {} |
(...skipping 12 matching lines...) Expand all Loading... |
222 virtual ~BluetoothLowEnergyWriteDescriptorValueFunction() {} | 231 virtual ~BluetoothLowEnergyWriteDescriptorValueFunction() {} |
223 | 232 |
224 // BluetoothLowEnergyExtensionFunction override. | 233 // BluetoothLowEnergyExtensionFunction override. |
225 virtual bool DoWork() OVERRIDE; | 234 virtual bool DoWork() OVERRIDE; |
226 }; | 235 }; |
227 | 236 |
228 } // namespace api | 237 } // namespace api |
229 } // namespace extensions | 238 } // namespace extensions |
230 | 239 |
231 #endif // CHROME_BROWSER_EXTENSIONS_API_BLUETOOTH_LOW_ENERGY_BLUETOOTH_LOW_ENER
GY_API_H_ | 240 #endif // CHROME_BROWSER_EXTENSIONS_API_BLUETOOTH_LOW_ENERGY_BLUETOOTH_LOW_ENER
GY_API_H_ |
OLD | NEW |