Index: chrome/browser/extensions/api/bluetooth/bluetooth_api.cc |
diff --git a/chrome/browser/extensions/api/bluetooth/bluetooth_api.cc b/chrome/browser/extensions/api/bluetooth/bluetooth_api.cc |
index 7e182c2caf9e70471094294efe271e0b5c274604..7b80b96d7a4aa25bd28e63df964dc610e60d156d 100644 |
--- a/chrome/browser/extensions/api/bluetooth/bluetooth_api.cc |
+++ b/chrome/browser/extensions/api/bluetooth/bluetooth_api.cc |
@@ -43,6 +43,8 @@ chromeos::BluetoothAdapter* GetMutableAdapter(Profile* profile) { |
namespace { |
+const char kFailedToConnect[] = "Connection failed"; |
+const char kInvalidDevice[] = "Invalid device"; |
const char kSocketNotFoundError[] = "Socket not found: invalid socket id"; |
} // namespace |
@@ -165,6 +167,7 @@ void BluetoothConnectFunction::ConnectToServiceCallback( |
result_.reset(result_socket.ToValue().release()); |
SendResponse(true); |
} else { |
+ SetError(kFailedToConnect); |
SendResponse(false); |
} |
@@ -179,6 +182,7 @@ bool BluetoothConnectFunction::RunImpl() { |
GetMutableAdapter(profile())->GetDevice(params->device.address); |
if (!device) { |
SendResponse(false); |
+ SetError(kInvalidDevice); |
return false; |
} |