Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(605)

Side by Side Diff: ui/events/ozone/evdev/device_manager_evdev.cc

Issue 250793005: Refactor Udev device support in Ozone and add a DRM hotplug monitor (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
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.
4
5 #include "ui/events/ozone/evdev/device_manager_evdev.h"
6
7 #include "base/files/file_enumerator.h"
8 #include "base/files/file_path.h"
9
10 namespace ui {
11
12 namespace {
13
14 class DeviceManagerManual : public DeviceManagerEvdev {
15 public:
16 DeviceManagerManual() {}
17 virtual ~DeviceManagerManual() {}
18
19 // Enumerate existing devices & start watching for device changes.
20 virtual void ScanAndStartMonitoring(const EvdevDeviceCallback& device_added,
21 const EvdevDeviceCallback& device_removed)
22 OVERRIDE {
23 base::FileEnumerator file_enum(base::FilePath("/dev/input"),
24 false,
25 base::FileEnumerator::FILES,
26 "event*[0-9]");
27 for (base::FilePath path = file_enum.Next(); !path.empty();
28 path = file_enum.Next())
29 device_added.Run(path);
30 }
31
32 virtual void Stop() OVERRIDE {}
33 };
34
35 } // namespace
36
37 DeviceManagerEvdev::~DeviceManagerEvdev() {}
38
39 scoped_ptr<DeviceManagerEvdev> CreateDeviceManagerManual() {
40 return make_scoped_ptr<DeviceManagerEvdev>(new DeviceManagerManual);
41 }
42
43 } // namespace ui
OLDNEW
« no previous file with comments | « ui/events/ozone/evdev/device_manager_evdev.h ('k') | ui/events/ozone/evdev/device_manager_udev.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698