| 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 <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "device/bluetooth/bluetooth_utils.h" | |
| 11 #include "grit/device_bluetooth_strings.h" | 10 #include "grit/device_bluetooth_strings.h" |
| 12 #include "ui/base/l10n/l10n_util.h" | 11 #include "ui/base/l10n/l10n_util.h" |
| 13 | 12 |
| 14 namespace device { | 13 namespace device { |
| 15 | 14 |
| 16 // static | |
| 17 bool BluetoothDevice::IsUUIDValid(const std::string& uuid) { | |
| 18 return !bluetooth_utils::CanonicalUuid(uuid).empty(); | |
| 19 } | |
| 20 | |
| 21 BluetoothDevice::BluetoothDevice() { | 15 BluetoothDevice::BluetoothDevice() { |
| 22 } | 16 } |
| 23 | 17 |
| 24 BluetoothDevice::~BluetoothDevice() { | 18 BluetoothDevice::~BluetoothDevice() { |
| 25 } | 19 } |
| 26 | 20 |
| 27 base::string16 BluetoothDevice::GetName() const { | 21 base::string16 BluetoothDevice::GetName() const { |
| 28 std::string name = GetDeviceName(); | 22 std::string name = GetDeviceName(); |
| 29 if (!name.empty()) { | 23 if (!name.empty()) { |
| 30 return base::UTF8ToUTF16(name); | 24 return base::UTF8ToUTF16(name); |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 if ((type == DEVICE_MOUSE && vendor == "00:12:A1") || | 162 if ((type == DEVICE_MOUSE && vendor == "00:12:A1") || |
| 169 // Microsoft "Microsoft Bluetooth Notebook Mouse 5000", model X807028-001 | 163 // Microsoft "Microsoft Bluetooth Notebook Mouse 5000", model X807028-001 |
| 170 (type == DEVICE_MOUSE && vendor == "7C:ED:8D")) | 164 (type == DEVICE_MOUSE && vendor == "7C:ED:8D")) |
| 171 return false; | 165 return false; |
| 172 // TODO: Move this database into a config file. | 166 // TODO: Move this database into a config file. |
| 173 | 167 |
| 174 return true; | 168 return true; |
| 175 } | 169 } |
| 176 | 170 |
| 177 } // namespace device | 171 } // namespace device |
| OLD | NEW |