Index: chrome/browser/extensions/api/easy_unlock_private/easy_unlock_private_api.cc |
diff --git a/chrome/browser/extensions/api/easy_unlock_private/easy_unlock_private_api.cc b/chrome/browser/extensions/api/easy_unlock_private/easy_unlock_private_api.cc |
index 2c242b1c0af7cd9f93975d7f37dedda261bdae4f..e2f12c1ac5f883cd9d9ef075fd14387afa130e84 100644 |
--- a/chrome/browser/extensions/api/easy_unlock_private/easy_unlock_private_api.cc |
+++ b/chrome/browser/extensions/api/easy_unlock_private/easy_unlock_private_api.cc |
@@ -20,6 +20,7 @@ |
#if defined(OS_CHROMEOS) |
#include "chrome/browser/chromeos/chromeos_utils.h" |
+#include "device/bluetooth/bluetooth_device_chromeos.h" |
#endif |
namespace extensions { |
@@ -30,6 +31,8 @@ namespace { |
static base::LazyInstance<BrowserContextKeyedAPIFactory<EasyUnlockPrivateAPI> > |
g_factory = LAZY_INSTANCE_INITIALIZER; |
+const char kApiUnavailable[] = "This API is not implemented on this platform."; |
+ |
// Utility method for getting the API's crypto delegate. |
EasyUnlockPrivateCryptoDelegate* GetCryptoDelegate( |
content::BrowserContext* context) { |
@@ -401,6 +404,31 @@ void EasyUnlockPrivateSeekBluetoothDeviceByAddressFunction::OnSeekCompleted( |
} |
} |
+EasyUnlockPrivateConnectToBluetoothServiceInsecurelyFunction:: |
+ EasyUnlockPrivateConnectToBluetoothServiceInsecurelyFunction() {} |
+ |
+EasyUnlockPrivateConnectToBluetoothServiceInsecurelyFunction:: |
+ ~EasyUnlockPrivateConnectToBluetoothServiceInsecurelyFunction() {} |
+ |
+void EasyUnlockPrivateConnectToBluetoothServiceInsecurelyFunction:: |
+ ConnectToService(device::BluetoothDevice* device, |
+ const device::BluetoothUUID& uuid) { |
+#if defined(OS_CHROMEOS) |
+ chromeos::BluetoothDeviceChromeOS* device_chromeos = |
+ static_cast<chromeos::BluetoothDeviceChromeOS*>(device); |
+ device_chromeos->ConnectToServiceInsecurely( |
+ uuid, |
+ base::Bind(&EasyUnlockPrivateConnectToBluetoothServiceInsecurelyFunction:: |
+ OnConnect, |
+ this), |
+ base::Bind(&EasyUnlockPrivateConnectToBluetoothServiceInsecurelyFunction:: |
+ OnConnectError, |
+ this)); |
+#else |
+ OnConnectError(kApiUnavailable); |
+#endif // defined(OS_CHROMEOS) |
+} |
+ |
EasyUnlockPrivateUpdateScreenlockStateFunction:: |
EasyUnlockPrivateUpdateScreenlockStateFunction() {} |