Update Smart lock strings in chrome://settings.
[chromium-blink-merge.git] / device / hid / hid_service_linux.h
blobbc406ad069892f45d24e79945be1d1f3cf4225fd
1 // Copyright 2014 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.
5 #ifndef DEVICE_HID_HID_SERVICE_LINUX_H_
6 #define DEVICE_HID_HID_SERVICE_LINUX_H_
8 #include "base/compiler_specific.h"
9 #include "base/macros.h"
10 #include "base/memory/weak_ptr.h"
11 #include "device/hid/device_monitor_linux.h"
12 #include "device/hid/hid_device_info.h"
13 #include "device/hid/hid_service.h"
15 struct udev_device;
17 namespace device {
19 class HidConnection;
21 class HidServiceLinux : public HidService,
22 public DeviceMonitorLinux::Observer {
23 public:
24 HidServiceLinux(scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner);
26 virtual void Connect(const HidDeviceId& device_id,
27 const ConnectCallback& callback) override;
29 // Implements DeviceMonitorLinux::Observer:
30 virtual void OnDeviceAdded(udev_device* device) override;
31 virtual void OnDeviceRemoved(udev_device* device) override;
33 private:
34 virtual ~HidServiceLinux();
36 void FinishConnect(const HidDeviceId& device_id,
37 const std::string device_node,
38 const ConnectCallback& callback,
39 bool success);
41 scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
42 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner_;
44 base::WeakPtrFactory<HidServiceLinux> weak_factory_;
46 DISALLOW_COPY_AND_ASSIGN(HidServiceLinux);
49 } // namespace device
51 #endif // DEVICE_HID_HID_SERVICE_LINUX_H_