diff options
author | Grace Kloba <klobag@google.com> | 2010-02-02 19:08:37 -0800 |
---|---|---|
committer | Grace Kloba <klobag@google.com> | 2010-02-02 19:08:37 -0800 |
commit | 5b9b4d4efe739cfa2aa117372879c5c37443e644 (patch) | |
tree | ca627fc65bebab9779a54f5d58ae37a582aef6ca /WebCore | |
parent | 53c84f3caf7c84282400134fa9554cd465ec7da8 (diff) | |
download | external_webkit-5b9b4d4efe739cfa2aa117372879c5c37443e644.zip external_webkit-5b9b4d4efe739cfa2aa117372879c5c37443e644.tar.gz external_webkit-5b9b4d4efe739cfa2aa117372879c5c37443e644.tar.bz2 |
Pass touch event time from Java to WebKit
Diffstat (limited to 'WebCore')
-rw-r--r-- | WebCore/dom/Event.h | 4 | ||||
-rw-r--r-- | WebCore/page/EventHandler.cpp | 1 | ||||
-rw-r--r-- | WebCore/platform/PlatformTouchEvent.h | 5 | ||||
-rw-r--r-- | WebCore/plugins/android/PluginViewAndroid.cpp | 2 |
4 files changed, 10 insertions, 2 deletions
diff --git a/WebCore/dom/Event.h b/WebCore/dom/Event.h index 7ec85a7..4774ccb 100644 --- a/WebCore/dom/Event.h +++ b/WebCore/dom/Event.h @@ -153,6 +153,10 @@ namespace WebCore { bool createdByDOM() const { return m_createdByDOM; } void setCreatedByDOM(bool createdByDOM) { m_createdByDOM = createdByDOM; } +#if PLATFORM(ANDROID) + void setCreateTime(DOMTimeStamp time) { m_createTime = time; } +#endif + protected: Event(); Event(const AtomicString& type, bool canBubble, bool cancelable); diff --git a/WebCore/page/EventHandler.cpp b/WebCore/page/EventHandler.cpp index 8b6b602..d0ca86b 100644 --- a/WebCore/page/EventHandler.cpp +++ b/WebCore/page/EventHandler.cpp @@ -2659,6 +2659,7 @@ int EventHandler::handleTouchEvent(const PlatformTouchEvent& e) default: return false; } + te->setCreateTime(static_cast<DOMTimeStamp>(e.eventTime())); ExceptionCode ec = 0; m_touch->target()->dispatchEvent(te.get(), ec); if (type == TouchEventEnd || type == TouchEventCancel) diff --git a/WebCore/platform/PlatformTouchEvent.h b/WebCore/platform/PlatformTouchEvent.h index 6c8629c..320dbbd 100644 --- a/WebCore/platform/PlatformTouchEvent.h +++ b/WebCore/platform/PlatformTouchEvent.h @@ -41,10 +41,11 @@ namespace WebCore { { } - PlatformTouchEvent(const IntPoint& pos, const IntPoint& globalPos, TouchEventType eventType) + PlatformTouchEvent(const IntPoint& pos, const IntPoint& globalPos, TouchEventType eventType, long eventTime) : m_position(pos) , m_globalPosition(globalPos) , m_eventType(eventType) + , m_eventTime(eventTime) { } @@ -54,11 +55,13 @@ namespace WebCore { int globalX() const { return m_globalPosition.x(); } int globalY() const { return m_globalPosition.y(); } TouchEventType eventType() const { return m_eventType; } + long eventTime() const { return m_eventTime; } private: IntPoint m_position; IntPoint m_globalPosition; TouchEventType m_eventType; + long m_eventTime; }; } // namespace WebCore diff --git a/WebCore/plugins/android/PluginViewAndroid.cpp b/WebCore/plugins/android/PluginViewAndroid.cpp index ed7a694..0317ed6 100644 --- a/WebCore/plugins/android/PluginViewAndroid.cpp +++ b/WebCore/plugins/android/PluginViewAndroid.cpp @@ -183,7 +183,7 @@ void PluginView::handleTouchEvent(TouchEvent* event) return; ANPEvent evt; - SkANP::InitEvent(&evt, kTouch_ANPEventType); + SkANP::InitEvent(&evt, kTouch_ANPEventType, event->timeStamp()); bool ignoreRet = false; const AtomicString& type = event->type(); |