| 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 <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| (...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 328 void EventFactoryEvdev::DispatchTouchEvent(const TouchEventParams& params) { | 328 void EventFactoryEvdev::DispatchTouchEvent(const TouchEventParams& params) { |
| 329 TRACE_EVENT1("evdev", "EventFactoryEvdev::DispatchTouchEvent", "device", | 329 TRACE_EVENT1("evdev", "EventFactoryEvdev::DispatchTouchEvent", "device", |
| 330 params.device_id); | 330 params.device_id); |
| 331 | 331 |
| 332 gfx::PointF location = GetTransformedEventLocation(params); | 332 gfx::PointF location = GetTransformedEventLocation(params); |
| 333 PointerDetails details = GetTransformedEventPointerDetails(params); | 333 PointerDetails details = GetTransformedEventPointerDetails(params); |
| 334 | 334 |
| 335 // params.slot is guaranteed to be < kNumTouchEvdevSlots. | 335 // params.slot is guaranteed to be < kNumTouchEvdevSlots. |
| 336 int touch_id = touch_id_generator_.GetGeneratedID( | 336 int touch_id = touch_id_generator_.GetGeneratedID( |
| 337 params.device_id * kNumTouchEvdevSlots + params.slot); | 337 params.device_id * kNumTouchEvdevSlots + params.slot); |
| 338 details.id = touch_id; |
| 338 TouchEvent touch_event( | 339 TouchEvent touch_event( |
| 339 params.type, gfx::Point(), modifiers_.GetModifierFlags(), touch_id, | 340 params.type, gfx::Point(), modifiers_.GetModifierFlags(), touch_id, |
| 340 params.timestamp, /* radius_x */ 0.f, /* radius_y */ 0.f, | 341 params.timestamp, /* radius_x */ 0.f, /* radius_y */ 0.f, |
| 341 /* angle */ 0.f, /* force */ 0.f); | 342 /* angle */ 0.f, /* force */ 0.f); |
| 342 touch_event.set_location_f(location); | 343 touch_event.set_location_f(location); |
| 343 touch_event.set_root_location_f(location); | 344 touch_event.set_root_location_f(location); |
| 344 touch_event.set_source_device_id(params.device_id); | 345 touch_event.set_source_device_id(params.device_id); |
| 345 touch_event.set_pointer_details(details); | 346 touch_event.set_pointer_details(details); |
| 346 DispatchUiEvent(&touch_event); | 347 DispatchUiEvent(&touch_event); |
| 347 | 348 |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 469 | 470 |
| 470 // Scan & monitor devices. | 471 // Scan & monitor devices. |
| 471 device_manager_->AddObserver(this); | 472 device_manager_->AddObserver(this); |
| 472 device_manager_->ScanDevices(this); | 473 device_manager_->ScanDevices(this); |
| 473 | 474 |
| 474 // Notify device thread that initial scan is done. | 475 // Notify device thread that initial scan is done. |
| 475 input_device_factory_proxy_->OnStartupScanComplete(); | 476 input_device_factory_proxy_->OnStartupScanComplete(); |
| 476 } | 477 } |
| 477 | 478 |
| 478 } // namespace ui | 479 } // namespace ui |
| OLD | NEW |