| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_mac.h" | 5 #include "device/bluetooth/bluetooth_device_mac.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/hash.h" | 10 #include "base/hash.h" |
| (...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 245 inType:power_level_type | 245 inType:power_level_type |
| 246 outTransmitPowerLevel:&power_level]; | 246 outTransmitPowerLevel:&power_level]; |
| 247 if (result != kIOReturnSuccess) | 247 if (result != kIOReturnSuccess) |
| 248 return kUnknownPower; | 248 return kUnknownPower; |
| 249 | 249 |
| 250 return power_level; | 250 return power_level; |
| 251 } | 251 } |
| 252 | 252 |
| 253 // static | 253 // static |
| 254 std::string BluetoothDeviceMac::GetDeviceAddress(IOBluetoothDevice* device) { | 254 std::string BluetoothDeviceMac::GetDeviceAddress(IOBluetoothDevice* device) { |
| 255 return NormalizeAddress(base::SysNSStringToUTF8([device addressString])); | 255 return CanonicalizeAddress(base::SysNSStringToUTF8([device addressString])); |
| 256 } | |
| 257 | |
| 258 // static | |
| 259 std::string BluetoothDeviceMac::NormalizeAddress(const std::string& address) { | |
| 260 std::string normalized; | |
| 261 base::ReplaceChars(address, "-", ":", &normalized); | |
| 262 // TODO(isherman): Restore StringToUpperASCII(&normalized) call for M37. | |
| 263 // http://crbug.com/371014 | |
| 264 return normalized; | |
| 265 } | 256 } |
| 266 | 257 |
| 267 } // namespace device | 258 } // namespace device |
| OLD | NEW |