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 COMPONENTS_PAIRING_BLUETOOTH_HOST_PAIRING_CONTROLLER_H_ | 5 #ifndef COMPONENTS_PAIRING_BLUETOOTH_HOST_PAIRING_CONTROLLER_H_ |
6 #define COMPONENTS_PAIRING_BLUETOOTH_HOST_PAIRING_CONTROLLER_H_ | 6 #define COMPONENTS_PAIRING_BLUETOOTH_HOST_PAIRING_CONTROLLER_H_ |
7 | 7 |
| 8 #include <stdint.h> |
| 9 |
8 #include "base/macros.h" | 10 #include "base/macros.h" |
9 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
10 #include "base/memory/weak_ptr.h" | 12 #include "base/memory/weak_ptr.h" |
11 #include "base/observer_list.h" | 13 #include "base/observer_list.h" |
12 #include "base/threading/thread_checker.h" | 14 #include "base/threading/thread_checker.h" |
13 #include "components/pairing/host_pairing_controller.h" | 15 #include "components/pairing/host_pairing_controller.h" |
14 #include "components/pairing/proto_decoder.h" | 16 #include "components/pairing/proto_decoder.h" |
15 #include "device/bluetooth/bluetooth_adapter.h" | 17 #include "device/bluetooth/bluetooth_adapter.h" |
16 #include "device/bluetooth/bluetooth_device.h" | 18 #include "device/bluetooth/bluetooth_device.h" |
17 #include "device/bluetooth/bluetooth_socket.h" | 19 #include "device/bluetooth/bluetooth_socket.h" |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 | 88 |
87 // BluetoothAdapter::Observer: | 89 // BluetoothAdapter::Observer: |
88 void AdapterPresentChanged(device::BluetoothAdapter* adapter, | 90 void AdapterPresentChanged(device::BluetoothAdapter* adapter, |
89 bool present) override; | 91 bool present) override; |
90 | 92 |
91 // device::BluetoothDevice::PairingDelegate: | 93 // device::BluetoothDevice::PairingDelegate: |
92 void RequestPinCode(device::BluetoothDevice* device) override; | 94 void RequestPinCode(device::BluetoothDevice* device) override; |
93 void RequestPasskey(device::BluetoothDevice* device) override; | 95 void RequestPasskey(device::BluetoothDevice* device) override; |
94 void DisplayPinCode(device::BluetoothDevice* device, | 96 void DisplayPinCode(device::BluetoothDevice* device, |
95 const std::string& pincode) override; | 97 const std::string& pincode) override; |
96 void DisplayPasskey(device::BluetoothDevice* device, uint32 passkey) override; | 98 void DisplayPasskey(device::BluetoothDevice* device, |
97 void KeysEntered(device::BluetoothDevice* device, uint32 entered) override; | 99 uint32_t passkey) override; |
98 void ConfirmPasskey(device::BluetoothDevice* device, uint32 passkey) override; | 100 void KeysEntered(device::BluetoothDevice* device, uint32_t entered) override; |
| 101 void ConfirmPasskey(device::BluetoothDevice* device, |
| 102 uint32_t passkey) override; |
99 void AuthorizePairing(device::BluetoothDevice* device) override; | 103 void AuthorizePairing(device::BluetoothDevice* device) override; |
100 | 104 |
101 Stage current_stage_; | 105 Stage current_stage_; |
102 std::string device_name_; | 106 std::string device_name_; |
103 std::string confirmation_code_; | 107 std::string confirmation_code_; |
104 std::string enrollment_domain_; | 108 std::string enrollment_domain_; |
105 Connectivity connectivity_status_; | 109 Connectivity connectivity_status_; |
106 UpdateStatus update_status_; | 110 UpdateStatus update_status_; |
107 EnrollmentStatus enrollment_status_; | 111 EnrollmentStatus enrollment_status_; |
108 std::string permanent_id_; | 112 std::string permanent_id_; |
109 | 113 |
110 scoped_refptr<device::BluetoothAdapter> adapter_; | 114 scoped_refptr<device::BluetoothAdapter> adapter_; |
111 scoped_refptr<device::BluetoothSocket> service_socket_; | 115 scoped_refptr<device::BluetoothSocket> service_socket_; |
112 scoped_refptr<device::BluetoothSocket> controller_socket_; | 116 scoped_refptr<device::BluetoothSocket> controller_socket_; |
113 scoped_ptr<ProtoDecoder> proto_decoder_; | 117 scoped_ptr<ProtoDecoder> proto_decoder_; |
114 | 118 |
115 base::ThreadChecker thread_checker_; | 119 base::ThreadChecker thread_checker_; |
116 base::ObserverList<Observer> observers_; | 120 base::ObserverList<Observer> observers_; |
117 base::WeakPtrFactory<BluetoothHostPairingController> ptr_factory_; | 121 base::WeakPtrFactory<BluetoothHostPairingController> ptr_factory_; |
118 | 122 |
119 DISALLOW_COPY_AND_ASSIGN(BluetoothHostPairingController); | 123 DISALLOW_COPY_AND_ASSIGN(BluetoothHostPairingController); |
120 }; | 124 }; |
121 | 125 |
122 } // namespace pairing_chromeos | 126 } // namespace pairing_chromeos |
123 | 127 |
124 #endif // COMPONENTS_PAIRING_BLUETOOTH_HOST_PAIRING_CONTROLLER_H_ | 128 #endif // COMPONENTS_PAIRING_BLUETOOTH_HOST_PAIRING_CONTROLLER_H_ |
OLD | NEW |