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 26 matching lines...) Expand all Loading... |
37 | 37 |
38 // Connection: | 38 // Connection: |
39 void Connect() override; | 39 void Connect() override; |
40 void Disconnect() override; | 40 void Disconnect() override; |
41 | 41 |
42 protected: | 42 protected: |
43 // Connection: | 43 // Connection: |
44 void SendMessageImpl(scoped_ptr<WireMessage> message) override; | 44 void SendMessageImpl(scoped_ptr<WireMessage> message) override; |
45 | 45 |
46 // BluetoothAdapter::Observer: | 46 // BluetoothAdapter::Observer: |
| 47 void DeviceChanged(device::BluetoothAdapter* adapter, |
| 48 device::BluetoothDevice* device) override; |
47 void DeviceRemoved(device::BluetoothAdapter* adapter, | 49 void DeviceRemoved(device::BluetoothAdapter* adapter, |
48 device::BluetoothDevice* device) override; | 50 device::BluetoothDevice* device) override; |
49 | 51 |
50 private: | 52 private: |
51 // Registers receive callbacks with the backing |socket_|. | 53 // Registers receive callbacks with the backing |socket_|. |
52 void StartReceive(); | 54 void StartReceive(); |
53 | 55 |
54 // Callbacks for asynchronous Bluetooth operations. | 56 // Callbacks for asynchronous Bluetooth operations. |
55 void OnAdapterInitialized(scoped_refptr<device::BluetoothAdapter> adapter); | 57 void OnAdapterInitialized(scoped_refptr<device::BluetoothAdapter> adapter); |
56 void OnConnected(scoped_refptr<device::BluetoothSocket> socket); | 58 void OnConnected(scoped_refptr<device::BluetoothSocket> socket); |
(...skipping 21 matching lines...) Expand all Loading... |
78 scoped_ptr<WireMessage> pending_message_; | 80 scoped_ptr<WireMessage> pending_message_; |
79 | 81 |
80 base::WeakPtrFactory<BluetoothConnection> weak_ptr_factory_; | 82 base::WeakPtrFactory<BluetoothConnection> weak_ptr_factory_; |
81 | 83 |
82 DISALLOW_COPY_AND_ASSIGN(BluetoothConnection); | 84 DISALLOW_COPY_AND_ASSIGN(BluetoothConnection); |
83 }; | 85 }; |
84 | 86 |
85 } // namespace proximity_auth | 87 } // namespace proximity_auth |
86 | 88 |
87 #endif // COMPONENTS_PROXIMITY_AUTH_BLUETOOTH_CONNECTION_H | 89 #endif // COMPONENTS_PROXIMITY_AUTH_BLUETOOTH_CONNECTION_H |
OLD | NEW |