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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 void OnReceiveComplete(int bytes, scoped_refptr<net::IOBuffer> io_buffer); | 50 void OnReceiveComplete(int bytes, scoped_refptr<net::IOBuffer> io_buffer); |
51 | 51 |
52 void OnError(); | 52 void OnError(); |
53 void OnErrorWithMessage(const std::string& message); | 53 void OnErrorWithMessage(const std::string& message); |
54 void OnConnectError(device::BluetoothDevice::ConnectErrorCode error_code); | 54 void OnConnectError(device::BluetoothDevice::ConnectErrorCode error_code); |
55 void OnReceiveError(device::BluetoothSocket::ErrorReason reason, | 55 void OnReceiveError(device::BluetoothSocket::ErrorReason reason, |
56 const std::string& error_message); | 56 const std::string& error_message); |
57 | 57 |
58 // ControllerPairingController: | 58 // ControllerPairingController: |
59 virtual void AddObserver( | 59 virtual void AddObserver( |
60 ControllerPairingController::Observer* observer) OVERRIDE; | 60 ControllerPairingController::Observer* observer) override; |
61 virtual void RemoveObserver( | 61 virtual void RemoveObserver( |
62 ControllerPairingController::Observer* observer) OVERRIDE; | 62 ControllerPairingController::Observer* observer) override; |
63 virtual Stage GetCurrentStage() OVERRIDE; | 63 virtual Stage GetCurrentStage() override; |
64 virtual void StartPairing() OVERRIDE; | 64 virtual void StartPairing() override; |
65 virtual DeviceIdList GetDiscoveredDevices() OVERRIDE; | 65 virtual DeviceIdList GetDiscoveredDevices() override; |
66 virtual void ChooseDeviceForPairing(const std::string& device_id) OVERRIDE; | 66 virtual void ChooseDeviceForPairing(const std::string& device_id) override; |
67 virtual void RepeatDiscovery() OVERRIDE; | 67 virtual void RepeatDiscovery() override; |
68 virtual std::string GetConfirmationCode() OVERRIDE; | 68 virtual std::string GetConfirmationCode() override; |
69 virtual void SetConfirmationCodeIsCorrect(bool correct) OVERRIDE; | 69 virtual void SetConfirmationCodeIsCorrect(bool correct) override; |
70 virtual void SetHostConfiguration( | 70 virtual void SetHostConfiguration( |
71 bool accepted_eula, | 71 bool accepted_eula, |
72 const std::string& lang, | 72 const std::string& lang, |
73 const std::string& timezone, | 73 const std::string& timezone, |
74 bool send_reports, | 74 bool send_reports, |
75 const std::string& keyboard_layout) OVERRIDE; | 75 const std::string& keyboard_layout) override; |
76 virtual void OnAuthenticationDone(const std::string& domain, | 76 virtual void OnAuthenticationDone(const std::string& domain, |
77 const std::string& auth_token) OVERRIDE; | 77 const std::string& auth_token) override; |
78 virtual void StartSession() OVERRIDE; | 78 virtual void StartSession() override; |
79 | 79 |
80 // ProtoDecoder::Observer: | 80 // ProtoDecoder::Observer: |
81 virtual void OnHostStatusMessage( | 81 virtual void OnHostStatusMessage( |
82 const pairing_api::HostStatus& message) OVERRIDE; | 82 const pairing_api::HostStatus& message) override; |
83 virtual void OnConfigureHostMessage( | 83 virtual void OnConfigureHostMessage( |
84 const pairing_api::ConfigureHost& message) OVERRIDE; | 84 const pairing_api::ConfigureHost& message) override; |
85 virtual void OnPairDevicesMessage( | 85 virtual void OnPairDevicesMessage( |
86 const pairing_api::PairDevices& message) OVERRIDE; | 86 const pairing_api::PairDevices& message) override; |
87 virtual void OnCompleteSetupMessage( | 87 virtual void OnCompleteSetupMessage( |
88 const pairing_api::CompleteSetup& message) OVERRIDE; | 88 const pairing_api::CompleteSetup& message) override; |
89 virtual void OnErrorMessage(const pairing_api::Error& message) OVERRIDE; | 89 virtual void OnErrorMessage(const pairing_api::Error& message) override; |
90 | 90 |
91 // BluetoothAdapter::Observer: | 91 // BluetoothAdapter::Observer: |
92 virtual void DeviceAdded(device::BluetoothAdapter* adapter, | 92 virtual void DeviceAdded(device::BluetoothAdapter* adapter, |
93 device::BluetoothDevice* device) OVERRIDE; | 93 device::BluetoothDevice* device) override; |
94 virtual void DeviceRemoved(device::BluetoothAdapter* adapter, | 94 virtual void DeviceRemoved(device::BluetoothAdapter* adapter, |
95 device::BluetoothDevice* device) OVERRIDE; | 95 device::BluetoothDevice* device) override; |
96 | 96 |
97 // device::BluetoothDevice::PairingDelegate: | 97 // device::BluetoothDevice::PairingDelegate: |
98 virtual void RequestPinCode(device::BluetoothDevice* device) OVERRIDE; | 98 virtual void RequestPinCode(device::BluetoothDevice* device) override; |
99 virtual void RequestPasskey(device::BluetoothDevice* device) OVERRIDE; | 99 virtual void RequestPasskey(device::BluetoothDevice* device) override; |
100 virtual void DisplayPinCode(device::BluetoothDevice* device, | 100 virtual void DisplayPinCode(device::BluetoothDevice* device, |
101 const std::string& pincode) OVERRIDE; | 101 const std::string& pincode) override; |
102 virtual void DisplayPasskey(device::BluetoothDevice* device, | 102 virtual void DisplayPasskey(device::BluetoothDevice* device, |
103 uint32 passkey) OVERRIDE; | 103 uint32 passkey) override; |
104 virtual void KeysEntered(device::BluetoothDevice* device, | 104 virtual void KeysEntered(device::BluetoothDevice* device, |
105 uint32 entered) OVERRIDE; | 105 uint32 entered) override; |
106 virtual void ConfirmPasskey(device::BluetoothDevice* device, | 106 virtual void ConfirmPasskey(device::BluetoothDevice* device, |
107 uint32 passkey) OVERRIDE; | 107 uint32 passkey) override; |
108 virtual void AuthorizePairing(device::BluetoothDevice* device) OVERRIDE; | 108 virtual void AuthorizePairing(device::BluetoothDevice* device) override; |
109 | 109 |
110 Stage current_stage_; | 110 Stage current_stage_; |
111 bool got_initial_status_; | 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 |