| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 <string> | 5 #include <string> |
| 6 #include <utility> | 6 #include <utility> |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
| 10 #include "device/bluetooth/adapter.h" | 10 #include "device/bluetooth/adapter.h" |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 if (client_) { | 89 if (client_) { |
| 90 auto device_info = Device::ConstructDeviceInfoStruct(device); | 90 auto device_info = Device::ConstructDeviceInfoStruct(device); |
| 91 client_->DeviceChanged(std::move(device_info)); | 91 client_->DeviceChanged(std::move(device_info)); |
| 92 } | 92 } |
| 93 } | 93 } |
| 94 | 94 |
| 95 void Adapter::OnGattConnected( | 95 void Adapter::OnGattConnected( |
| 96 const ConnectToDeviceCallback& callback, | 96 const ConnectToDeviceCallback& callback, |
| 97 std::unique_ptr<device::BluetoothGattConnection> connection) { | 97 std::unique_ptr<device::BluetoothGattConnection> connection) { |
| 98 mojom::DevicePtr device_ptr; | 98 mojom::DevicePtr device_ptr; |
| 99 Device::Create(adapter_, std::move(connection), mojo::GetProxy(&device_ptr)); | 99 Device::Create(adapter_, std::move(connection), |
| 100 mojo::MakeRequest(&device_ptr)); |
| 100 callback.Run(mojom::ConnectResult::SUCCESS, std::move(device_ptr)); | 101 callback.Run(mojom::ConnectResult::SUCCESS, std::move(device_ptr)); |
| 101 } | 102 } |
| 102 | 103 |
| 103 void Adapter::OnConnectError( | 104 void Adapter::OnConnectError( |
| 104 const ConnectToDeviceCallback& callback, | 105 const ConnectToDeviceCallback& callback, |
| 105 device::BluetoothDevice::ConnectErrorCode error_code) { | 106 device::BluetoothDevice::ConnectErrorCode error_code) { |
| 106 callback.Run(mojo::ConvertTo<mojom::ConnectResult>(error_code), | 107 callback.Run(mojo::ConvertTo<mojom::ConnectResult>(error_code), |
| 107 nullptr /* Device */); | 108 nullptr /* Device */); |
| 108 } | 109 } |
| 109 } // namespace bluetooth | 110 } // namespace bluetooth |
| OLD | NEW |