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

Unified Diff: ui/events/event.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/event.h ('k') | ui/events/event_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/events/event.cc
diff --git a/ui/events/event.cc b/ui/events/event.cc
index b1f50a800825c19720e82ecbc4efb5004ecdbee5..71f5e27ffbb5c00b33ba2487587f55486abf06a8 100644
--- a/ui/events/event.cc
+++ b/ui/events/event.cc
@@ -326,12 +326,16 @@ MouseEvent::MouseEvent(const base::NativeEvent& native_event)
}
MouseEvent::MouseEvent(EventType type,
- const gfx::PointF& location,
- const gfx::PointF& root_location,
+ const gfx::Point& location,
+ const gfx::Point& root_location,
base::TimeDelta time_stamp,
int flags,
int changed_button_flags)
- : LocatedEvent(type, location, root_location, time_stamp, flags),
+ : LocatedEvent(type,
+ gfx::PointF(location),
+ gfx::PointF(root_location),
+ time_stamp,
+ flags),
changed_button_flags_(changed_button_flags),
pointer_details_(PointerDetails(EventPointerType::POINTER_TYPE_MOUSE)) {
if (this->type() == ET_MOUSE_MOVED && IsAnyButton())
@@ -485,8 +489,8 @@ MouseWheelEvent::MouseWheelEvent(const MouseWheelEvent& mouse_wheel_event)
}
MouseWheelEvent::MouseWheelEvent(const gfx::Vector2d& offset,
- const gfx::PointF& location,
- const gfx::PointF& root_location,
+ const gfx::Point& location,
+ const gfx::Point& root_location,
base::TimeDelta time_stamp,
int flags,
int changed_button_flags)
@@ -496,8 +500,7 @@ MouseWheelEvent::MouseWheelEvent(const gfx::Vector2d& offset,
time_stamp,
flags,
changed_button_flags),
- offset_(offset) {
-}
+ offset_(offset) {}
#if defined(OS_WIN)
// This value matches windows WHEEL_DELTA.
@@ -535,10 +538,14 @@ TouchEvent::TouchEvent(const base::NativeEvent& native_event)
}
TouchEvent::TouchEvent(EventType type,
- const gfx::PointF& location,
+ const gfx::Point& location,
int touch_id,
base::TimeDelta time_stamp)
- : LocatedEvent(type, location, location, time_stamp, 0),
+ : LocatedEvent(type,
+ gfx::PointF(location),
+ gfx::PointF(location),
+ time_stamp,
+ 0),
touch_id_(touch_id),
unique_event_id_(ui::GetNextTouchEventId()),
rotation_angle_(0.0f),
@@ -549,7 +556,7 @@ TouchEvent::TouchEvent(EventType type,
}
TouchEvent::TouchEvent(EventType type,
- const gfx::PointF& location,
+ const gfx::Point& location,
int flags,
int touch_id,
base::TimeDelta time_stamp,
@@ -557,7 +564,11 @@ TouchEvent::TouchEvent(EventType type,
float radius_y,
float angle,
float force)
- : LocatedEvent(type, location, location, time_stamp, flags),
+ : LocatedEvent(type,
+ gfx::PointF(location),
+ gfx::PointF(location),
+ time_stamp,
+ flags),
touch_id_(touch_id),
unique_event_id_(ui::GetNextTouchEventId()),
rotation_angle_(angle),
@@ -926,7 +937,7 @@ ScrollEvent::ScrollEvent(const base::NativeEvent& native_event)
}
ScrollEvent::ScrollEvent(EventType type,
- const gfx::PointF& location,
+ const gfx::Point& location,
base::TimeDelta time_stamp,
int flags,
float x_offset,
« no previous file with comments | « ui/events/event.h ('k') | ui/events/event_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698