| 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 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 : public BluetoothLowEnergyExtensionFunction { | 181 : public BluetoothLowEnergyExtensionFunction { |
| 182 public: | 182 public: |
| 183 DECLARE_EXTENSION_FUNCTION("bluetoothLowEnergy.writeCharacteristicValue", | 183 DECLARE_EXTENSION_FUNCTION("bluetoothLowEnergy.writeCharacteristicValue", |
| 184 BLUETOOTHLOWENERGY_WRITECHARACTERISTICVALUE); | 184 BLUETOOTHLOWENERGY_WRITECHARACTERISTICVALUE); |
| 185 | 185 |
| 186 protected: | 186 protected: |
| 187 virtual ~BluetoothLowEnergyWriteCharacteristicValueFunction() {} | 187 virtual ~BluetoothLowEnergyWriteCharacteristicValueFunction() {} |
| 188 | 188 |
| 189 // BluetoothLowEnergyExtensionFunction override. | 189 // BluetoothLowEnergyExtensionFunction override. |
| 190 virtual bool DoWork() OVERRIDE; | 190 virtual bool DoWork() OVERRIDE; |
| 191 |
| 192 private: |
| 193 // Success and error callbacks, called by |
| 194 // BluetoothLowEnergyEventRouter::WriteCharacteristicValue. |
| 195 void SuccessCallback(); |
| 196 void ErrorCallback(); |
| 197 |
| 198 // The instance ID of the requested characteristic. |
| 199 std::string instance_id_; |
| 191 }; | 200 }; |
| 192 | 201 |
| 193 class BluetoothLowEnergyReadDescriptorValueFunction | 202 class BluetoothLowEnergyReadDescriptorValueFunction |
| 194 : public BluetoothLowEnergyExtensionFunction { | 203 : public BluetoothLowEnergyExtensionFunction { |
| 195 public: | 204 public: |
| 196 DECLARE_EXTENSION_FUNCTION("bluetoothLowEnergy.readDescriptorValue", | 205 DECLARE_EXTENSION_FUNCTION("bluetoothLowEnergy.readDescriptorValue", |
| 197 BLUETOOTHLOWENERGY_READDESCRIPTORVALUE); | 206 BLUETOOTHLOWENERGY_READDESCRIPTORVALUE); |
| 198 | 207 |
| 199 protected: | 208 protected: |
| 200 virtual ~BluetoothLowEnergyReadDescriptorValueFunction() {} | 209 virtual ~BluetoothLowEnergyReadDescriptorValueFunction() {} |
| (...skipping 12 matching lines...) Expand all Loading... |
| 213 virtual ~BluetoothLowEnergyWriteDescriptorValueFunction() {} | 222 virtual ~BluetoothLowEnergyWriteDescriptorValueFunction() {} |
| 214 | 223 |
| 215 // BluetoothLowEnergyExtensionFunction override. | 224 // BluetoothLowEnergyExtensionFunction override. |
| 216 virtual bool DoWork() OVERRIDE; | 225 virtual bool DoWork() OVERRIDE; |
| 217 }; | 226 }; |
| 218 | 227 |
| 219 } // namespace api | 228 } // namespace api |
| 220 } // namespace extensions | 229 } // namespace extensions |
| 221 | 230 |
| 222 #endif // CHROME_BROWSER_EXTENSIONS_API_BLUETOOTH_LOW_ENERGY_BLUETOOTH_LOW_ENER
GY_API_H_ | 231 #endif // CHROME_BROWSER_EXTENSIONS_API_BLUETOOTH_LOW_ENERGY_BLUETOOTH_LOW_ENER
GY_API_H_ |
| OLD | NEW |