| 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_factory_evdev.h" | 5 #include "ui/events/ozone/evdev/event_factory_evdev.h" |
| 6 | 6 |
| 7 #include <fcntl.h> | 7 #include <fcntl.h> |
| 8 #include <linux/input.h> | 8 #include <linux/input.h> |
| 9 | 9 |
| 10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 file_task_runner_(base::MessageLoopProxy::current()), | 149 file_task_runner_(base::MessageLoopProxy::current()), |
| 150 cursor_(cursor), | 150 cursor_(cursor), |
| 151 dispatch_callback_( | 151 dispatch_callback_( |
| 152 base::Bind(base::IgnoreResult(&EventFactoryEvdev::DispatchUiEvent), | 152 base::Bind(base::IgnoreResult(&EventFactoryEvdev::DispatchUiEvent), |
| 153 base::Unretained(this))), | 153 base::Unretained(this))), |
| 154 weak_ptr_factory_(this) {} | 154 weak_ptr_factory_(this) {} |
| 155 | 155 |
| 156 EventFactoryEvdev::~EventFactoryEvdev() { STLDeleteValues(&converters_); } | 156 EventFactoryEvdev::~EventFactoryEvdev() { STLDeleteValues(&converters_); } |
| 157 | 157 |
| 158 void EventFactoryEvdev::DispatchUiEvent(Event* event) { | 158 void EventFactoryEvdev::DispatchUiEvent(Event* event) { |
| 159 EventFactoryOzone::DispatchEvent(event); | 159 DispatchEvent(event); |
| 160 } | 160 } |
| 161 | 161 |
| 162 void EventFactoryEvdev::AttachInputDevice( | 162 void EventFactoryEvdev::AttachInputDevice( |
| 163 const base::FilePath& path, | 163 const base::FilePath& path, |
| 164 scoped_ptr<EventConverterEvdev> converter) { | 164 scoped_ptr<EventConverterEvdev> converter) { |
| 165 TRACE_EVENT1("ozone", "AttachInputDevice", "path", path.value()); | 165 TRACE_EVENT1("ozone", "AttachInputDevice", "path", path.value()); |
| 166 CHECK(ui_task_runner_->RunsTasksOnCurrentThread()); | 166 CHECK(ui_task_runner_->RunsTasksOnCurrentThread()); |
| 167 | 167 |
| 168 // If we have an existing device, detach it. We don't want two | 168 // If we have an existing device, detach it. We don't want two |
| 169 // devices with the same name open at the same time. | 169 // devices with the same name open at the same time. |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 249 MouseEvent mouse_event(ET_MOUSE_MOVED, | 249 MouseEvent mouse_event(ET_MOUSE_MOVED, |
| 250 cursor_->location(), | 250 cursor_->location(), |
| 251 cursor_->location(), | 251 cursor_->location(), |
| 252 modifiers_.GetModifierFlags(), | 252 modifiers_.GetModifierFlags(), |
| 253 /* changed_button_flags */ 0); | 253 /* changed_button_flags */ 0); |
| 254 DispatchEvent(&mouse_event); | 254 DispatchEvent(&mouse_event); |
| 255 } | 255 } |
| 256 } | 256 } |
| 257 | 257 |
| 258 } // namespace ui | 258 } // namespace ui |
| OLD | NEW |