summaryrefslogtreecommitdiffstats
path: root/src/core/render_widget_host_view_qt.cpp
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@theqtcompany.com>2015-06-24 10:48:37 +0200
committerAllan Sandfeld Jensen <allan.jensen@theqtcompany.com>2015-07-01 11:50:03 +0200
commit05bd205d4429d03bd90dd60d85ca554b951f11e3 (patch)
treef83a8d55d0f3e9c560d90c2ec96853c071d15855 /src/core/render_widget_host_view_qt.cpp
parent89a3f302d57c3652a66239f20dfd3caa5fb8a889 (diff)
Implement MotionEvent::GetUniqueEventId()
Not currently used by Chromium except asserted not to be zero. Change-Id: I8eaab67fa316c80bd5b18af46993395c06aa8801 Reviewed-by: Andras Becsi <andras.becsi@theqtcompany.com>
Diffstat (limited to 'src/core/render_widget_host_view_qt.cpp')
-rw-r--r--src/core/render_widget_host_view_qt.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/core/render_widget_host_view_qt.cpp b/src/core/render_widget_host_view_qt.cpp
index 69f16b3e4..46f93b90b 100644
--- a/src/core/render_widget_host_view_qt.cpp
+++ b/src/core/render_widget_host_view_qt.cpp
@@ -182,12 +182,14 @@ static inline int flagsFromModifiers(Qt::KeyboardModifiers modifiers)
return modifierFlags;
}
+static uint32 s_eventId = 0;
class MotionEventQt : public ui::MotionEvent {
public:
MotionEventQt(const QList<QTouchEvent::TouchPoint> &touchPoints, const base::TimeTicks &eventTime, Action action, const Qt::KeyboardModifiers modifiers, int index = -1)
: touchPoints(touchPoints)
, eventTime(eventTime)
, action(action)
+ , eventId(++s_eventId)
, flags(flagsFromModifiers(modifiers))
, index(index)
{
@@ -195,7 +197,7 @@ public:
Q_ASSERT((action != ACTION_DOWN && action != ACTION_UP) || index == 0);
}
- virtual int GetId() const Q_DECL_OVERRIDE { return 0; }
+ virtual uint32 GetUniqueEventId() const Q_DECL_OVERRIDE { return eventId; }
virtual Action GetAction() const Q_DECL_OVERRIDE { return action; }
virtual int GetActionIndex() const Q_DECL_OVERRIDE { return index; }
virtual size_t GetPointerCount() const Q_DECL_OVERRIDE { return touchPoints.size(); }
@@ -234,6 +236,7 @@ private:
QList<QTouchEvent::TouchPoint> touchPoints;
base::TimeTicks eventTime;
Action action;
+ const uint32 eventId;
int flags;
int index;
};