Index: content/browser/bluetooth/bluetooth_dispatcher_host.cc |
diff --git a/content/browser/bluetooth/bluetooth_dispatcher_host.cc b/content/browser/bluetooth/bluetooth_dispatcher_host.cc |
index 865a8a0c75e7c35c9dd9708201be618b7c00f980..3eaf4b78161ba87eab55d835fcead7968ad934fb 100644 |
--- a/content/browser/bluetooth/bluetooth_dispatcher_host.cc |
+++ b/content/browser/bluetooth/bluetooth_dispatcher_host.cc |
@@ -4,6 +4,7 @@ |
#include "content/browser/bluetooth/bluetooth_dispatcher_host.h" |
+#include "base/strings/utf_string_conversions.h" |
#include "content/common/bluetooth/bluetooth_messages.h" |
#include "device/bluetooth/bluetooth_adapter.h" |
#include "device/bluetooth/bluetooth_adapter_factory.h" |
@@ -15,6 +16,9 @@ using device::BluetoothDevice; |
namespace content { |
+const uint32 kUnspecifiedDeviceClass = |
+ 0x1F00; // bluetooth.org/en-us/specification/assigned-numbers/baseband |
+ |
scoped_refptr<BluetoothDispatcherHost> BluetoothDispatcherHost::Create() { |
DCHECK_CURRENTLY_ON(BrowserThread::UI); |
@@ -75,9 +79,21 @@ void BluetoothDispatcherHost::OnRequestDevice(int thread_id, int request_id) { |
Send(new BluetoothMsg_RequestDeviceError(thread_id, request_id, |
BluetoothError::NOT_FOUND)); |
} else { |
- BluetoothDevice* device = *devices.begin(); |
+ device::BluetoothDevice* device = *devices.begin(); |
+ content::BluetoothDevice device_ipc( |
+ device->GetAddress(), // instance_id |
+ device->GetName(), // name |
+ device->GetBluetoothClass(), // device_class |
+ device->GetVendorIDSource(), // vendor_id_source |
+ device->GetVendorID(), // vendor_id |
+ device->GetProductID(), // product_id |
+ device->GetDeviceID(), // product_version |
+ device->IsPaired(), // paired |
+ device->IsConnected(), // connected |
+ content::BluetoothDevice::UUIDsFromBluetoothUUIDs( |
+ device->GetUUIDs())); // uuids |
Send(new BluetoothMsg_RequestDeviceSuccess(thread_id, request_id, |
- device->GetAddress())); |
+ device_ipc)); |
} |
return; |
} |
@@ -87,8 +103,20 @@ void BluetoothDispatcherHost::OnRequestDevice(int thread_id, int request_id) { |
return; |
} |
case MockData::RESOLVE: { |
+ content::BluetoothDevice device_ipc( |
+ "Empty Mock Device instanceID", // instance_id |
+ base::UTF8ToUTF16("Empty Mock Device name"), // name |
+ kUnspecifiedDeviceClass, // device_class |
+ device::BluetoothDevice::VENDOR_ID_BLUETOOTH, // vendor_id_source |
+ 0xFFFF, // vendor_id |
+ 1, // product_id |
+ 2, // product_version |
+ true, // paired |
+ false, // connected |
+ {"00000000-0000-1000-8000-00805F9B34FB", |
+ "10000000-0000-1000-8000-00805F9B34FB"}); // uuids |
Send(new BluetoothMsg_RequestDeviceSuccess(thread_id, request_id, |
- "Empty Mock deviceId")); |
+ device_ipc)); |
return; |
} |
} |