Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(132)

Side by Side Diff: device/bluetooth/bluetooth_device.cc

Issue 2017393002: bluetooth: Rename device's GetName to GetNameForDisplay (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « device/bluetooth/bluetooth_device.h ('k') | device/bluetooth/bluetooth_device_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « device/bluetooth/bluetooth_device.h ('k') | device/bluetooth/bluetooth_device_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698