Chromium Code Reviews| Index: content/browser/bluetooth/bluetooth_dispatcher_host.h |
| diff --git a/content/browser/bluetooth/bluetooth_dispatcher_host.h b/content/browser/bluetooth/bluetooth_dispatcher_host.h |
| index cc6cd9d5cb21ad43b4cfe9e008f373a6053b5fd7..c10be93d7b5145d538b0e55324cfb5e180bdc6d0 100644 |
| --- a/content/browser/bluetooth/bluetooth_dispatcher_host.h |
| +++ b/content/browser/bluetooth/bluetooth_dispatcher_host.h |
| @@ -6,12 +6,14 @@ |
| #define CONTENT_BROWSER_BLUETOOTH_BLUETOOTH_DISPATCHER_HOST_H_ |
| #include "base/basictypes.h" |
| +#include "base/containers/scoped_ptr_map.h" |
| #include "base/id_map.h" |
| #include "base/memory/weak_ptr.h" |
| #include "content/public/browser/bluetooth_chooser.h" |
| #include "content/public/browser/browser_message_filter.h" |
| #include "device/bluetooth/bluetooth_adapter.h" |
| #include "device/bluetooth/bluetooth_gatt_connection.h" |
| +#include "device/bluetooth/bluetooth_gatt_notify_session.h" |
| #include "device/bluetooth/bluetooth_gatt_service.h" |
| namespace device { |
| @@ -74,6 +76,10 @@ class CONTENT_EXPORT BluetoothDispatcherHost final |
| device::BluetoothDevice* device) override; |
| void DeviceRemoved(device::BluetoothAdapter* adapter, |
| device::BluetoothDevice* device) override; |
| + void GattCharacteristicValueChanged( |
| + device::BluetoothAdapter* adapter, |
| + device::BluetoothGattCharacteristic* characteristic, |
| + const std::vector<uint8>& value) override; |
| // IPC Handlers, see definitions in bluetooth_messages.h. |
| void OnRequestDevice( |
| @@ -99,6 +105,12 @@ class CONTENT_EXPORT BluetoothDispatcherHost final |
| int request_id, |
| const std::string& characteristic_instance_id, |
| const std::vector<uint8_t>& value); |
| + void OnStartNotifications(int thread_id, |
| + int request_id, |
| + const std::string& characteristic_instance_id); |
| + void OnStopNotifications(int thread_id, |
| + int request_id, |
| + const std::string& characteristic_instance_id); |
| // Callbacks for BluetoothAdapter::StartDiscoverySession. |
| void OnDiscoverySessionStarted( |
| @@ -155,6 +167,21 @@ class CONTENT_EXPORT BluetoothDispatcherHost final |
| int request_id, |
| device::BluetoothGattService::GattErrorCode); |
| + // Callbacks for BluetoothGattCharacteristic::StartNotifySession. |
| + void OnStartNotifySessionSuccess( |
| + int thread_id, |
| + int request_id, |
| + scoped_ptr<device::BluetoothGattNotifySession> notify_session); |
| + void OnStartNotifySessionFailed( |
| + int thread_id, |
| + int request_id, |
| + device::BluetoothGattService::GattErrorCode error_code); |
| + |
| + // Callback for BluetoothGattNotifySession::Stop. |
| + void OnStopNotifySession(int thread_id, |
| + int request_id, |
| + const std::string& characteristic_instance_id); |
| + |
| // Show help pages from the chooser dialog. |
| void ShowBluetoothOverviewLink(); |
| void ShowBluetoothPairingLink(); |
| @@ -174,6 +201,11 @@ class CONTENT_EXPORT BluetoothDispatcherHost final |
| // Map of characteristic_instance_id to service_instance_id. |
| std::map<std::string, std::string> characteristic_to_service_; |
| + // Map that matches characteristic_instance_id to notify session. |
| + base::ScopedPtrMap<std::string, |
|
Jeffrey Yasskin
2015/09/25 23:03:19
We'll probably need an additional |thread_id| key
ortuno
2015/09/29 22:47:36
Done. http://crbug.com/537372
|
| + scoped_ptr<device::BluetoothGattNotifySession>> |
| + characteristic_id_to_notify_session_; |
| + |
| // Defines how long to scan for and how long to discover services for. |
| int current_delay_time_; |