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 #include "ui/events/ozone/evdev/device_manager_evdev.h"
7 #include "base/files/file_enumerator.h"
8 #include "base/files/file_path.h"
14 class DeviceManagerManual : public DeviceManagerEvdev {
16 DeviceManagerManual() {}
17 virtual ~DeviceManagerManual() {}
19 // Enumerate existing devices & start watching for device changes.
20 virtual void ScanAndStartMonitoring(const EvdevDeviceCallback& device_added,
21 const EvdevDeviceCallback& device_removed)
23 base::FileEnumerator file_enum(base::FilePath("/dev/input"),
25 base::FileEnumerator::FILES,
27 for (base::FilePath path = file_enum.Next(); !path.empty();
28 path = file_enum.Next())
29 device_added.Run(path);
32 virtual void Stop() OVERRIDE {}
37 DeviceManagerEvdev::~DeviceManagerEvdev() {}
39 scoped_ptr<DeviceManagerEvdev> CreateDeviceManagerManual() {
40 return make_scoped_ptr<DeviceManagerEvdev>(new DeviceManagerManual);