| 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 7e3e7af45cb7d59206db6e04237ee11c962828d7..16132351d6acb4a3987f17e0d33a66d7fe678e33 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 {
|
| @@ -70,6 +72,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(
|
| @@ -95,6 +101,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(
|
| @@ -151,6 +163,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();
|
| @@ -170,6 +197,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,
|
| + 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_;
|
|
|
|
|