Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(402)

Side by Side Diff: components/pairing/bluetooth_host_pairing_controller.h

Issue 2937253003: cros: Replace BrowserThread::FILE in InputServiceProxy (Closed)
Patch Set: for #2 Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 <memory> 10 #include <memory>
11 11
12 #include "base/macros.h" 12 #include "base/macros.h"
13 #include "base/memory/ref_counted.h" 13 #include "base/memory/ref_counted.h"
14 #include "base/memory/weak_ptr.h" 14 #include "base/memory/weak_ptr.h"
15 #include "base/observer_list.h" 15 #include "base/observer_list.h"
16 #include "base/threading/thread_checker.h" 16 #include "base/threading/thread_checker.h"
17 #include "components/pairing/host_pairing_controller.h" 17 #include "components/pairing/host_pairing_controller.h"
18 #include "components/pairing/proto_decoder.h" 18 #include "components/pairing/proto_decoder.h"
19 #include "device/bluetooth/bluetooth_adapter.h" 19 #include "device/bluetooth/bluetooth_adapter.h"
20 #include "device/bluetooth/bluetooth_device.h" 20 #include "device/bluetooth/bluetooth_device.h"
21 #include "device/bluetooth/bluetooth_socket.h" 21 #include "device/bluetooth/bluetooth_socket.h"
22 #include "device/hid/input_service_linux.h" 22 #include "device/hid/input_service_linux.h"
23 23
24 namespace base { 24 namespace base {
25 class SingleThreadTaskRunner; 25 class TaskRunner;
26 } 26 }
27 27
28 namespace device { 28 namespace device {
29 class BluetoothAdapter; 29 class BluetoothAdapter;
30 } 30 }
31 31
32 namespace net { 32 namespace net {
33 class IOBuffer; 33 class IOBuffer;
34 } 34 }
35 35
(...skipping 19 matching lines...) Expand all
55 55
56 protected: 56 protected:
57 TestDelegate() {} 57 TestDelegate() {}
58 virtual ~TestDelegate() {} 58 virtual ~TestDelegate() {}
59 59
60 private: 60 private:
61 DISALLOW_COPY_AND_ASSIGN(TestDelegate); 61 DISALLOW_COPY_AND_ASSIGN(TestDelegate);
62 }; 62 };
63 63
64 explicit BluetoothHostPairingController( 64 explicit BluetoothHostPairingController(
65 const scoped_refptr<base::SingleThreadTaskRunner>& file_task_runner); 65 const scoped_refptr<base::TaskRunner>& input_service_task_runner);
fdoray 2017/06/20 12:42:39 Pass by value instead of by const reference and st
xiyuan 2017/06/20 15:26:55 Done.
66 ~BluetoothHostPairingController() override; 66 ~BluetoothHostPairingController() override;
67 67
68 // These functions should be only used in tests. 68 // These functions should be only used in tests.
69 void SetDelegateForTesting(TestDelegate* delegate); 69 void SetDelegateForTesting(TestDelegate* delegate);
70 scoped_refptr<device::BluetoothAdapter> GetAdapterForTesting(); 70 scoped_refptr<device::BluetoothAdapter> GetAdapterForTesting();
71 71
72 private: 72 private:
73 friend class chromeos::BluetoothHostPairingNoInputTest; 73 friend class chromeos::BluetoothHostPairingNoInputTest;
74 74
75 void ChangeStage(Stage new_stage); 75 void ChangeStage(Stage new_stage);
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 void RequestPasskey(device::BluetoothDevice* device) override; 131 void RequestPasskey(device::BluetoothDevice* device) override;
132 void DisplayPinCode(device::BluetoothDevice* device, 132 void DisplayPinCode(device::BluetoothDevice* device,
133 const std::string& pincode) override; 133 const std::string& pincode) override;
134 void DisplayPasskey(device::BluetoothDevice* device, 134 void DisplayPasskey(device::BluetoothDevice* device,
135 uint32_t passkey) override; 135 uint32_t passkey) override;
136 void KeysEntered(device::BluetoothDevice* device, uint32_t entered) override; 136 void KeysEntered(device::BluetoothDevice* device, uint32_t entered) override;
137 void ConfirmPasskey(device::BluetoothDevice* device, 137 void ConfirmPasskey(device::BluetoothDevice* device,
138 uint32_t passkey) override; 138 uint32_t passkey) override;
139 void AuthorizePairing(device::BluetoothDevice* device) override; 139 void AuthorizePairing(device::BluetoothDevice* device) override;
140 140
141 Stage current_stage_; 141 Stage current_stage_ = STAGE_NONE;
142 std::string confirmation_code_; 142 std::string confirmation_code_;
143 std::string enrollment_domain_; 143 std::string enrollment_domain_;
144 Connectivity connectivity_status_; 144 Connectivity connectivity_status_ = CONNECTIVITY_UNTESTED;
145 UpdateStatus update_status_; 145 UpdateStatus update_status_ = UPDATE_STATUS_UNKNOWN;
146 EnrollmentStatus enrollment_status_; 146 EnrollmentStatus enrollment_status_ = ENROLLMENT_STATUS_UNKNOWN;
147 std::string permanent_id_; 147 std::string permanent_id_;
148 std::string controller_device_address_; 148 std::string controller_device_address_;
149 bool was_powered_ = false; 149 bool was_powered_ = false;
150 150
151 scoped_refptr<device::BluetoothAdapter> adapter_; 151 scoped_refptr<device::BluetoothAdapter> adapter_;
152 scoped_refptr<device::BluetoothSocket> service_socket_; 152 scoped_refptr<device::BluetoothSocket> service_socket_;
153 scoped_refptr<device::BluetoothSocket> controller_socket_; 153 scoped_refptr<device::BluetoothSocket> controller_socket_;
154 std::unique_ptr<ProtoDecoder> proto_decoder_; 154 std::unique_ptr<ProtoDecoder> proto_decoder_;
155 TestDelegate* delegate_ = nullptr; 155 TestDelegate* delegate_ = nullptr;
156 156
157 scoped_refptr<base::SingleThreadTaskRunner> file_task_runner_; 157 scoped_refptr<base::TaskRunner> input_service_task_runner_;
158 base::ThreadChecker thread_checker_; 158 THREAD_CHECKER(thread_checker_);
159 base::ObserverList<Observer> observers_; 159 base::ObserverList<Observer> observers_;
160 base::WeakPtrFactory<BluetoothHostPairingController> ptr_factory_; 160 base::WeakPtrFactory<BluetoothHostPairingController> ptr_factory_{this};
161 161
162 DISALLOW_COPY_AND_ASSIGN(BluetoothHostPairingController); 162 DISALLOW_COPY_AND_ASSIGN(BluetoothHostPairingController);
163 }; 163 };
164 164
165 } // namespace pairing_chromeos 165 } // namespace pairing_chromeos
166 166
167 #endif // COMPONENTS_PAIRING_BLUETOOTH_HOST_PAIRING_CONTROLLER_H_ 167 #endif // COMPONENTS_PAIRING_BLUETOOTH_HOST_PAIRING_CONTROLLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698