| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_BLUETOOTH_API_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_BLUETOOTH_BLUETOOTH_API_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_API_BLUETOOTH_BLUETOOTH_API_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_BLUETOOTH_BLUETOOTH_API_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 #include "extensions/browser/browser_context_keyed_api_factory.h" | 21 #include "extensions/browser/browser_context_keyed_api_factory.h" |
| 22 #include "extensions/browser/event_router.h" | 22 #include "extensions/browser/event_router.h" |
| 23 #include "extensions/browser/extension_function.h" | 23 #include "extensions/browser/extension_function.h" |
| 24 | 24 |
| 25 namespace content { | 25 namespace content { |
| 26 class BrowserContext; | 26 class BrowserContext; |
| 27 } | 27 } |
| 28 | 28 |
| 29 namespace device { | 29 namespace device { |
| 30 class BluetoothAdapter; | 30 class BluetoothAdapter; |
| 31 struct BluetoothOutOfBandPairingData; | |
| 32 } | 31 } |
| 33 | 32 |
| 34 namespace net { | 33 namespace net { |
| 35 class IOBuffer; | 34 class IOBuffer; |
| 36 } | 35 } |
| 37 | 36 |
| 38 namespace extensions { | 37 namespace extensions { |
| 39 | 38 |
| 40 class BluetoothEventRouter; | 39 class BluetoothEventRouter; |
| 41 | 40 |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 249 public: | 248 public: |
| 250 DECLARE_EXTENSION_FUNCTION("bluetooth.getSockets", BLUETOOTH_GET_SOCKETS) | 249 DECLARE_EXTENSION_FUNCTION("bluetooth.getSockets", BLUETOOTH_GET_SOCKETS) |
| 251 | 250 |
| 252 protected: | 251 protected: |
| 253 virtual ~BluetoothGetSocketsFunction() {} | 252 virtual ~BluetoothGetSocketsFunction() {} |
| 254 | 253 |
| 255 // AsyncExtensionFunction: | 254 // AsyncExtensionFunction: |
| 256 virtual bool RunAsync() OVERRIDE; | 255 virtual bool RunAsync() OVERRIDE; |
| 257 }; | 256 }; |
| 258 | 257 |
| 259 class BluetoothGetLocalOutOfBandPairingDataFunction | |
| 260 : public BluetoothExtensionFunction { | |
| 261 public: | |
| 262 DECLARE_EXTENSION_FUNCTION("bluetooth.getLocalOutOfBandPairingData", | |
| 263 BLUETOOTH_GETLOCALOUTOFBANDPAIRINGDATA) | |
| 264 | |
| 265 protected: | |
| 266 virtual ~BluetoothGetLocalOutOfBandPairingDataFunction() {} | |
| 267 | |
| 268 void ReadCallback(const device::BluetoothOutOfBandPairingData& data); | |
| 269 void ErrorCallback(); | |
| 270 | |
| 271 // BluetoothExtensionFunction: | |
| 272 virtual bool DoWork(scoped_refptr<device::BluetoothAdapter> adapter) OVERRIDE; | |
| 273 }; | |
| 274 | |
| 275 class BluetoothSetOutOfBandPairingDataFunction | |
| 276 : public BluetoothExtensionFunction { | |
| 277 public: | |
| 278 DECLARE_EXTENSION_FUNCTION("bluetooth.setOutOfBandPairingData", | |
| 279 BLUETOOTH_SETOUTOFBANDPAIRINGDATA) | |
| 280 | |
| 281 protected: | |
| 282 virtual ~BluetoothSetOutOfBandPairingDataFunction() {} | |
| 283 | |
| 284 void OnSuccessCallback(); | |
| 285 void OnErrorCallback(); | |
| 286 | |
| 287 // BluetoothExtensionFunction: | |
| 288 virtual bool DoWork(scoped_refptr<device::BluetoothAdapter> adapter) OVERRIDE; | |
| 289 }; | |
| 290 | |
| 291 class BluetoothStartDiscoveryFunction : public BluetoothExtensionFunction { | 258 class BluetoothStartDiscoveryFunction : public BluetoothExtensionFunction { |
| 292 public: | 259 public: |
| 293 DECLARE_EXTENSION_FUNCTION("bluetooth.startDiscovery", | 260 DECLARE_EXTENSION_FUNCTION("bluetooth.startDiscovery", |
| 294 BLUETOOTH_STARTDISCOVERY) | 261 BLUETOOTH_STARTDISCOVERY) |
| 295 | 262 |
| 296 protected: | 263 protected: |
| 297 virtual ~BluetoothStartDiscoveryFunction() {} | 264 virtual ~BluetoothStartDiscoveryFunction() {} |
| 298 | 265 |
| 299 // BluetoothExtensionFunction: | 266 // BluetoothExtensionFunction: |
| 300 virtual bool DoWork(scoped_refptr<device::BluetoothAdapter> adapter) OVERRIDE; | 267 virtual bool DoWork(scoped_refptr<device::BluetoothAdapter> adapter) OVERRIDE; |
| (...skipping 15 matching lines...) Expand all Loading... |
| 316 | 283 |
| 317 private: | 284 private: |
| 318 void OnSuccessCallback(); | 285 void OnSuccessCallback(); |
| 319 void OnErrorCallback(); | 286 void OnErrorCallback(); |
| 320 }; | 287 }; |
| 321 | 288 |
| 322 } // namespace api | 289 } // namespace api |
| 323 } // namespace extensions | 290 } // namespace extensions |
| 324 | 291 |
| 325 #endif // CHROME_BROWSER_EXTENSIONS_API_BLUETOOTH_BLUETOOTH_API_H_ | 292 #endif // CHROME_BROWSER_EXTENSIONS_API_BLUETOOTH_BLUETOOTH_API_H_ |
| OLD | NEW |