| 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_DEVICE_H_ | 5 #ifndef DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_H_ |
| 6 #define DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_H_ | 6 #define DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 270 | 270 |
| 271 // Indicates whether the paired device accepts connections initiated from the | 271 // Indicates whether the paired device accepts connections initiated from the |
| 272 // adapter. This value is undefined for unpaired devices. | 272 // adapter. This value is undefined for unpaired devices. |
| 273 virtual bool IsConnectable() const = 0; | 273 virtual bool IsConnectable() const = 0; |
| 274 | 274 |
| 275 // Indicates whether there is a call to Connect() ongoing. For this attribute, | 275 // Indicates whether there is a call to Connect() ongoing. For this attribute, |
| 276 // we consider a call is ongoing if none of the callbacks passed to Connect() | 276 // we consider a call is ongoing if none of the callbacks passed to Connect() |
| 277 // were called after the corresponding call to Connect(). | 277 // were called after the corresponding call to Connect(). |
| 278 virtual bool IsConnecting() const = 0; | 278 virtual bool IsConnecting() const = 0; |
| 279 | 279 |
| 280 // Indicates whether the device can be trusted, based on device properties, |
| 281 // such as vendor and product id. |
| 282 bool IsTrustable() const; |
| 283 |
| 280 // Returns the set of UUIDs that this device supports. For classic Bluetooth | 284 // Returns the set of UUIDs that this device supports. For classic Bluetooth |
| 281 // devices this data is collected from both the EIR data and SDP tables, | 285 // devices this data is collected from both the EIR data and SDP tables, |
| 282 // for Low Energy devices this data is collected from AD and GATT primary | 286 // for Low Energy devices this data is collected from AD and GATT primary |
| 283 // services, for dual mode devices this may be collected from both./ | 287 // services, for dual mode devices this may be collected from both./ |
| 284 typedef std::vector<BluetoothUUID> UUIDList; | 288 typedef std::vector<BluetoothUUID> UUIDList; |
| 285 virtual UUIDList GetUUIDs() const = 0; | 289 virtual UUIDList GetUUIDs() const = 0; |
| 286 | 290 |
| 287 // The ErrorCallback is used for methods that can fail in which case it | 291 // The ErrorCallback is used for methods that can fail in which case it |
| 288 // is called, in the success case the callback is simply not called. | 292 // is called, in the success case the callback is simply not called. |
| 289 typedef base::Callback<void()> ErrorCallback; | 293 typedef base::Callback<void()> ErrorCallback; |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 431 | 435 |
| 432 private: | 436 private: |
| 433 // Returns a localized string containing the device's bluetooth address and | 437 // Returns a localized string containing the device's bluetooth address and |
| 434 // a device type for display when |name_| is empty. | 438 // a device type for display when |name_| is empty. |
| 435 base::string16 GetAddressWithLocalizedDeviceTypeName() const; | 439 base::string16 GetAddressWithLocalizedDeviceTypeName() const; |
| 436 }; | 440 }; |
| 437 | 441 |
| 438 } // namespace device | 442 } // namespace device |
| 439 | 443 |
| 440 #endif // DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_H_ | 444 #endif // DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_H_ |
| OLD | NEW |