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

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

Issue 149503003: Remove common EventConverterOzone class & move to EventConverterEvdev (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: s/DispatchEventHelper/DispatchEventTask/ Created 6 years, 10 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
« no previous file with comments | « ui/events/ozone/evdev/event_factory.h ('k') | ui/events/ozone/evdev/event_modifiers.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "ui/events/ozone/evdev/event_factory.h" 5 #include "ui/events/ozone/evdev/event_factory.h"
6 6
7 #include <errno.h> 7 #include <errno.h>
8 #include <fcntl.h> 8 #include <fcntl.h>
9 #include <linux/input.h> 9 #include <linux/input.h>
10 #include <poll.h> 10 #include <poll.h>
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 return; 58 return;
59 } 59 }
60 60
61 if (IsTouchPad(devinfo)) { 61 if (IsTouchPad(devinfo)) {
62 LOG(WARNING) << "touchpad device not supported: " << path.value(); 62 LOG(WARNING) << "touchpad device not supported: " << path.value();
63 close(fd); 63 close(fd);
64 return; 64 return;
65 } 65 }
66 66
67 // TODO(spang) Add more device types. Support hot-plugging. 67 // TODO(spang) Add more device types. Support hot-plugging.
68 scoped_ptr<EventConverterOzone> converter; 68 scoped_ptr<EventConverterEvdev> converter;
69 if (IsTouchScreen(devinfo)) 69 if (IsTouchScreen(devinfo))
70 converter.reset(new TouchEventConverterEvdev(fd, path)); 70 converter.reset(new TouchEventConverterEvdev(fd, path));
71 else if (devinfo.HasEventType(EV_KEY)) 71 else if (devinfo.HasEventType(EV_KEY))
72 converter.reset(new KeyEventConverterEvdev(fd, path, &modifiers_)); 72 converter.reset(new KeyEventConverterEvdev(fd, path, &modifiers_));
73 73
74 if (converter) { 74 if (converter) {
75 converters_[path] = converter.release(); 75 converters_[path] = converter.release();
76 } else { 76 } else {
77 close(fd); 77 close(fd);
78 } 78 }
79 } 79 }
80 80
81 void EventFactoryEvdev::StartProcessingEvents() { 81 void EventFactoryEvdev::StartProcessingEvents() {
82 base::ThreadRestrictions::AssertIOAllowed(); 82 base::ThreadRestrictions::AssertIOAllowed();
83 83
84 base::FileEnumerator file_enum( 84 base::FileEnumerator file_enum(
85 base::FilePath("/dev/input"), false, base::FileEnumerator::FILES); 85 base::FilePath("/dev/input"), false, base::FileEnumerator::FILES);
86 for (base::FilePath path = file_enum.Next(); !path.empty(); 86 for (base::FilePath path = file_enum.Next(); !path.empty();
87 path = file_enum.Next()) 87 path = file_enum.Next())
88 AttachInputDevice(path); 88 AttachInputDevice(path);
89 } 89 }
90 90
91 } // namespace ui 91 } // namespace ui
OLDNEW
« no previous file with comments | « ui/events/ozone/evdev/event_factory.h ('k') | ui/events/ozone/evdev/event_modifiers.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698