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

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

Issue 616633002: [Ozone-Evdev] Propagate touchscreen device information to DeviceDataManager (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 6 years, 2 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 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_converter_evdev.h" 5 #include "ui/events/ozone/evdev/event_converter_evdev.h"
6 6
7 #include "base/files/file_path.h" 7 #include "base/files/file_path.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "ui/events/ozone/evdev/event_device_info.h"
10 11
11 namespace ui { 12 namespace ui {
12 13
13 EventConverterEvdev::EventConverterEvdev(int fd, const base::FilePath& path) 14 EventConverterEvdev::EventConverterEvdev(
14 : fd_(fd), path_(path) { 15 int fd,
16 const base::FilePath& path,
17 scoped_ptr<EventDeviceInfo> device_info)
spang 2014/09/29 23:54:35 Do we actually need to store EventDeviceInfo? You
dnicoara 2014/09/30 18:23:27 Size + properties to figure out what type of devic
spang 2014/09/30 18:59:23 Just add two functions to EventConvertEvdev: Has
dnicoara 2014/09/30 19:09:31 The getters never call the ioctls. One would have
18 : fd_(fd), path_(path), device_info_(device_info.Pass()) {
15 } 19 }
16 20
17 EventConverterEvdev::~EventConverterEvdev() { 21 EventConverterEvdev::~EventConverterEvdev() {
18 Stop(); 22 Stop();
19 } 23 }
20 24
21 void EventConverterEvdev::Start() { 25 void EventConverterEvdev::Start() {
22 base::MessageLoopForUI::current()->WatchFileDescriptor( 26 base::MessageLoopForUI::current()->WatchFileDescriptor(
23 fd_, true, base::MessagePumpLibevent::WATCH_READ, &controller_, this); 27 fd_, true, base::MessagePumpLibevent::WATCH_READ, &controller_, this);
24 } 28 }
25 29
26 void EventConverterEvdev::Stop() { 30 void EventConverterEvdev::Stop() {
27 controller_.StopWatchingFileDescriptor(); 31 controller_.StopWatchingFileDescriptor();
28 } 32 }
29 33
30 void EventConverterEvdev::OnFileCanWriteWithoutBlocking(int fd) { 34 void EventConverterEvdev::OnFileCanWriteWithoutBlocking(int fd) {
31 NOTREACHED(); 35 NOTREACHED();
32 } 36 }
33 37
34 } // namespace ui 38 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698