| 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_TASK_MANAGER_WIN_H_ | 5 #ifndef DEVICE_BLUETOOTH_BLUETOOTH_TASK_MANAGER_WIN_H_ |
| 6 #define DEVICE_BLUETOOTH_BLUETOOTH_TASK_MANAGER_WIN_H_ | 6 #define DEVICE_BLUETOOTH_BLUETOOTH_TASK_MANAGER_WIN_H_ |
| 7 | 7 |
| 8 #include <stdint.h> |
| 9 |
| 8 #include <string> | 10 #include <string> |
| 9 #include <vector> | 11 #include <vector> |
| 10 | 12 |
| 11 #include "base/files/file_path.h" | 13 #include "base/files/file_path.h" |
| 14 #include "base/macros.h" |
| 12 #include "base/memory/ref_counted.h" | 15 #include "base/memory/ref_counted.h" |
| 13 #include "base/memory/scoped_vector.h" | 16 #include "base/memory/scoped_vector.h" |
| 14 #include "base/observer_list.h" | 17 #include "base/observer_list.h" |
| 15 #include "base/win/scoped_handle.h" | 18 #include "base/win/scoped_handle.h" |
| 16 #include "device/bluetooth/bluetooth_adapter.h" | 19 #include "device/bluetooth/bluetooth_adapter.h" |
| 17 #include "device/bluetooth/bluetooth_export.h" | 20 #include "device/bluetooth/bluetooth_export.h" |
| 18 | 21 |
| 19 namespace base { | 22 namespace base { |
| 20 | 23 |
| 21 class SequencedTaskRunner; | 24 class SequencedTaskRunner; |
| (...skipping 21 matching lines...) Expand all Loading... |
| 43 std::string address; | 46 std::string address; |
| 44 bool powered; | 47 bool powered; |
| 45 }; | 48 }; |
| 46 | 49 |
| 47 struct DEVICE_BLUETOOTH_EXPORT ServiceRecordState { | 50 struct DEVICE_BLUETOOTH_EXPORT ServiceRecordState { |
| 48 ServiceRecordState(); | 51 ServiceRecordState(); |
| 49 ~ServiceRecordState(); | 52 ~ServiceRecordState(); |
| 50 // Properties common to Bluetooth Classic and LE devices. | 53 // Properties common to Bluetooth Classic and LE devices. |
| 51 std::string name; | 54 std::string name; |
| 52 // Properties specific to Bluetooth Classic devices. | 55 // Properties specific to Bluetooth Classic devices. |
| 53 std::vector<uint8> sdp_bytes; | 56 std::vector<uint8_t> sdp_bytes; |
| 54 // Properties specific to Bluetooth LE devices. | 57 // Properties specific to Bluetooth LE devices. |
| 55 BluetoothUUID gatt_uuid; | 58 BluetoothUUID gatt_uuid; |
| 56 }; | 59 }; |
| 57 | 60 |
| 58 struct DEVICE_BLUETOOTH_EXPORT DeviceState { | 61 struct DEVICE_BLUETOOTH_EXPORT DeviceState { |
| 59 DeviceState(); | 62 DeviceState(); |
| 60 ~DeviceState(); | 63 ~DeviceState(); |
| 61 | 64 |
| 62 bool is_bluetooth_classic() const { return path.empty(); } | 65 bool is_bluetooth_classic() const { return path.empty(); } |
| 63 | 66 |
| 64 // Properties common to Bluetooth Classic and LE devices. | 67 // Properties common to Bluetooth Classic and LE devices. |
| 65 std::string address; // This uniquely identifies the device. | 68 std::string address; // This uniquely identifies the device. |
| 66 std::string name; // Friendly name | 69 std::string name; // Friendly name |
| 67 bool visible; | 70 bool visible; |
| 68 bool connected; | 71 bool connected; |
| 69 bool authenticated; | 72 bool authenticated; |
| 70 ScopedVector<ServiceRecordState> service_record_states; | 73 ScopedVector<ServiceRecordState> service_record_states; |
| 71 // Properties specific to Bluetooth Classic devices. | 74 // Properties specific to Bluetooth Classic devices. |
| 72 uint32 bluetooth_class; | 75 uint32_t bluetooth_class; |
| 73 // Properties specific to Bluetooth LE devices. | 76 // Properties specific to Bluetooth LE devices. |
| 74 base::FilePath path; | 77 base::FilePath path; |
| 75 }; | 78 }; |
| 76 | 79 |
| 77 class DEVICE_BLUETOOTH_EXPORT Observer { | 80 class DEVICE_BLUETOOTH_EXPORT Observer { |
| 78 public: | 81 public: |
| 79 virtual ~Observer() {} | 82 virtual ~Observer() {} |
| 80 | 83 |
| 81 virtual void AdapterStateChanged(const AdapterState& state) {} | 84 virtual void AdapterStateChanged(const AdapterState& state) {} |
| 82 virtual void DiscoveryStarted(bool success) {} | 85 virtual void DiscoveryStarted(bool success) {} |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 211 // Use for discarding too many log messages. | 214 // Use for discarding too many log messages. |
| 212 base::TimeTicks current_logging_batch_ticks_; | 215 base::TimeTicks current_logging_batch_ticks_; |
| 213 int current_logging_batch_count_; | 216 int current_logging_batch_count_; |
| 214 | 217 |
| 215 DISALLOW_COPY_AND_ASSIGN(BluetoothTaskManagerWin); | 218 DISALLOW_COPY_AND_ASSIGN(BluetoothTaskManagerWin); |
| 216 }; | 219 }; |
| 217 | 220 |
| 218 } // namespace device | 221 } // namespace device |
| 219 | 222 |
| 220 #endif // DEVICE_BLUETOOTH_BLUETOOTH_TASK_MANAGER_WIN_H_ | 223 #endif // DEVICE_BLUETOOTH_BLUETOOTH_TASK_MANAGER_WIN_H_ |
| OLD | NEW |