| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_H_ | 5 #ifndef DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_H_ |
| 6 #define DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_H_ | 6 #define DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 #include <map> | 9 #include <map> |
| 10 #include <set> | 10 #include <set> |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 // should not be cached. Instead, copy its Bluetooth address. | 75 // should not be cached. Instead, copy its Bluetooth address. |
| 76 virtual void DeviceAdded(BluetoothAdapter* adapter, | 76 virtual void DeviceAdded(BluetoothAdapter* adapter, |
| 77 BluetoothDevice* device) {} | 77 BluetoothDevice* device) {} |
| 78 | 78 |
| 79 // Called when properties of the device |device| known to the adapter | 79 // Called when properties of the device |device| known to the adapter |
| 80 // |adapter| change. |device| should not be cached. Instead, copy its | 80 // |adapter| change. |device| should not be cached. Instead, copy its |
| 81 // Bluetooth address. | 81 // Bluetooth address. |
| 82 virtual void DeviceChanged(BluetoothAdapter* adapter, | 82 virtual void DeviceChanged(BluetoothAdapter* adapter, |
| 83 BluetoothDevice* device) {} | 83 BluetoothDevice* device) {} |
| 84 | 84 |
| 85 // Called when address property of the device |device| known to the adapter |
| 86 // |adapter| change due to pairing. |
| 87 virtual void DeviceAddressChanged(BluetoothAdapter* adapter, |
| 88 BluetoothDevice* device, |
| 89 const std::string& old_address) {} |
| 90 |
| 85 // Called when the device |device| is removed from the adapter |adapter|, | 91 // Called when the device |device| is removed from the adapter |adapter|, |
| 86 // either as a result of a discovered device being lost between discovering | 92 // either as a result of a discovered device being lost between discovering |
| 87 // phases or pairing information deleted. |device| should not be | 93 // phases or pairing information deleted. |device| should not be |
| 88 // cached. Instead, copy its Bluetooth address. | 94 // cached. Instead, copy its Bluetooth address. |
| 89 virtual void DeviceRemoved(BluetoothAdapter* adapter, | 95 virtual void DeviceRemoved(BluetoothAdapter* adapter, |
| 90 BluetoothDevice* device) {} | 96 BluetoothDevice* device) {} |
| 91 | 97 |
| 92 // Called when a new GATT service |service| is added to the device |device|, | 98 // Called when a new GATT service |service| is added to the device |device|, |
| 93 // as the service is received from the device. Don't cache |service|. Store | 99 // as the service is received from the device. Don't cache |service|. Store |
| 94 // its identifier instead (i.e. BluetoothGattService::GetIdentifier). | 100 // its identifier instead (i.e. BluetoothGattService::GetIdentifier). |
| (...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 510 std::set<BluetoothDiscoverySession*> discovery_sessions_; | 516 std::set<BluetoothDiscoverySession*> discovery_sessions_; |
| 511 | 517 |
| 512 // Note: This should remain the last member so it'll be destroyed and | 518 // Note: This should remain the last member so it'll be destroyed and |
| 513 // invalidate its weak pointers before any other members are destroyed. | 519 // invalidate its weak pointers before any other members are destroyed. |
| 514 base::WeakPtrFactory<BluetoothAdapter> weak_ptr_factory_; | 520 base::WeakPtrFactory<BluetoothAdapter> weak_ptr_factory_; |
| 515 }; | 521 }; |
| 516 | 522 |
| 517 } // namespace device | 523 } // namespace device |
| 518 | 524 |
| 519 #endif // DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_H_ | 525 #endif // DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_H_ |
| OLD | NEW |