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 CHROMEOS_PAIRING_BLUETOOTH_CONTROLLER_PAIRING_FLOW_H_ | 5 #ifndef CHROMEOS_PAIRING_BLUETOOTH_CONTROLLER_PAIRING_FLOW_H_ |
6 #define CHROMEOS_PAIRING_BLUETOOTH_CONTROLLER_PAIRING_FLOW_H_ | 6 #define CHROMEOS_PAIRING_BLUETOOTH_CONTROLLER_PAIRING_FLOW_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 21 matching lines...) Expand all Loading... |
32 BluetoothControllerPairingController(); | 32 BluetoothControllerPairingController(); |
33 virtual ~BluetoothControllerPairingController(); | 33 virtual ~BluetoothControllerPairingController(); |
34 | 34 |
35 private: | 35 private: |
36 void ChangeStage(Stage new_stage); | 36 void ChangeStage(Stage new_stage); |
37 device::BluetoothDevice* GetController(); | 37 device::BluetoothDevice* GetController(); |
38 void Reset(); | 38 void Reset(); |
39 void DeviceFound(device::BluetoothDevice* device); | 39 void DeviceFound(device::BluetoothDevice* device); |
40 void DeviceLost(device::BluetoothDevice* device); | 40 void DeviceLost(device::BluetoothDevice* device); |
41 void SendBuffer(scoped_refptr<net::IOBuffer> io_buffer, int size); | 41 void SendBuffer(scoped_refptr<net::IOBuffer> io_buffer, int size); |
| 42 void CompleteSetup(); |
42 | 43 |
43 void OnSetPowered(); | 44 void OnSetPowered(); |
44 void OnGetAdapter(scoped_refptr<device::BluetoothAdapter> adapter); | 45 void OnGetAdapter(scoped_refptr<device::BluetoothAdapter> adapter); |
45 void OnStartDiscoverySession( | 46 void OnStartDiscoverySession( |
46 scoped_ptr<device::BluetoothDiscoverySession> discovery_session); | 47 scoped_ptr<device::BluetoothDiscoverySession> discovery_session); |
47 void OnConnect(); | 48 void OnConnect(); |
48 void OnConnectToService(scoped_refptr<device::BluetoothSocket> socket); | 49 void OnConnectToService(scoped_refptr<device::BluetoothSocket> socket); |
49 void OnSendComplete(int bytes_sent); | 50 void OnSendComplete(int bytes_sent); |
50 void OnReceiveComplete(int bytes, scoped_refptr<net::IOBuffer> io_buffer); | 51 void OnReceiveComplete(int bytes, scoped_refptr<net::IOBuffer> io_buffer); |
51 | 52 |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 const std::string& pincode) override; | 102 const std::string& pincode) override; |
102 virtual void DisplayPasskey(device::BluetoothDevice* device, | 103 virtual void DisplayPasskey(device::BluetoothDevice* device, |
103 uint32 passkey) override; | 104 uint32 passkey) override; |
104 virtual void KeysEntered(device::BluetoothDevice* device, | 105 virtual void KeysEntered(device::BluetoothDevice* device, |
105 uint32 entered) override; | 106 uint32 entered) override; |
106 virtual void ConfirmPasskey(device::BluetoothDevice* device, | 107 virtual void ConfirmPasskey(device::BluetoothDevice* device, |
107 uint32 passkey) override; | 108 uint32 passkey) override; |
108 virtual void AuthorizePairing(device::BluetoothDevice* device) override; | 109 virtual void AuthorizePairing(device::BluetoothDevice* device) override; |
109 | 110 |
110 Stage current_stage_; | 111 Stage current_stage_; |
111 bool got_initial_status_; | |
112 scoped_refptr<device::BluetoothAdapter> adapter_; | 112 scoped_refptr<device::BluetoothAdapter> adapter_; |
113 scoped_ptr<device::BluetoothDiscoverySession> discovery_session_; | 113 scoped_ptr<device::BluetoothDiscoverySession> discovery_session_; |
114 scoped_refptr<device::BluetoothSocket> socket_; | 114 scoped_refptr<device::BluetoothSocket> socket_; |
115 std::string controller_device_id_; | 115 std::string controller_device_id_; |
116 | 116 |
117 std::string confirmation_code_; | 117 std::string confirmation_code_; |
118 std::set<std::string> discovered_devices_; | 118 std::set<std::string> discovered_devices_; |
119 | 119 |
120 scoped_ptr<ProtoDecoder> proto_decoder_; | 120 scoped_ptr<ProtoDecoder> proto_decoder_; |
121 | 121 |
122 base::ThreadChecker thread_checker_; | 122 base::ThreadChecker thread_checker_; |
123 ObserverList<ControllerPairingController::Observer> observers_; | 123 ObserverList<ControllerPairingController::Observer> observers_; |
124 base::WeakPtrFactory<BluetoothControllerPairingController> ptr_factory_; | 124 base::WeakPtrFactory<BluetoothControllerPairingController> ptr_factory_; |
125 | 125 |
126 DISALLOW_COPY_AND_ASSIGN(BluetoothControllerPairingController); | 126 DISALLOW_COPY_AND_ASSIGN(BluetoothControllerPairingController); |
127 }; | 127 }; |
128 | 128 |
129 } // namespace pairing_chromeos | 129 } // namespace pairing_chromeos |
130 | 130 |
131 #endif // CHROMEOS_PAIRING_BLUETOOTH_CONTROLLER_PAIRING_FLOW_H_ | 131 #endif // CHROMEOS_PAIRING_BLUETOOTH_CONTROLLER_PAIRING_FLOW_H_ |
OLD | NEW |