| 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 content::BrowserContext* browser_context_; | 46 content::BrowserContext* browser_context_; |
| 47 | 47 |
| 48 DISALLOW_COPY_AND_ASSIGN(BluetoothLowEnergyAPI); | 48 DISALLOW_COPY_AND_ASSIGN(BluetoothLowEnergyAPI); |
| 49 }; | 49 }; |
| 50 | 50 |
| 51 namespace api { | 51 namespace api { |
| 52 | 52 |
| 53 // Base class for bluetoothLowEnergy API functions. This class handles some of | 53 // Base class for bluetoothLowEnergy API functions. This class handles some of |
| 54 // the common logic involved in all API functions, such as checking for | 54 // the common logic involved in all API functions, such as checking for |
| 55 // platform support and returning the correct error. | 55 // platform support and returning the correct error. |
| 56 class BluetoothLowEnergyExtensionFunction : public UIThreadExtensionFunction { | 56 class BluetoothLowEnergyExtensionFunction : public AsyncExtensionFunction { |
| 57 public: | 57 public: |
| 58 BluetoothLowEnergyExtensionFunction(); | 58 BluetoothLowEnergyExtensionFunction(); |
| 59 | 59 |
| 60 protected: | 60 protected: |
| 61 virtual ~BluetoothLowEnergyExtensionFunction(); | 61 virtual ~BluetoothLowEnergyExtensionFunction(); |
| 62 | 62 |
| 63 // ExtensionFunction override. | 63 // ExtensionFunction override. |
| 64 virtual bool RunImpl() OVERRIDE; | 64 virtual bool RunAsync() OVERRIDE; |
| 65 | 65 |
| 66 // Implemented by individual bluetoothLowEnergy extension functions to perform | 66 // Implemented by individual bluetoothLowEnergy extension functions to perform |
| 67 // the body of the function. This invoked asynchonously after RunImpl after | 67 // the body of the function. This invoked asynchonously after RunAsync after |
| 68 // the BluetoothLowEnergyEventRouter has obtained a handle on the | 68 // the BluetoothLowEnergyEventRouter has obtained a handle on the |
| 69 // BluetoothAdapter. | 69 // BluetoothAdapter. |
| 70 virtual bool DoWork() = 0; | 70 virtual bool DoWork() = 0; |
| 71 | 71 |
| 72 private: | 72 private: |
| 73 DISALLOW_COPY_AND_ASSIGN(BluetoothLowEnergyExtensionFunction); | 73 DISALLOW_COPY_AND_ASSIGN(BluetoothLowEnergyExtensionFunction); |
| 74 }; | 74 }; |
| 75 | 75 |
| 76 class BluetoothLowEnergyGetServiceFunction | 76 class BluetoothLowEnergyGetServiceFunction |
| 77 : public BluetoothLowEnergyExtensionFunction { | 77 : public BluetoothLowEnergyExtensionFunction { |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 virtual ~BluetoothLowEnergyWriteDescriptorValueFunction() {} | 213 virtual ~BluetoothLowEnergyWriteDescriptorValueFunction() {} |
| 214 | 214 |
| 215 // BluetoothLowEnergyExtensionFunction override. | 215 // BluetoothLowEnergyExtensionFunction override. |
| 216 virtual bool DoWork() OVERRIDE; | 216 virtual bool DoWork() OVERRIDE; |
| 217 }; | 217 }; |
| 218 | 218 |
| 219 } // namespace api | 219 } // namespace api |
| 220 } // namespace extensions | 220 } // namespace extensions |
| 221 | 221 |
| 222 #endif // CHROME_BROWSER_EXTENSIONS_API_BLUETOOTH_LOW_ENERGY_BLUETOOTH_LOW_ENER
GY_API_H_ | 222 #endif // CHROME_BROWSER_EXTENSIONS_API_BLUETOOTH_LOW_ENERGY_BLUETOOTH_LOW_ENER
GY_API_H_ |
| OLD | NEW |