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_PROXIMITY_AUTH_BLUETOOTH_CONNECTION_H | 5 #ifndef COMPONENTS_PROXIMITY_AUTH_BLUETOOTH_CONNECTION_H |
6 #define COMPONENTS_PROXIMITY_AUTH_BLUETOOTH_CONNECTION_H | 6 #define COMPONENTS_PROXIMITY_AUTH_BLUETOOTH_CONNECTION_H |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
(...skipping 17 matching lines...) Expand all Loading... |
28 class BluetoothConnection : public Connection, | 28 class BluetoothConnection : public Connection, |
29 public device::BluetoothAdapter::Observer { | 29 public device::BluetoothAdapter::Observer { |
30 public: | 30 public: |
31 // Constructs a Bluetooth connection to the service with |uuid| on the | 31 // Constructs a Bluetooth connection to the service with |uuid| on the |
32 // |remote_device|. The |remote_device| must already be known to the system | 32 // |remote_device|. The |remote_device| must already be known to the system |
33 // Bluetooth daemon. | 33 // Bluetooth daemon. |
34 BluetoothConnection(const RemoteDevice& remote_device, | 34 BluetoothConnection(const RemoteDevice& remote_device, |
35 const device::BluetoothUUID& uuid); | 35 const device::BluetoothUUID& uuid); |
36 ~BluetoothConnection() override; | 36 ~BluetoothConnection() override; |
37 | 37 |
38 protected: | |
39 // Connection: | 38 // Connection: |
40 void Connect() override; | 39 void Connect() override; |
41 void Disconnect() override; | 40 void Disconnect() override; |
| 41 |
| 42 protected: |
| 43 // Connection: |
42 void SendMessageImpl(scoped_ptr<WireMessage> message) override; | 44 void SendMessageImpl(scoped_ptr<WireMessage> message) override; |
43 | 45 |
44 // BluetoothAdapter::Observer: | 46 // BluetoothAdapter::Observer: |
45 void DeviceRemoved(device::BluetoothAdapter* adapter, | 47 void DeviceRemoved(device::BluetoothAdapter* adapter, |
46 device::BluetoothDevice* device) override; | 48 device::BluetoothDevice* device) override; |
47 | 49 |
48 private: | 50 private: |
49 // Registers receive callbacks with the backing |socket_|. | 51 // Registers receive callbacks with the backing |socket_|. |
50 void StartReceive(); | 52 void StartReceive(); |
51 | 53 |
(...skipping 24 matching lines...) Expand all Loading... |
76 scoped_ptr<WireMessage> pending_message_; | 78 scoped_ptr<WireMessage> pending_message_; |
77 | 79 |
78 base::WeakPtrFactory<BluetoothConnection> weak_ptr_factory_; | 80 base::WeakPtrFactory<BluetoothConnection> weak_ptr_factory_; |
79 | 81 |
80 DISALLOW_COPY_AND_ASSIGN(BluetoothConnection); | 82 DISALLOW_COPY_AND_ASSIGN(BluetoothConnection); |
81 }; | 83 }; |
82 | 84 |
83 } // namespace proximity_auth | 85 } // namespace proximity_auth |
84 | 86 |
85 #endif // COMPONENTS_PROXIMITY_AUTH_BLUETOOTH_CONNECTION_H | 87 #endif // COMPONENTS_PROXIMITY_AUTH_BLUETOOTH_CONNECTION_H |
OLD | NEW |