OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_DEVICE_MAC_H_ | 5 #ifndef DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_MAC_H_ |
6 #define DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_MAC_H_ | 6 #define DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_MAC_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "device/bluetooth/bluetooth_device.h" | 9 #include "device/bluetooth/bluetooth_device.h" |
10 | 10 |
11 @class NSDate; | 11 @class NSDate; |
12 | 12 |
13 namespace device { | 13 namespace device { |
14 | 14 |
15 class BluetoothAdapterMac; | 15 class BluetoothAdapterMac; |
16 | 16 |
17 class DEVICE_BLUETOOTH_EXPORT BluetoothDeviceMac : public BluetoothDevice { | 17 class DEVICE_BLUETOOTH_EXPORT BluetoothDeviceMac : public BluetoothDevice { |
18 public: | 18 public: |
19 ~BluetoothDeviceMac() override; | 19 ~BluetoothDeviceMac() override; |
20 | 20 |
21 // Returns the time of the most recent interaction with the device. Returns | |
22 // nil if the device has never been seen. | |
23 virtual NSDate* GetLastUpdateTime() const = 0; | |
24 | |
25 // Converts between ConnectErrorCode and NSError. | 21 // Converts between ConnectErrorCode and NSError. |
26 static NSError* GetNSErrorFromConnectErrorCode( | 22 static NSError* GetNSErrorFromConnectErrorCode( |
27 BluetoothDevice::ConnectErrorCode error_code); | 23 BluetoothDevice::ConnectErrorCode error_code); |
28 static BluetoothDevice::ConnectErrorCode GetConnectErrorCodeFromNSError( | 24 static BluetoothDevice::ConnectErrorCode GetConnectErrorCodeFromNSError( |
29 NSError* error); | 25 NSError* error); |
30 | 26 |
31 protected: | 27 protected: |
32 BluetoothDeviceMac(BluetoothAdapterMac* adapter); | 28 BluetoothDeviceMac(BluetoothAdapterMac* adapter); |
33 | 29 |
34 DISALLOW_COPY_AND_ASSIGN(BluetoothDeviceMac); | 30 DISALLOW_COPY_AND_ASSIGN(BluetoothDeviceMac); |
35 }; | 31 }; |
36 | 32 |
37 } // namespace device | 33 } // namespace device |
38 | 34 |
39 #endif // DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_MAC_H_ | 35 #endif // DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_MAC_H_ |
OLD | NEW |