Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(42)

Unified Diff: ui/events/ozone/evdev/event_factory_evdev.cc

Issue 1372253002: gfx: Make conversions from gfx::Point to PointF explicit. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: pointfconvert-event: mandol_line Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/events/gestures/motion_event_aura_unittest.cc ('k') | ui/events/test/event_generator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/events/ozone/evdev/event_factory_evdev.cc
diff --git a/ui/events/ozone/evdev/event_factory_evdev.cc b/ui/events/ozone/evdev/event_factory_evdev.cc
index 79a628f147d4c845c61f7ac3ce886c88ec5c8d08..32dd7c5b651cbcd97c6106dadaf31cee0e98df1d 100644
--- a/ui/events/ozone/evdev/event_factory_evdev.cc
+++ b/ui/events/ozone/evdev/event_factory_evdev.cc
@@ -169,9 +169,11 @@ void EventFactoryEvdev::DispatchMouseMoveEvent(
const MouseMoveEventParams& params) {
TRACE_EVENT1("evdev", "EventFactoryEvdev::DispatchMouseMoveEvent", "device",
params.device_id);
- MouseEvent event(ui::ET_MOUSE_MOVED, params.location, params.location,
+ MouseEvent event(ui::ET_MOUSE_MOVED, gfx::Point(), gfx::Point(),
params.timestamp, modifiers_.GetModifierFlags(),
/* changed_button_flags */ 0);
+ event.set_location_f(params.location);
+ event.set_root_location_f(params.location);
event.set_source_device_id(params.device_id);
event.set_pointer_details(params.pointer_details);
DispatchUiEvent(&event);
@@ -219,9 +221,11 @@ void EventFactoryEvdev::DispatchMouseButtonEvent(
return;
MouseEvent event(params.down ? ui::ET_MOUSE_PRESSED : ui::ET_MOUSE_RELEASED,
- params.location, params.location, params.timestamp,
+ gfx::Point(), gfx::Point(), params.timestamp,
modifiers_.GetModifierFlags() | flag,
/* changed_button_flags */ flag);
+ event.set_location_f(params.location);
+ event.set_root_location_f(params.location);
event.set_source_device_id(params.device_id);
event.set_pointer_details(params.pointer_details);
DispatchUiEvent(&event);
@@ -231,9 +235,11 @@ void EventFactoryEvdev::DispatchMouseWheelEvent(
const MouseWheelEventParams& params) {
TRACE_EVENT1("evdev", "EventFactoryEvdev::DispatchMouseWheelEvent", "device",
params.device_id);
- MouseWheelEvent event(params.delta, params.location, params.location,
+ MouseWheelEvent event(params.delta, gfx::Point(), gfx::Point(),
params.timestamp, modifiers_.GetModifierFlags(),
0 /* changed_button_flags */);
+ event.set_location_f(params.location);
+ event.set_root_location_f(params.location);
event.set_source_device_id(params.device_id);
DispatchUiEvent(&event);
}
@@ -252,10 +258,12 @@ void EventFactoryEvdev::DispatchPinchEvent(const PinchEventParams& params) {
void EventFactoryEvdev::DispatchScrollEvent(const ScrollEventParams& params) {
TRACE_EVENT1("evdev", "EventFactoryEvdev::DispatchScrollEvent", "device",
params.device_id);
- ScrollEvent event(params.type, params.location, params.timestamp,
+ ScrollEvent event(params.type, gfx::Point(), params.timestamp,
modifiers_.GetModifierFlags(), params.delta.x(),
params.delta.y(), params.ordinal_delta.x(),
params.ordinal_delta.y(), params.finger_count);
+ event.set_location_f(params.location);
+ event.set_root_location_f(params.location);
event.set_source_device_id(params.device_id);
DispatchUiEvent(&event);
}
@@ -280,10 +288,12 @@ void EventFactoryEvdev::DispatchTouchEvent(const TouchEventParams& params) {
// params.slot is guaranteed to be < kNumTouchEvdevSlots.
int touch_id = touch_id_generator_.GetGeneratedID(
params.device_id * kNumTouchEvdevSlots + params.slot);
- TouchEvent touch_event(params.type, gfx::PointF(x, y),
+ TouchEvent touch_event(params.type, gfx::Point(),
modifiers_.GetModifierFlags(), touch_id,
params.timestamp, radius_x, radius_y,
/* angle */ 0.f, params.pressure);
+ touch_event.set_location_f(gfx::PointF(x, y));
+ touch_event.set_root_location_f(gfx::PointF(x, y));
touch_event.set_source_device_id(params.device_id);
DispatchUiEvent(&touch_event);
« no previous file with comments | « ui/events/gestures/motion_event_aura_unittest.cc ('k') | ui/events/test/event_generator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698