Home | History | Annotate | Download | only in evdev
      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/event_converter_evdev.h"
      6 
      7 #include "base/files/file_path.h"
      8 #include "base/logging.h"
      9 #include "base/message_loop/message_loop.h"
     10 
     11 namespace ui {
     12 
     13 EventConverterEvdev::EventConverterEvdev(int fd, const base::FilePath& path)
     14     : fd_(fd), path_(path) {
     15 }
     16 
     17 EventConverterEvdev::~EventConverterEvdev() {
     18   Stop();
     19 }
     20 
     21 void EventConverterEvdev::Start() {
     22   base::MessageLoopForUI::current()->WatchFileDescriptor(
     23       fd_, true, base::MessagePumpLibevent::WATCH_READ, &controller_, this);
     24 }
     25 
     26 void EventConverterEvdev::Stop() {
     27   controller_.StopWatchingFileDescriptor();
     28 }
     29 
     30 void EventConverterEvdev::OnFileCanWriteWithoutBlocking(int fd) {
     31   NOTREACHED();
     32 }
     33 
     34 }  // namespace ui
     35