| 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 EXTENSIONS_BROWSER_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 EXTENSIONS_BROWSER_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 "chrome/browser/extensions/api/bluetooth_low_energy/bluetooth_low_energ
y_event_router.h" | 9 #include "extensions/browser/api/bluetooth_low_energy/bluetooth_low_energy_event
_router.h" |
| 10 #include "extensions/browser/browser_context_keyed_api_factory.h" | 10 #include "extensions/browser/browser_context_keyed_api_factory.h" |
| 11 #include "extensions/browser/extension_function.h" | 11 #include "extensions/browser/extension_function.h" |
| 12 #include "extensions/browser/extension_function_histogram_value.h" | 12 #include "extensions/browser/extension_function_histogram_value.h" |
| 13 | 13 |
| 14 namespace extensions { | 14 namespace extensions { |
| 15 | 15 |
| 16 class BluetoothLowEnergyEventRouter; | 16 class BluetoothLowEnergyEventRouter; |
| 17 | 17 |
| 18 // The profile-keyed service that manages the bluetoothLowEnergy extension API. | 18 // The profile-keyed service that manages the bluetoothLowEnergy extension API. |
| 19 class BluetoothLowEnergyAPI : public BrowserContextKeyedAPI { | 19 class BluetoothLowEnergyAPI : public BrowserContextKeyedAPI { |
| (...skipping 22 matching lines...) Expand all Loading... |
| 42 private: | 42 private: |
| 43 friend class BrowserContextKeyedAPIFactory<BluetoothLowEnergyAPI>; | 43 friend class BrowserContextKeyedAPIFactory<BluetoothLowEnergyAPI>; |
| 44 | 44 |
| 45 scoped_ptr<BluetoothLowEnergyEventRouter> event_router_; | 45 scoped_ptr<BluetoothLowEnergyEventRouter> event_router_; |
| 46 | 46 |
| 47 content::BrowserContext* browser_context_; | 47 content::BrowserContext* browser_context_; |
| 48 | 48 |
| 49 DISALLOW_COPY_AND_ASSIGN(BluetoothLowEnergyAPI); | 49 DISALLOW_COPY_AND_ASSIGN(BluetoothLowEnergyAPI); |
| 50 }; | 50 }; |
| 51 | 51 |
| 52 namespace api { | 52 namespace core_api { |
| 53 | 53 |
| 54 // Base class for bluetoothLowEnergy API functions. This class handles some of | 54 // Base class for bluetoothLowEnergy API functions. This class handles some of |
| 55 // the common logic involved in all API functions, such as checking for | 55 // the common logic involved in all API functions, such as checking for |
| 56 // platform support and returning the correct error. | 56 // platform support and returning the correct error. |
| 57 class BluetoothLowEnergyExtensionFunction : public AsyncExtensionFunction { | 57 class BluetoothLowEnergyExtensionFunction : public AsyncExtensionFunction { |
| 58 public: | 58 public: |
| 59 BluetoothLowEnergyExtensionFunction(); | 59 BluetoothLowEnergyExtensionFunction(); |
| 60 | 60 |
| 61 protected: | 61 protected: |
| 62 virtual ~BluetoothLowEnergyExtensionFunction(); | 62 virtual ~BluetoothLowEnergyExtensionFunction(); |
| (...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 324 private: | 324 private: |
| 325 // Success and error callbacks, called by | 325 // Success and error callbacks, called by |
| 326 // BluetoothLowEnergyEventRouter::WriteDescriptorValue. | 326 // BluetoothLowEnergyEventRouter::WriteDescriptorValue. |
| 327 void SuccessCallback(); | 327 void SuccessCallback(); |
| 328 void ErrorCallback(BluetoothLowEnergyEventRouter::Status status); | 328 void ErrorCallback(BluetoothLowEnergyEventRouter::Status status); |
| 329 | 329 |
| 330 // The instance ID of the requested descriptor. | 330 // The instance ID of the requested descriptor. |
| 331 std::string instance_id_; | 331 std::string instance_id_; |
| 332 }; | 332 }; |
| 333 | 333 |
| 334 } // namespace api | 334 } // namespace core_api |
| 335 } // namespace extensions | 335 } // namespace extensions |
| 336 | 336 |
| 337 #endif // CHROME_BROWSER_EXTENSIONS_API_BLUETOOTH_LOW_ENERGY_BLUETOOTH_LOW_ENER
GY_API_H_ | 337 #endif // EXTENSIONS_BROWSER_API_BLUETOOTH_LOW_ENERGY_BLUETOOTH_LOW_ENERGY_API_
H_ |
| OLD | NEW |