Chromium Code Reviews| Index: device/bluetooth/bluetooth_adapter_factory.cc |
| diff --git a/device/bluetooth/bluetooth_adapter_factory.cc b/device/bluetooth/bluetooth_adapter_factory.cc |
| index 61aa3dc7a6abb83efac1f7bcc609e95f122d3e4b..2582d915b6ce156bc2948dfd216fbda979fd0a05 100644 |
| --- a/device/bluetooth/bluetooth_adapter_factory.cc |
| +++ b/device/bluetooth/bluetooth_adapter_factory.cc |
| @@ -8,6 +8,7 @@ |
| #include "base/bind.h" |
| #include "base/lazy_instance.h" |
| +#include "base/mac/mac_util.h" |
| #include "base/memory/ref_counted.h" |
| #include "base/memory/weak_ptr.h" |
| #include "build/build_config.h" |
| @@ -63,6 +64,24 @@ bool BluetoothAdapterFactory::IsBluetoothAdapterAvailable() { |
| #endif |
| } |
| +// static |
| +bool BluetoothAdapterFactory::IsLowEnergyAvailable() { |
| + DCHECK(IsBluetoothAdapterAvailable()); |
| + |
| + // SetAdapterForTesting() may be used to provide a test or mock adapter |
| + // instance even on platforms that would otherwise not support it. |
| + if (default_adapter.Get()) |
| + return true; |
| +#if defined(OS_ANDROID) || defined(OS_CHROMEOS) || defined(OS_WIN) || \ |
|
ortuno
2016/10/04 03:20:24
We have a couple of issues to remove devices the u
François Beaufort
2016/10/04 10:00:22
So you want Web Bluetooth chooser to not show up o
ortuno
2016/10/04 21:23:16
Now that I think about it the only way to use Web
|
| + defined(OS_LINUX) |
| + return true; |
| +#endif |
| +#if defined(OS_MACOSX) |
|
ortuno
2016/10/04 03:20:24
nit: Could you combine this with the previous line
François Beaufort
2016/10/04 10:00:22
Done.
|
| + return base::mac::IsAtLeastOS10_10(); |
| +#endif |
|
ortuno
2016/10/04 03:20:24
nit: comment missing:
// defined(OS_ANDROID) || de
François Beaufort
2016/10/04 10:00:22
Done.
|
| + return false; |
| +} |
| + |
| // static |
| void BluetoothAdapterFactory::GetAdapter(const AdapterCallback& callback) { |
| DCHECK(IsBluetoothAdapterAvailable()); |