OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "device/test/test_device_client.h" |
| 6 |
| 7 #include "device/hid/hid_service.h" |
| 8 #include "device/usb/usb_service.h" |
| 9 |
| 10 namespace device { |
| 11 |
| 12 TestDeviceClient::TestDeviceClient( |
| 13 scoped_refptr<base::SingleThreadTaskRunner> blocking_task_runner) |
| 14 : blocking_task_runner_(blocking_task_runner) {} |
| 15 |
| 16 TestDeviceClient::~TestDeviceClient() {} |
| 17 |
| 18 HidService* TestDeviceClient::GetHidService() { |
| 19 #if !defined(OS_LINUX) || defined(USE_UDEV) |
| 20 return HidService::GetInstance(blocking_task_runner_); |
| 21 #else |
| 22 return nullptr; |
| 23 #endif |
| 24 } |
| 25 |
| 26 UsbService* TestDeviceClient::GetUsbService() { |
| 27 #if !defined(OS_ANDROID) && !defined(OS_IOS) |
| 28 if (!usb_service_) { |
| 29 usb_service_ = UsbService::Create(blocking_task_runner_); |
| 30 } |
| 31 #endif |
| 32 return usb_service_.get(); |
| 33 } |
| 34 |
| 35 } // namespace device |
OLD | NEW |