| 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 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 286 base::Bind(&CloseInputDevice, path, base::Passed(&converter)), | 286 base::Bind(&CloseInputDevice, path, base::Passed(&converter)), |
| 287 true); | 287 true); |
| 288 } | 288 } |
| 289 } | 289 } |
| 290 | 290 |
| 291 void EventFactoryEvdev::WarpCursorTo(gfx::AcceleratedWidget widget, | 291 void EventFactoryEvdev::WarpCursorTo(gfx::AcceleratedWidget widget, |
| 292 const gfx::PointF& location) { | 292 const gfx::PointF& location) { |
| 293 if (cursor_) { | 293 if (cursor_) { |
| 294 cursor_->MoveCursorTo(widget, location); | 294 cursor_->MoveCursorTo(widget, location); |
| 295 PostUiEvent(make_scoped_ptr(new MouseEvent(ET_MOUSE_MOVED, | 295 PostUiEvent(make_scoped_ptr(new MouseEvent(ET_MOUSE_MOVED, |
| 296 cursor_->location(), | 296 cursor_->GetLocation(), |
| 297 cursor_->location(), | 297 cursor_->GetRootLocation(), |
| 298 modifiers_.GetModifierFlags(), | 298 modifiers_.GetModifierFlags(), |
| 299 /* changed_button_flags */ 0))); | 299 /* changed_button_flags */ 0))); |
| 300 } | 300 } |
| 301 } | 301 } |
| 302 | 302 |
| 303 void EventFactoryEvdev::NotifyHotplugEventObserver( | 303 void EventFactoryEvdev::NotifyHotplugEventObserver( |
| 304 const EventConverterEvdev& converter) { | 304 const EventConverterEvdev& converter) { |
| 305 // For now the only information propagated is related to touchscreens. Ignore | 305 // For now the only information propagated is related to touchscreens. Ignore |
| 306 // events for everything but touchscreens. | 306 // events for everything but touchscreens. |
| 307 if (!converter.HasTouchscreen()) | 307 if (!converter.HasTouchscreen()) |
| (...skipping 16 matching lines...) Expand all Loading... |
| 324 } | 324 } |
| 325 | 325 |
| 326 observer->OnTouchscreenDevicesUpdated(touchscreens); | 326 observer->OnTouchscreenDevicesUpdated(touchscreens); |
| 327 } | 327 } |
| 328 | 328 |
| 329 int EventFactoryEvdev::NextDeviceId() { | 329 int EventFactoryEvdev::NextDeviceId() { |
| 330 return ++last_device_id_; | 330 return ++last_device_id_; |
| 331 } | 331 } |
| 332 | 332 |
| 333 } // namespace ui | 333 } // namespace ui |
| OLD | NEW |