OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 "device/bluetooth/test/fake_bluetooth.h" | 5 #include "device/bluetooth/test/fake_bluetooth.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
10 #include "device/bluetooth/bluetooth_adapter_factory.h" | 10 #include "device/bluetooth/bluetooth_adapter_factory.h" |
11 #include "device/bluetooth/public/interfaces/test/fake_bluetooth.mojom.h" | 11 #include "device/bluetooth/public/interfaces/test/fake_bluetooth.mojom.h" |
12 #include "mojo/public/cpp/bindings/strong_binding.h" | 12 #include "mojo/public/cpp/bindings/strong_binding.h" |
13 | 13 |
14 namespace bluetooth { | 14 namespace bluetooth { |
15 | 15 |
16 using device::BluetoothAdapterFactory; | 16 using device::BluetoothAdapterFactory; |
17 | 17 |
18 FakeBluetooth::FakeBluetooth() | 18 FakeBluetooth::FakeBluetooth() |
19 : global_factory_values_( | 19 : global_factory_values_( |
20 BluetoothAdapterFactory::Get().InitGlobalValuesForTesting()) {} | 20 BluetoothAdapterFactory::Get().InitGlobalValuesForTesting()) {} |
21 FakeBluetooth::~FakeBluetooth() {} | 21 FakeBluetooth::~FakeBluetooth() {} |
22 | 22 |
23 // static | 23 // static |
24 void FakeBluetooth::Create(mojom::FakeBluetoothRequest request) { | 24 void FakeBluetooth::Create(const service_manager::BindSourceInfo& source_info, |
| 25 mojom::FakeBluetoothRequest request) { |
25 mojo::MakeStrongBinding(base::MakeUnique<FakeBluetooth>(), | 26 mojo::MakeStrongBinding(base::MakeUnique<FakeBluetooth>(), |
26 std::move(request)); | 27 std::move(request)); |
27 } | 28 } |
28 | 29 |
29 void FakeBluetooth::SetLESupported(bool supported, | 30 void FakeBluetooth::SetLESupported(bool supported, |
30 const SetLESupportedCallback& callback) { | 31 const SetLESupportedCallback& callback) { |
31 global_factory_values_->SetLESupported(supported); | 32 global_factory_values_->SetLESupported(supported); |
32 callback.Run(); | 33 callback.Run(); |
33 } | 34 } |
34 | 35 |
35 } // namespace bluetooth | 36 } // namespace bluetooth |
OLD | NEW |