Changeset 65788 in webkit


Ignore:
Timestamp:
Aug 22, 2010 3:42:41 PM (14 years ago)
Author:
commit-queue@webkit.org
Message:

2010-08-22 Juha Savolainen <juha.savolainen@weego.fi>

Reviewed by Kenneth Rohde Christiansen.

[Qt] Add QTouchEvents support for WebKit2
https://bugs.webkit.org/show_bug.cgi?id=44330

This patch adds support for QTouchEvents in WebKit2. A new WebEvent-class
is created for touchevents, WebTouchEvent. Also touchpoints needed a new
class, WebPlatformTouchPoint. This is similar solution like in other
events(like MouseEvent) on WebKit2. These classes are introduced in WebEvent.h
Also there was a need to create an empty constructor to PlatformTouchPoint-class.

  • platform/PlatformTouchPoint.h: (WebCore::PlatformTouchPoint::PlatformTouchPoint):

2010-08-22 Juha Savolainen <juha.savolainen@weego.fi>

Reviewed by Kenneth Rohde Christiansen.

[Qt] Add QTouchEvents support for WebKit2
https://bugs.webkit.org/show_bug.cgi?id=44330

This patch adds support for QTouchEvents in WebKit2. A new WebEvent-class
is created for touchevents, WebTouchEvent. Also touchpoints needed a new
class, WebPlatformTouchPoint. This is similar solution like in other
events(like MouseEvent) on WebKit2. These classes are introduced in WebEvent.h
Also there was a need to create an empty constructor to PlatformTouchPoint-class.

  • DerivedSources.pro:
  • Shared/CoreIPCSupport/WebPageMessageKinds.h: (WebPageMessage::):
  • Shared/WebEvent.h: (WebKit::WebEvent::): (WebKit::WebTouchPoint::): (WebKit::WebTouchPoint::WebTouchPoint): (WebKit::WebTouchPoint::id): (WebKit::WebTouchPoint::state): (WebKit::WebTouchPoint::screenPosX): (WebKit::WebTouchPoint::screenPosY): (WebKit::WebTouchPoint::posX): (WebKit::WebTouchPoint::posY): (WebKit::WebTouchPoint::setState): (WebKit::WebTouchPoint::encode): (WebKit::WebTouchPoint::decode): (WebKit::WebTouchEvent::WebTouchEvent): (WebKit::WebTouchEvent::type): (WebKit::WebTouchEvent::touchPoints): (WebKit::WebTouchEvent::encode): (WebKit::WebTouchEvent::decode): (WebKit::WebTouchEvent::isTouchEventType):
  • Shared/WebEventConversion.cpp: (WebKit::WebKit2PlatformTouchPoint::WebKit2PlatformTouchPoint): (WebKit::WebKit2PlatformTouchEvent::WebKit2PlatformTouchEvent): (WebKit::platform):
  • Shared/WebEventConversion.h:
  • Shared/qt/WebEventFactoryQt.cpp: (WebKit::webEventTypeForEvent): (WebKit::WebEventFactory::createWebTouchEvent):
  • Shared/qt/WebEventFactoryQt.h:
  • UIProcess/API/qt/qgraphicswkview.cpp: (QGraphicsWKView::event): (QGraphicsWKView::touchEvent):
  • UIProcess/API/qt/qgraphicswkview.h:
  • UIProcess/API/qt/qwkpage.cpp: (QWKPagePrivate::touchEvent):
  • UIProcess/API/qt/qwkpage_p.h:
  • UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::touchEvent):
  • UIProcess/WebPageProxy.h:
  • WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::touchEvent): (WebKit::WebPage::didReceiveMessage):
  • WebProcess/WebPage/WebPage.h:
