OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_WIN_H_ | 5 #ifndef DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_WIN_H_ |
6 #define DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_WIN_H_ | 6 #define DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_WIN_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "device/bluetooth/bluetooth_device.h" | 12 #include "device/bluetooth/bluetooth_device.h" |
13 #include "device/bluetooth/bluetooth_task_manager_win.h" | 13 #include "device/bluetooth/bluetooth_task_manager_win.h" |
14 | 14 |
15 namespace device { | 15 namespace device { |
16 | 16 |
17 class BluetoothAdapterWin; | 17 class BluetoothAdapterWin; |
18 class BluetoothServiceRecord; | 18 class BluetoothServiceRecord; |
19 | 19 |
20 class BluetoothDeviceWin : public BluetoothDevice { | 20 class BluetoothDeviceWin : public BluetoothDevice { |
21 public: | 21 public: |
22 explicit BluetoothDeviceWin( | 22 explicit BluetoothDeviceWin( |
23 const BluetoothTaskManagerWin::DeviceState& state); | 23 const BluetoothTaskManagerWin::DeviceState& state, |
| 24 scoped_refptr<base::SequencedTaskRunner> ui_task_runner, |
| 25 scoped_refptr<base::SequencedTaskRunner> file_task_runner, |
| 26 net::NetLog* net_log, |
| 27 const net::NetLog::Source& net_log_source); |
24 virtual ~BluetoothDeviceWin(); | 28 virtual ~BluetoothDeviceWin(); |
25 | 29 |
26 // BluetoothDevice override | 30 // BluetoothDevice override |
27 virtual uint32 GetBluetoothClass() const OVERRIDE; | 31 virtual uint32 GetBluetoothClass() const OVERRIDE; |
28 virtual std::string GetAddress() const OVERRIDE; | 32 virtual std::string GetAddress() const OVERRIDE; |
29 virtual VendorIDSource GetVendorIDSource() const OVERRIDE; | 33 virtual VendorIDSource GetVendorIDSource() const OVERRIDE; |
30 virtual uint16 GetVendorID() const OVERRIDE; | 34 virtual uint16 GetVendorID() const OVERRIDE; |
31 virtual uint16 GetProductID() const OVERRIDE; | 35 virtual uint16 GetProductID() const OVERRIDE; |
32 virtual uint16 GetDeviceID() const OVERRIDE; | 36 virtual uint16 GetDeviceID() const OVERRIDE; |
33 virtual bool IsPaired() const OVERRIDE; | 37 virtual bool IsPaired() const OVERRIDE; |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 // BluetoothDevice override | 82 // BluetoothDevice override |
79 virtual std::string GetDeviceName() const OVERRIDE; | 83 virtual std::string GetDeviceName() const OVERRIDE; |
80 | 84 |
81 private: | 85 private: |
82 friend class BluetoothAdapterWin; | 86 friend class BluetoothAdapterWin; |
83 | 87 |
84 // Used by BluetoothAdapterWin to update the visible state during | 88 // Used by BluetoothAdapterWin to update the visible state during |
85 // discovery. | 89 // discovery. |
86 void SetVisible(bool visible); | 90 void SetVisible(bool visible); |
87 | 91 |
| 92 scoped_refptr<base::SequencedTaskRunner> ui_task_runner_; |
| 93 scoped_refptr<base::SequencedTaskRunner> file_task_runner_; |
| 94 net::NetLog* net_log_; |
| 95 net::NetLog::Source net_log_source_; |
| 96 |
88 // The Bluetooth class of the device, a bitmask that may be decoded using | 97 // The Bluetooth class of the device, a bitmask that may be decoded using |
89 // https://www.bluetooth.org/Technical/AssignedNumbers/baseband.htm | 98 // https://www.bluetooth.org/Technical/AssignedNumbers/baseband.htm |
90 uint32 bluetooth_class_; | 99 uint32 bluetooth_class_; |
91 | 100 |
92 // The name of the device, as supplied by the remote device. | 101 // The name of the device, as supplied by the remote device. |
93 std::string name_; | 102 std::string name_; |
94 | 103 |
95 // The Bluetooth address of the device. | 104 // The Bluetooth address of the device. |
96 std::string address_; | 105 std::string address_; |
97 | 106 |
98 // Tracked device state, updated by the adapter managing the lifecycle of | 107 // Tracked device state, updated by the adapter managing the lifecycle of |
99 // the device. | 108 // the device. |
100 bool paired_; | 109 bool paired_; |
101 bool connected_; | 110 bool connected_; |
102 | 111 |
103 // Used to send change notifications when a device disappears during | 112 // Used to send change notifications when a device disappears during |
104 // discovery. | 113 // discovery. |
105 bool visible_; | 114 bool visible_; |
106 | 115 |
107 // The services (identified by UUIDs) that this device provides. | 116 // The services (identified by UUIDs) that this device provides. |
108 ServiceList service_uuids_; | 117 ServiceList service_uuids_; |
109 ServiceRecordList service_record_list_; | 118 ServiceRecordList service_record_list_; |
110 | 119 |
111 DISALLOW_COPY_AND_ASSIGN(BluetoothDeviceWin); | 120 DISALLOW_COPY_AND_ASSIGN(BluetoothDeviceWin); |
112 }; | 121 }; |
113 | 122 |
114 } // namespace device | 123 } // namespace device |
115 | 124 |
116 #endif // DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_WIN_H_ | 125 #endif // DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_WIN_H_ |
OLD | NEW |