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