Location:
trunk
Files:
18 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r65787 r65788  
     12010-08-22  Juha Savolainen  <juha.savolainen@weego.fi>
     2
     3        Reviewed by Kenneth Rohde Christiansen.
     4
     5        [Qt] Add QTouchEvents support for WebKit2
     6        https://bugs.webkit.org/show_bug.cgi?id=44330
     7
     8        This patch adds support for QTouchEvents in WebKit2. A new WebEvent-class
     9        is created for touchevents, WebTouchEvent. Also touchpoints needed a new
     10        class, WebPlatformTouchPoint. This is similar solution like in other
     11        events(like MouseEvent) on WebKit2. These classes are introduced in WebEvent.h
     12        Also there was a need to create an empty constructor to PlatformTouchPoint-class.
     13
     14        * platform/PlatformTouchPoint.h:
     15        (WebCore::PlatformTouchPoint::PlatformTouchPoint):
     16
    1172010-08-22  Daniel Bates  <dbates@rim.com>
    218
  • trunk/WebCore/platform/PlatformTouchPoint.h

    r57655 r65788  
    4646#if PLATFORM(QT)
    4747    PlatformTouchPoint(const QTouchEvent::TouchPoint&);
     48    PlatformTouchPoint() {};
    4849#elif PLATFORM(ANDROID)
    4950    PlatformTouchPoint(const IntPoint& windowPos, State);
  • trunk/WebKit2/ChangeLog

    r65780 r65788  
     12010-08-22  Juha Savolainen  <juha.savolainen@weego.fi>
     2
     3        Reviewed by Kenneth Rohde Christiansen.
     4
     5        [Qt] Add QTouchEvents support for WebKit2
     6        https://bugs.webkit.org/show_bug.cgi?id=44330
     7
     8        This patch adds support for QTouchEvents in WebKit2. A new WebEvent-class
     9        is created for touchevents, WebTouchEvent. Also touchpoints needed a new
     10        class, WebPlatformTouchPoint. This is similar solution like in other
     11        events(like MouseEvent) on WebKit2. These classes are introduced in WebEvent.h
     12        Also there was a need to create an empty constructor to PlatformTouchPoint-class.
     13
     14        * DerivedSources.pro:
     15        * Shared/CoreIPCSupport/WebPageMessageKinds.h:
     16        (WebPageMessage::):
     17        * Shared/WebEvent.h:
     18        (WebKit::WebEvent::):
     19        (WebKit::WebTouchPoint::):
     20        (WebKit::WebTouchPoint::WebTouchPoint):
     21        (WebKit::WebTouchPoint::id):
     22        (WebKit::WebTouchPoint::state):
     23        (WebKit::WebTouchPoint::screenPosX):
     24        (WebKit::WebTouchPoint::screenPosY):
     25        (WebKit::WebTouchPoint::posX):
     26        (WebKit::WebTouchPoint::posY):
     27        (WebKit::WebTouchPoint::setState):
     28        (WebKit::WebTouchPoint::encode):
     29        (WebKit::WebTouchPoint::decode):
     30        (WebKit::WebTouchEvent::WebTouchEvent):
     31        (WebKit::WebTouchEvent::type):
     32        (WebKit::WebTouchEvent::touchPoints):
     33        (WebKit::WebTouchEvent::encode):
     34        (WebKit::WebTouchEvent::decode):
     35        (WebKit::WebTouchEvent::isTouchEventType):
     36        * Shared/WebEventConversion.cpp:
     37        (WebKit::WebKit2PlatformTouchPoint::WebKit2PlatformTouchPoint):
     38        (WebKit::WebKit2PlatformTouchEvent::WebKit2PlatformTouchEvent):
     39        (WebKit::platform):
     40        * Shared/WebEventConversion.h:
     41        * Shared/qt/WebEventFactoryQt.cpp:
     42        (WebKit::webEventTypeForEvent):
     43        (WebKit::WebEventFactory::createWebTouchEvent):
     44        * Shared/qt/WebEventFactoryQt.h:
     45        * UIProcess/API/qt/qgraphicswkview.cpp:
     46        (QGraphicsWKView::event):
     47        (QGraphicsWKView::touchEvent):
     48        * UIProcess/API/qt/qgraphicswkview.h:
     49        * UIProcess/API/qt/qwkpage.cpp:
     50        (QWKPagePrivate::touchEvent):
     51        * UIProcess/API/qt/qwkpage_p.h:
     52        * UIProcess/WebPageProxy.cpp:
     53        (WebKit::WebPageProxy::touchEvent):
     54        * UIProcess/WebPageProxy.h:
     55        * WebProcess/WebPage/WebPage.cpp:
     56        (WebKit::WebPage::touchEvent):
     57        (WebKit::WebPage::didReceiveMessage):
     58        * WebProcess/WebPage/WebPage.h:
     59
    1602010-08-21  Sam Weinig  <sam@webkit.org>
    261
  • trunk/WebKit2/DerivedSources.pro

    r65158 r65788  
    8181    platform/PlatformMouseEvent.h \
    8282    platform/PlatformStrategies.h \
     83    platform/PlatformTouchPoint.h \
     84    platform/PlatformTouchEvent.h \
    8385    platform/PlatformWheelEvent.h \
    8486    platform/PopupMenu.h \
  • trunk/WebKit2/Shared/CoreIPCSupport/WebPageMessageKinds.h

    r65644 r65788  
    5353    TryClose,
    5454    WheelEvent
     55#if ENABLE(TOUCH_EVENTS)
     56    , TouchEvent
     57#endif
    5558};
    5659
  • trunk/WebKit2/Shared/WebEvent.h

    r65465 r65788  
    5353        RawKeyDown,
    5454        Char
     55#if ENABLE(TOUCH_EVENTS)
     56        ,
     57        TouchStart,
     58        TouchMove,
     59        TouchEnd,
     60        TouchCancel
     61#endif
    5562    };
    5663
     
    328335};
    329336
     337#if ENABLE(TOUCH_EVENTS)
     338
     339class WebPlatformTouchPoint {
     340public:
     341    enum TouchPointState {
     342        TouchReleased,
     343        TouchPressed,
     344        TouchMoved,
     345        TouchStationary,
     346        TouchCancelled
     347    };
     348
     349    WebPlatformTouchPoint()
     350    {
     351    }
     352
     353    WebPlatformTouchPoint(unsigned id, TouchPointState state, int screenPosX, int screenPosY, int posX, int posY)
     354        : m_id(id)
     355        , m_state(state)
     356        , m_screenPosX(screenPosX)
     357        , m_screenPosY(screenPosY)
     358        , m_posX(posX)
     359        , m_posY(posY)
     360    {
     361    }
     362
     363    unsigned id() const { return m_id; }
     364    TouchPointState state() const { return m_state; }
     365
     366    int screenPosX() const { return m_screenPosX; }
     367    int screenPosY() const { return m_screenPosY; }
     368    int32_t posX() const { return m_posX; }
     369    int32_t posY() const { return m_posY; }
     370         
     371    void setState(TouchPointState state) { m_state = state; }
     372
     373    void encode(CoreIPC::ArgumentEncoder* encoder) const
     374    {
     375        encoder->encodeBytes(reinterpret_cast<const uint8_t*>(this), sizeof(*this));
     376    }
     377
     378    static bool decode(CoreIPC::ArgumentDecoder* decoder, WebPlatformTouchPoint& t)
     379    {
     380        return decoder->decodeBytes(reinterpret_cast<uint8_t*>(&t), sizeof(t));
     381    }
     382
     383private:
     384    unsigned m_id;
     385    TouchPointState m_state;
     386    int m_screenPosX, m_screenPosY;
     387    int32_t m_posX, m_posY;
     388
     389};
     390
     391class WebTouchEvent : public WebEvent {
     392public:
     393
     394    WebTouchEvent()
     395    {
     396    }
     397 
     398    WebTouchEvent(WebEvent::Type type, Vector<WebPlatformTouchPoint> touchPoints, bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, Modifiers modifiers, double timestamp)
     399        : WebEvent(type, modifiers, timestamp)
     400        , m_type(type)
     401        , m_touchPoints(touchPoints)
     402        , m_ctrlKey(ctrlKey)
     403        , m_altKey(altKey)
     404        , m_shiftKey(shiftKey)
     405        , m_metaKey(metaKey)
     406    {
     407        ASSERT(isTouchEventType(type));
     408    }
     409
     410    const Vector<WebPlatformTouchPoint> touchPoints() const { return m_touchPoints; }
     411
     412    void encode(CoreIPC::ArgumentEncoder* encoder) const
     413    {
     414        WebEvent::encode(encoder);
     415        encoder->encode(m_touchPoints);
     416    }
     417
     418    static bool decode(CoreIPC::ArgumentDecoder* decoder, WebTouchEvent& t)
     419    {
     420        if (!WebEvent::decode(decoder, t))
     421            return false;
     422
     423        if (!decoder->decode(t.m_touchPoints))
     424             return false;
     425
     426        return true;
     427    }
     428 
     429private:
     430    static bool isTouchEventType(Type type)
     431    {
     432        return type == TouchStart || type == TouchMove || type == TouchEnd;
     433    }
     434
     435    Type m_type;
     436    Vector<WebPlatformTouchPoint> m_touchPoints;
     437    bool m_ctrlKey;
     438    bool m_altKey;
     439    bool m_shiftKey;
     440    bool m_metaKey;
     441    double m_timestamp;
     442};
     443#endif
     444
    330445} // namespace WebKit
    331446
  • trunk/WebKit2/Shared/WebEventConversion.cpp

    r57308 r65788  
    152152}
    153153
     154#if ENABLE(TOUCH_EVENTS)
     155class WebKit2PlatformTouchPoint : public WebCore::PlatformTouchPoint {
     156public:
     157    WebKit2PlatformTouchPoint(const WebPlatformTouchPoint& webTouchPoint)
     158    {
     159        m_id = webTouchPoint.id();
     160
     161        switch (webTouchPoint.state()) {
     162        case WebPlatformTouchPoint::TouchReleased:
     163            m_state = PlatformTouchPoint::TouchReleased;
     164            break;
     165        case WebPlatformTouchPoint::TouchPressed:
     166            m_state = PlatformTouchPoint::TouchPressed;
     167            break;
     168        case WebPlatformTouchPoint::TouchMoved:
     169            m_state = PlatformTouchPoint::TouchMoved;
     170            break;
     171        case WebPlatformTouchPoint::TouchStationary:
     172            m_state = PlatformTouchPoint::TouchStationary;
     173            break;
     174        default:
     175            ASSERT_NOT_REACHED();
     176        }
     177
     178        WebCore::IntPoint screen(webTouchPoint.screenPosX(), webTouchPoint.screenPosY());
     179        WebCore::IntPoint position(webTouchPoint.posX(), webTouchPoint.posY());
     180
     181        m_screenPos = screen;
     182        m_pos = position;
     183    }
     184};
     185
     186class WebKit2PlatformTouchEvent : public WebCore::PlatformTouchEvent {
     187public:
     188    WebKit2PlatformTouchEvent(const WebTouchEvent& webEvent)
     189    {
     190        switch (webEvent.type()) {
     191        case WebEvent::TouchStart:
     192            m_type = WebCore::TouchStart;
     193            break;
     194        case WebEvent::TouchMove:
     195            m_type = WebCore::TouchMove;
     196            break;
     197        case WebEvent::TouchEnd:
     198            m_type = WebCore::TouchEnd;
     199            break;
     200        default:
     201            ASSERT_NOT_REACHED();
     202        }
     203
     204        for (int i = 0; i < webEvent.touchPoints().size(); ++i)
     205            m_touchPoints.append(WebKit2PlatformTouchPoint(webEvent.touchPoints().at(i)));
     206
     207        m_ctrlKey = webEvent.controlKey();
     208        m_altKey = webEvent.altKey();
     209        m_shiftKey = webEvent.shiftKey();
     210        m_metaKey = webEvent.metaKey();
     211    }
     212};
     213
     214WebCore::PlatformTouchEvent platform(const WebTouchEvent& webEvent)
     215{
     216    return WebKit2PlatformTouchEvent(webEvent);
     217}
     218#endif
     219
    154220} // namespace WebKit
  • trunk/WebKit2/Shared/WebEventConversion.h

    r57308 r65788  
    3030#include <WebCore/PlatformMouseEvent.h>
    3131#include <WebCore/PlatformWheelEvent.h>
     32#if ENABLE(TOUCH_EVENTS)
     33#include <WebCore/PlatformTouchEvent.h>
     34#include <WebCore/PlatformTouchPoint.h>
     35#endif
    3236
    3337namespace WebKit {
     
    3640class WebWheelEvent;
    3741class WebKeyboardEvent;
    38 
     42#if ENABLE(TOUCH_EVENTS)
     43class WebTouchEvent;
     44class WebTouchPoint;
     45#endif
    3946WebCore::PlatformMouseEvent platform(const WebMouseEvent&);
    4047WebCore::PlatformWheelEvent platform(const WebWheelEvent&);
    4148WebCore::PlatformKeyboardEvent platform(const WebKeyboardEvent&);
    42 
     49#if ENABLE(TOUCH_EVENTS)
     50WebCore::PlatformTouchEvent platform(const WebTouchEvent&);
     51WebCore::PlatformTouchPoint platform(const WebTouchPoint&);
     52#endif
    4353} // namespace WebKit
    4454
  • trunk/WebKit2/Shared/qt/WebEventFactoryQt.cpp

    r64127 r65788  
    2626
    2727#include "WebEventFactoryQt.h"
    28 
    2928#include <qgraphicssceneevent.h>
    3029#include <QApplication>
     
    6564        case QEvent::KeyRelease:
    6665            return WebEvent::KeyUp;
     66#if ENABLE(TOUCH_EVENTS)
     67        case QEvent::TouchBegin:
     68            return WebEvent::TouchStart;
     69        case QEvent::TouchUpdate:
     70            return WebEvent::TouchMove;
     71        case QEvent::TouchEnd:
     72            return WebEvent::TouchEnd;
     73#endif
    6774        default:
    6875            // assert
     
    162169}
    163170
     171#if ENABLE(TOUCH_EVENTS)
     172
     173WebTouchEvent WebEventFactory::createWebTouchEvent(QTouchEvent* event)
     174{
     175    WebEvent::Type type  = webEventTypeForEvent(event);
     176    WebPlatformTouchPoint::TouchPointState state;
     177    unsigned int id;
     178    WebEvent::Modifiers modifiers   = modifiersForEvent(event->modifiers());
     179    double timestamp                = WTF::currentTime();
     180
     181    const QList<QTouchEvent::TouchPoint>& points = event->touchPoints();
     182   
     183    Vector<WebPlatformTouchPoint> m_touchPoints;
     184    for (int i = 0; i < points.count(); ++i) {
     185        id = static_cast<unsigned>(points.at(i).id());
     186        switch (points.at(i).state()) {
     187        case Qt::TouchPointReleased:
     188            state = WebPlatformTouchPoint::TouchReleased;
     189            break;
     190        case Qt::TouchPointMoved:
     191            state = WebPlatformTouchPoint::TouchMoved;
     192            break;
     193        case Qt::TouchPointPressed:
     194            state = WebPlatformTouchPoint::TouchPressed;
     195            break;
     196        case Qt::TouchPointStationary:
     197            state = WebPlatformTouchPoint::TouchStationary;
     198            break;
     199        }
     200
     201        m_touchPoints.append(WebPlatformTouchPoint(id, state, points.at(i).screenPos().toPoint().x(),
     202            points.at(i).screenPos().toPoint().y(),
     203            points.at(i).pos().toPoint().x(),
     204            points.at(i).pos().toPoint().y()));
     205        }
     206
     207    bool m_ctrlKey = (event->modifiers() & Qt::ControlModifier);
     208    bool m_altKey = (event->modifiers() & Qt::AltModifier);
     209    bool m_shiftKey = (event->modifiers() & Qt::ShiftModifier);
     210    bool m_metaKey = (event->modifiers() & Qt::MetaModifier);
     211
     212    return WebTouchEvent(type, m_touchPoints, m_ctrlKey, m_altKey, m_shiftKey, m_metaKey, modifiers, timestamp);
     213}
     214#endif
     215
    164216} // namespace WebKit
  • trunk/WebKit2/Shared/qt/WebEventFactoryQt.h

    r62263 r65788  
    3030#include "WebEvent.h"
    3131
     32#if ENABLE(TOUCH_EVENTS)
     33class QTouchEvent;
     34#endif
     35
    3236class QGraphicsSceneMouseEvent;
    3337class QGraphicsSceneWheelEvent;
     
    4145    static WebWheelEvent createWebWheelEvent(QGraphicsSceneWheelEvent* event);
    4246    static WebKeyboardEvent createWebKeyboardEvent(QKeyEvent* event);
     47#if ENABLE(TOUCH_EVENTS)
     48    static WebTouchEvent createWebTouchEvent(QTouchEvent* event);
     49#endif
    4350};
    4451
  • trunk/WebKit2/UIProcess/API/qt/qgraphicswkview.cpp

    r65751 r65788  
    156156bool QGraphicsWKView::event(QEvent* event)
    157157{
     158#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
     159    if (event->type() == QEvent::TouchBegin || event->type() == QEvent::TouchEnd || event->type() == QEvent::TouchUpdate) {
     160        touchEvent(static_cast<QTouchEvent*>(event));
     161        return true;
     162    }
     163#endif
     164
    158165    // Here so that it can be reimplemented without breaking ABI.
    159166    return QGraphicsWidget::event(event);
     
    237244        QGraphicsItem::wheelEvent(ev);
    238245}
     246
     247#if ENABLE(TOUCH_EVENTS)
     248void QGraphicsWKView::touchEvent(QTouchEvent* ev)
     249{
     250    page()->d->touchEvent(ev);
     251}
     252#endif
    239253
    240254QGraphicsWKViewPrivate::QGraphicsWKViewPrivate(QGraphicsWKView* view)
  • trunk/WebKit2/UIProcess/API/qt/qgraphicswkview.h

    r65751 r65788  
    7171    virtual void mouseDoubleClickEvent(QGraphicsSceneMouseEvent*);
    7272    virtual void wheelEvent(QGraphicsSceneWheelEvent*);
     73    virtual void touchEvent(QTouchEvent*);
    7374
    7475    virtual void hoverMoveEvent(QGraphicsSceneHoverEvent*);
  • trunk/WebKit2/UIProcess/API/qt/qwkpage.cpp

    r65751 r65788  
    3535#include <WebKit2/WKRetainPtr.h>
    3636
     37#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
     38#include <QTouchEvent>
     39#endif
     40
    3741using namespace WebKit;
    3842using namespace WebCore;
     
    201205}
    202206#endif // QT_NO_ACTION
     207
     208#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
     209
     210void QWKPagePrivate::touchEvent(QTouchEvent* event)
     211{
     212    WebTouchEvent touchEvent = WebEventFactory::createWebTouchEvent(event);
     213    page->touchEvent(touchEvent);
     214}
     215
     216#endif
    203217
    204218QWKPage::QWKPage(WKPageNamespaceRef namespaceRef)
  • trunk/WebKit2/UIProcess/API/qt/qwkpage_p.h

    r65751 r65788  
    6868    void _q_webActionTriggered(bool checked);
    6969
     70#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
     71    void touchEvent(QTouchEvent*);
     72#endif
     73
    7074    QAction* actions[QWKPage::WebActionCount];
    7175
  • trunk/WebKit2/UIProcess/WebPageProxy.cpp

    r65699 r65788  
    333333}
    334334
     335#if ENABLE(TOUCH_EVENTS)
     336void WebPageProxy::touchEvent(const WebTouchEvent& event)
     337{
     338    if (!isValid())
     339        return;
     340    process()->send(WebPageMessage::TouchEvent, m_pageID, CoreIPC::In(event));
     341}
     342#endif
     343
    335344void WebPageProxy::receivedPolicyDecision(WebCore::PolicyAction action, WebFrameProxy* frame, uint64_t listenerID)
    336345{
  • trunk/WebKit2/UIProcess/WebPageProxy.h

    r65699 r65788  
    127127    void wheelEvent(const WebWheelEvent&);
    128128    void keyEvent(const WebKeyboardEvent&);
     129#if ENABLE(TOUCH_EVENTS)
     130    void touchEvent(const WebTouchEvent&);
     131#endif
    129132
    130133    const WTF::String& pageTitle() const { return m_pageTitle; }
  • trunk/WebKit2/WebProcess/WebPage/WebPage.cpp

    r65644 r65788  
    420420}
    421421
     422#if ENABLE(TOUCH_EVENTS)
     423void WebPage::touchEvent(const WebTouchEvent& touchEvent)
     424{
     425    CurrentEvent currentEvent(touchEvent);
     426    WebProcess::shared().connection()->send(WebPageProxyMessage::DidReceiveEvent, m_pageID, CoreIPC::In(static_cast<uint32_t>(touchEvent.type())));
     427           
     428    if (!m_mainFrame->coreFrame()->view())
     429        return;
     430
     431    PlatformTouchEvent platformTouchEvent = platform(touchEvent);
     432    m_mainFrame->coreFrame()->eventHandler()->handleTouchEvent(platformTouchEvent);
     433}
     434#endif
     435
    422436void WebPage::setActive(bool isActive)
    423437{
     
    589603            return;
    590604        }
     605#if ENABLE(TOUCH_EVENTS)
     606        case WebPageMessage::TouchEvent: {
     607            WebTouchEvent event;
     608            if (!arguments->decode(event))
     609                return;
     610            touchEvent(event);
     611        }
     612#endif
    591613        case WebPageMessage::LoadURL: {
    592614            String url;
  • trunk/WebKit2/WebProcess/WebPage/WebPage.h

    r65644 r65788  
    4141#include <wtf/RefPtr.h>
    4242#include <wtf/text/WTFString.h>
     43#if ENABLE(TOUCH_EVENTS)
     44#include <WebCore/PlatformTouchEvent.h>
     45#endif
    4346
    4447namespace CoreIPC {
     
    6265class WebMouseEvent;
    6366class WebWheelEvent;
     67#if ENABLE(TOUCH_EVENTS)
     68class WebTouchEvent;
     69#endif
    6470struct WebPreferencesStore;
    6571
     
    153159    void wheelEvent(const WebWheelEvent&);
    154160    void keyEvent(const WebKeyboardEvent&);
     161#if ENABLE(TOUCH_EVENTS)
     162    void touchEvent(const WebTouchEvent&);
     163#endif
    155164    void runJavaScriptInMainFrame(const WTF::String&, uint64_t callbackID);
    156165    void getRenderTreeExternalRepresentation(uint64_t callbackID);
Note: See TracChangeset for help on using the changeset viewer.