| 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 <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 // be a synthesied string containing the address and localized type name | 158 // be a synthesied string containing the address and localized type name |
| 159 // if the device has no obtained name. | 159 // if the device has no obtained name. |
| 160 virtual string16 GetName() const; | 160 virtual string16 GetName() const; |
| 161 | 161 |
| 162 // Returns the type of the device, limited to those we support or are | 162 // Returns the type of the device, limited to those we support or are |
| 163 // aware of, by decoding the bluetooth class information. The returned | 163 // aware of, by decoding the bluetooth class information. The returned |
| 164 // values are unique, and do not overlap, so DEVICE_KEYBOARD is not also | 164 // values are unique, and do not overlap, so DEVICE_KEYBOARD is not also |
| 165 // DEVICE_PERIPHERAL. | 165 // DEVICE_PERIPHERAL. |
| 166 DeviceType GetDeviceType() const; | 166 DeviceType GetDeviceType() const; |
| 167 | 167 |
| 168 // Indicates whether the device is known to support pairing based on its |
| 169 // device class and address. |
| 170 bool IsPairable() const; |
| 171 |
| 168 // Indicates whether the device is paired with the adapter. | 172 // Indicates whether the device is paired with the adapter. |
| 169 virtual bool IsPaired() const = 0; | 173 virtual bool IsPaired() const = 0; |
| 170 | 174 |
| 171 // Indicates whether the device is currently connected to the adapter. | 175 // Indicates whether the device is currently connected to the adapter. |
| 172 virtual bool IsConnected() const = 0; | 176 virtual bool IsConnected() const = 0; |
| 173 | 177 |
| 174 // Indicates whether the paired device accepts connections initiated from the | 178 // Indicates whether the paired device accepts connections initiated from the |
| 175 // adapter. This value is undefined for unpaired devices. | 179 // adapter. This value is undefined for unpaired devices. |
| 176 virtual bool IsConnectable() const = 0; | 180 virtual bool IsConnectable() const = 0; |
| 177 | 181 |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 322 | 326 |
| 323 private: | 327 private: |
| 324 // Returns a localized string containing the device's bluetooth address and | 328 // Returns a localized string containing the device's bluetooth address and |
| 325 // a device type for display when |name_| is empty. | 329 // a device type for display when |name_| is empty. |
| 326 string16 GetAddressWithLocalizedDeviceTypeName() const; | 330 string16 GetAddressWithLocalizedDeviceTypeName() const; |
| 327 }; | 331 }; |
| 328 | 332 |
| 329 } // namespace device | 333 } // namespace device |
| 330 | 334 |
| 331 #endif // DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_H_ | 335 #endif // DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_H_ |
| OLD | NEW |