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 #include "device/bluetooth/bluetooth_device.h" | 5 #include "device/bluetooth/bluetooth_device.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
(...skipping 26 matching lines...) Expand all Loading... |
37 max_transmit_power(kUnknownPower) {} | 37 max_transmit_power(kUnknownPower) {} |
38 | 38 |
39 BluetoothDevice::ConnectionInfo::ConnectionInfo( | 39 BluetoothDevice::ConnectionInfo::ConnectionInfo( |
40 int rssi, int transmit_power, int max_transmit_power) | 40 int rssi, int transmit_power, int max_transmit_power) |
41 : rssi(rssi), | 41 : rssi(rssi), |
42 transmit_power(transmit_power), | 42 transmit_power(transmit_power), |
43 max_transmit_power(max_transmit_power) {} | 43 max_transmit_power(max_transmit_power) {} |
44 | 44 |
45 BluetoothDevice::ConnectionInfo::~ConnectionInfo() {} | 45 BluetoothDevice::ConnectionInfo::~ConnectionInfo() {} |
46 | 46 |
47 base::string16 BluetoothDevice::GetName() const { | 47 base::string16 BluetoothDevice::GetNameForDisplay() const { |
48 std::string name = GetDeviceName(); | 48 std::string name = GetDeviceName(); |
49 if (!name.empty()) { | 49 if (!name.empty()) { |
50 return base::UTF8ToUTF16(name); | 50 return base::UTF8ToUTF16(name); |
51 } else { | 51 } else { |
52 return GetAddressWithLocalizedDeviceTypeName(); | 52 return GetAddressWithLocalizedDeviceTypeName(); |
53 } | 53 } |
54 } | 54 } |
55 | 55 |
56 base::string16 BluetoothDevice::GetAddressWithLocalizedDeviceTypeName() const { | 56 base::string16 BluetoothDevice::GetAddressWithLocalizedDeviceTypeName() const { |
57 base::string16 address_utf16 = base::UTF8ToUTF16(GetAddress()); | 57 base::string16 address_utf16 = base::UTF8ToUTF16(GetAddress()); |
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
385 base::BinaryValue::CreateWithCopiedBuffer(buffer, size)); | 385 base::BinaryValue::CreateWithCopiedBuffer(buffer, size)); |
386 } | 386 } |
387 | 387 |
388 void BluetoothDevice::Pair(PairingDelegate* pairing_delegate, | 388 void BluetoothDevice::Pair(PairingDelegate* pairing_delegate, |
389 const base::Closure& callback, | 389 const base::Closure& callback, |
390 const ConnectErrorCallback& error_callback) { | 390 const ConnectErrorCallback& error_callback) { |
391 NOTREACHED(); | 391 NOTREACHED(); |
392 } | 392 } |
393 | 393 |
394 } // namespace device | 394 } // namespace device |
OLD | NEW |