| 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 <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
| 13 #include "chrome/browser/extensions/api/bluetooth_low_energy/bluetooth_api_adver
tisement.h" | |
| 14 #include "chrome/browser/extensions/api/bluetooth_low_energy/bluetooth_low_energ
y_event_router.h" | |
| 15 #include "content/public/browser/browser_context.h" | 13 #include "content/public/browser/browser_context.h" |
| 16 #include "device/bluetooth/bluetooth_advertisement.h" | 14 #include "device/bluetooth/bluetooth_advertisement.h" |
| 17 #include "extensions/browser/api/api_resource_manager.h" | 15 #include "extensions/browser/api/api_resource_manager.h" |
| 16 #include "extensions/browser/api/bluetooth_low_energy/bluetooth_api_advertisemen
t.h" |
| 17 #include "extensions/browser/api/bluetooth_low_energy/bluetooth_low_energy_event
_router.h" |
| 18 #include "extensions/browser/browser_context_keyed_api_factory.h" | 18 #include "extensions/browser/browser_context_keyed_api_factory.h" |
| 19 #include "extensions/browser/extension_function.h" | 19 #include "extensions/browser/extension_function.h" |
| 20 #include "extensions/browser/extension_function_histogram_value.h" | 20 #include "extensions/browser/extension_function_histogram_value.h" |
| 21 | 21 |
| 22 namespace extensions { | 22 namespace extensions { |
| 23 class BluetoothApiAdvertisement; | 23 class BluetoothApiAdvertisement; |
| 24 class BluetoothLowEnergyEventRouter; | 24 class BluetoothLowEnergyEventRouter; |
| 25 | 25 |
| 26 namespace api { | 26 namespace api { |
| 27 namespace bluetooth_low_energy { | 27 namespace bluetooth_low_energy { |
| (...skipping 21 matching lines...) Expand all Loading... |
| 49 namespace SendRequestResponse { | 49 namespace SendRequestResponse { |
| 50 struct Params; | 50 struct Params; |
| 51 } | 51 } |
| 52 } // namespace bluetooth_low_energy | 52 } // namespace bluetooth_low_energy |
| 53 } // namespace api | 53 } // namespace api |
| 54 | 54 |
| 55 // The profile-keyed service that manages the bluetoothLowEnergy extension API. | 55 // The profile-keyed service that manages the bluetoothLowEnergy extension API. |
| 56 class BluetoothLowEnergyAPI : public BrowserContextKeyedAPI { | 56 class BluetoothLowEnergyAPI : public BrowserContextKeyedAPI { |
| 57 public: | 57 public: |
| 58 static BrowserContextKeyedAPIFactory<BluetoothLowEnergyAPI>* | 58 static BrowserContextKeyedAPIFactory<BluetoothLowEnergyAPI>* |
| 59 GetFactoryInstance(); | 59 GetFactoryInstance(); |
| 60 | 60 |
| 61 // Convenience method to get the BluetoothLowEnergy API for a browser context. | 61 // Convenience method to get the BluetoothLowEnergy API for a browser context. |
| 62 static BluetoothLowEnergyAPI* Get(content::BrowserContext* context); | 62 static BluetoothLowEnergyAPI* Get(content::BrowserContext* context); |
| 63 | 63 |
| 64 explicit BluetoothLowEnergyAPI(content::BrowserContext* context); | 64 explicit BluetoothLowEnergyAPI(content::BrowserContext* context); |
| 65 ~BluetoothLowEnergyAPI() override; | 65 ~BluetoothLowEnergyAPI() override; |
| 66 | 66 |
| 67 // KeyedService implementation.. | 67 // KeyedService implementation.. |
| 68 void Shutdown() override; | 68 void Shutdown() override; |
| 69 | 69 |
| (...skipping 554 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 624 protected: | 624 protected: |
| 625 ~BluetoothLowEnergySendRequestResponseFunction() override {} | 625 ~BluetoothLowEnergySendRequestResponseFunction() override {} |
| 626 | 626 |
| 627 // BluetoothLowEnergyPeripheralExtensionFunction override. | 627 // BluetoothLowEnergyPeripheralExtensionFunction override. |
| 628 void DoWork() override; | 628 void DoWork() override; |
| 629 }; | 629 }; |
| 630 | 630 |
| 631 } // namespace api | 631 } // namespace api |
| 632 } // namespace extensions | 632 } // namespace extensions |
| 633 | 633 |
| 634 #endif // CHROME_BROWSER_EXTENSIONS_API_BLUETOOTH_LOW_ENERGY_BLUETOOTH_LOW_ENER
GY_API_H_ | 634 #endif // EXTENSIONS_BROWSER_API_BLUETOOTH_LOW_ENERGY_BLUETOOTH_LOW_ENERGY_API_
H_ |
| OLD | NEW |