OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/hid/fake_input_service_linux.h" | 5 #include "device/hid/fake_input_service_linux.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 namespace device { | 10 namespace device { |
11 | 11 |
12 FakeInputServiceLinux::FakeInputServiceLinux() { | 12 FakeInputServiceLinux::FakeInputServiceLinux() { |
13 } | 13 } |
14 | 14 |
15 FakeInputServiceLinux::~FakeInputServiceLinux() { | 15 FakeInputServiceLinux::~FakeInputServiceLinux() { |
16 } | 16 } |
17 | 17 |
18 void FakeInputServiceLinux::AddDeviceForTesting(const InputDeviceInfo& info) { | 18 void FakeInputServiceLinux::AddDeviceForTesting(const InputDeviceInfo& info) { |
19 AddDevice(info); | 19 AddDevice(info); |
20 } | 20 } |
21 | 21 |
22 void FakeInputServiceLinux::RemoveDeviceForTesting(const std::string& id) { | 22 void FakeInputServiceLinux::RemoveDeviceForTesting(const std::string& id) { |
23 RemoveDevice(id); | 23 RemoveDevice(id); |
24 } | 24 } |
25 | 25 |
26 void FakeInputServiceLinux::ClearDeviceList() { | 26 void FakeInputServiceLinux::ClearDeviceList() { |
27 devices_.clear(); | 27 devices_.clear(); |
28 } | 28 } |
29 | 29 |
| 30 void FakeInputServiceLinux::GetDevices(std::vector<InputDeviceInfo>* devices) { |
| 31 for (const auto& device : devices_) |
| 32 devices->push_back(device.second); |
| 33 } |
| 34 |
30 } // namespace device | 35 } // namespace device |
OLD | NEW |