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> | 8 #include <stdint.h> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 27 matching lines...) Expand all Loading... |
38 using Observer = HostPairingController::Observer; | 38 using Observer = HostPairingController::Observer; |
39 using InputDeviceInfo = device::InputServiceLinux::InputDeviceInfo; | 39 using InputDeviceInfo = device::InputServiceLinux::InputDeviceInfo; |
40 | 40 |
41 explicit BluetoothHostPairingController( | 41 explicit BluetoothHostPairingController( |
42 const scoped_refptr<base::SingleThreadTaskRunner>& file_task_runner); | 42 const scoped_refptr<base::SingleThreadTaskRunner>& file_task_runner); |
43 ~BluetoothHostPairingController() override; | 43 ~BluetoothHostPairingController() override; |
44 | 44 |
45 private: | 45 private: |
46 void ChangeStage(Stage new_stage); | 46 void ChangeStage(Stage new_stage); |
47 void SendHostStatus(); | 47 void SendHostStatus(); |
48 void Reset(); | |
49 | 48 |
50 void OnGetAdapter(scoped_refptr<device::BluetoothAdapter> adapter); | 49 void OnGetAdapter(scoped_refptr<device::BluetoothAdapter> adapter); |
51 void SetName(); | 50 void SetName(); |
52 void OnSetName(); | 51 void OnSetName(); |
53 void OnSetPowered(); | 52 void OnSetPowered(); |
54 void OnCreateService(scoped_refptr<device::BluetoothSocket> socket); | 53 void OnCreateService(scoped_refptr<device::BluetoothSocket> socket); |
55 void OnSetDiscoverable(bool change_stage); | 54 void OnSetDiscoverable(bool change_stage); |
56 void OnAccept(const device::BluetoothDevice* device, | 55 void OnAccept(const device::BluetoothDevice* device, |
57 scoped_refptr<device::BluetoothSocket> socket); | 56 scoped_refptr<device::BluetoothSocket> socket); |
58 void OnSendComplete(int bytes_sent); | 57 void OnSendComplete(int bytes_sent); |
(...skipping 12 matching lines...) Expand all Loading... |
71 void RemoveObserver(Observer* observer) override; | 70 void RemoveObserver(Observer* observer) override; |
72 Stage GetCurrentStage() override; | 71 Stage GetCurrentStage() override; |
73 void StartPairing() override; | 72 void StartPairing() override; |
74 std::string GetDeviceName() override; | 73 std::string GetDeviceName() override; |
75 std::string GetConfirmationCode() override; | 74 std::string GetConfirmationCode() override; |
76 std::string GetEnrollmentDomain() override; | 75 std::string GetEnrollmentDomain() override; |
77 void OnNetworkConnectivityChanged(Connectivity connectivity_status) override; | 76 void OnNetworkConnectivityChanged(Connectivity connectivity_status) override; |
78 void OnUpdateStatusChanged(UpdateStatus update_status) override; | 77 void OnUpdateStatusChanged(UpdateStatus update_status) override; |
79 void OnEnrollmentStatusChanged(EnrollmentStatus enrollment_status) override; | 78 void OnEnrollmentStatusChanged(EnrollmentStatus enrollment_status) override; |
80 void SetPermanentId(const std::string& permanent_id) override; | 79 void SetPermanentId(const std::string& permanent_id) override; |
| 80 void Reset() override; |
81 | 81 |
82 // ProtoDecoder::Observer: | 82 // ProtoDecoder::Observer: |
83 void OnHostStatusMessage(const pairing_api::HostStatus& message) override; | 83 void OnHostStatusMessage(const pairing_api::HostStatus& message) override; |
84 void OnConfigureHostMessage( | 84 void OnConfigureHostMessage( |
85 const pairing_api::ConfigureHost& message) override; | 85 const pairing_api::ConfigureHost& message) override; |
86 void OnPairDevicesMessage(const pairing_api::PairDevices& message) override; | 86 void OnPairDevicesMessage(const pairing_api::PairDevices& message) override; |
87 void OnCompleteSetupMessage( | 87 void OnCompleteSetupMessage( |
88 const pairing_api::CompleteSetup& message) override; | 88 const pairing_api::CompleteSetup& message) override; |
89 void OnErrorMessage(const pairing_api::Error& message) override; | 89 void OnErrorMessage(const pairing_api::Error& message) override; |
90 void OnAddNetworkMessage(const pairing_api::AddNetwork& message) override; | 90 void OnAddNetworkMessage(const pairing_api::AddNetwork& message) override; |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 base::ThreadChecker thread_checker_; | 124 base::ThreadChecker thread_checker_; |
125 base::ObserverList<Observer> observers_; | 125 base::ObserverList<Observer> observers_; |
126 base::WeakPtrFactory<BluetoothHostPairingController> ptr_factory_; | 126 base::WeakPtrFactory<BluetoothHostPairingController> ptr_factory_; |
127 | 127 |
128 DISALLOW_COPY_AND_ASSIGN(BluetoothHostPairingController); | 128 DISALLOW_COPY_AND_ASSIGN(BluetoothHostPairingController); |
129 }; | 129 }; |
130 | 130 |
131 } // namespace pairing_chromeos | 131 } // namespace pairing_chromeos |
132 | 132 |
133 #endif // COMPONENTS_PAIRING_BLUETOOTH_HOST_PAIRING_CONTROLLER_H_ | 133 #endif // COMPONENTS_PAIRING_BLUETOOTH_HOST_PAIRING_CONTROLLER_H_ |
OLD | NEW |