| OLD | NEW |
| 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/devices/input_device.h" |
| 10 | 11 |
| 11 namespace ui { | 12 namespace ui { |
| 12 | 13 |
| 13 EventConverterEvdev::EventConverterEvdev(int fd, | 14 EventConverterEvdev::EventConverterEvdev(int fd, |
| 14 const base::FilePath& path, | 15 const base::FilePath& path, |
| 15 int id) | 16 int id, |
| 16 : fd_(fd), path_(path), id_(id) { | 17 InputDeviceType type) |
| 18 : fd_(fd), path_(path), id_(id), type_(type) { |
| 17 } | 19 } |
| 18 | 20 |
| 19 EventConverterEvdev::~EventConverterEvdev() { | 21 EventConverterEvdev::~EventConverterEvdev() { |
| 20 Stop(); | 22 Stop(); |
| 21 } | 23 } |
| 22 | 24 |
| 23 void EventConverterEvdev::Start() { | 25 void EventConverterEvdev::Start() { |
| 24 base::MessageLoopForUI::current()->WatchFileDescriptor( | 26 base::MessageLoopForUI::current()->WatchFileDescriptor( |
| 25 fd_, true, base::MessagePumpLibevent::WATCH_READ, &controller_, this); | 27 fd_, true, base::MessagePumpLibevent::WATCH_READ, &controller_, this); |
| 26 } | 28 } |
| 27 | 29 |
| 28 void EventConverterEvdev::Stop() { | 30 void EventConverterEvdev::Stop() { |
| 29 controller_.StopWatchingFileDescriptor(); | 31 controller_.StopWatchingFileDescriptor(); |
| 30 } | 32 } |
| 31 | 33 |
| 32 void EventConverterEvdev::OnFileCanWriteWithoutBlocking(int fd) { | 34 void EventConverterEvdev::OnFileCanWriteWithoutBlocking(int fd) { |
| 33 NOTREACHED(); | 35 NOTREACHED(); |
| 34 } | 36 } |
| 35 | 37 |
| 36 bool EventConverterEvdev::HasTouchscreen() const { | 38 bool EventConverterEvdev::HasTouchscreen() const { |
| 37 return false; | 39 return false; |
| 38 } | 40 } |
| 39 | 41 |
| 40 gfx::Size EventConverterEvdev::GetTouchscreenSize() const { | 42 gfx::Size EventConverterEvdev::GetTouchscreenSize() const { |
| 41 NOTREACHED(); | 43 NOTREACHED(); |
| 42 return gfx::Size(); | 44 return gfx::Size(); |
| 43 } | 45 } |
| 44 | 46 |
| 45 bool EventConverterEvdev::IsInternal() const { | |
| 46 return false; | |
| 47 } | |
| 48 | |
| 49 } // namespace ui | 47 } // namespace ui |
| OLD | NEW |