Changeset 64050 in webkit


Ignore:
Timestamp:
Jul 26, 2010 10:03:31 AM (14 years ago)
Author:
andersca@apple.com
Message:

Clean up event handling functions
https://bugs.webkit.org/show_bug.cgi?id=42977

Reviewed by Sam Weinig.

  • WebProcess/WebPage/WebPage.cpp:

(WebKit::WebPage::mouseEvent):
(WebKit::WebPage::wheelEvent):
(WebKit::WebPage::keyEvent):
(WebKit::WebPage::didReceiveMessage):

  • WebProcess/WebPage/WebPage.h:
Location:
trunk/WebKit2
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKit2/ChangeLog

    r64029 r64050  
     12010-07-26  Anders Carlsson  <andersca@apple.com>
     2
     3        Reviewed by Sam Weinig.
     4
     5        Clean up event handling functions
     6        https://bugs.webkit.org/show_bug.cgi?id=42977
     7
     8        * WebProcess/WebPage/WebPage.cpp:
     9        (WebKit::WebPage::mouseEvent):
     10        (WebKit::WebPage::wheelEvent):
     11        (WebKit::WebPage::keyEvent):
     12        (WebKit::WebPage::didReceiveMessage):
     13        * WebProcess/WebPage/WebPage.h:
     14
    1152010-07-25  Darin Adler  <darin@apple.com>
    216
  • trunk/WebKit2/WebProcess/WebPage/WebPage.cpp

    r63930 r64050  
    278278// Events
    279279
    280 void WebPage::mouseEvent(const PlatformMouseEvent& event)
    281 {
     280void WebPage::mouseEvent(const WebMouseEvent& mouseEvent)
     281{
     282    WebProcess::shared().connection()->send(WebPageProxyMessage::DidReceiveEvent, m_pageID, CoreIPC::In(static_cast<uint32_t>(mouseEvent.type())));
     283
    282284    if (!m_mainFrame->coreFrame()->view())
    283285        return;
    284286
    285     switch (event.eventType()) {
     287    PlatformMouseEvent platformMouseEvent = platform(mouseEvent);
     288   
     289    switch (platformMouseEvent.eventType()) {
    286290        case WebCore::MouseEventPressed:
    287             m_mainFrame->coreFrame()->eventHandler()->handleMousePressEvent(event);
     291            m_mainFrame->coreFrame()->eventHandler()->handleMousePressEvent(platformMouseEvent);
    288292            break;
    289293        case WebCore::MouseEventReleased:
    290             m_mainFrame->coreFrame()->eventHandler()->handleMouseReleaseEvent(event);
     294            m_mainFrame->coreFrame()->eventHandler()->handleMouseReleaseEvent(platformMouseEvent);
    291295            break;
    292296        case WebCore::MouseEventMoved:
    293             m_mainFrame->coreFrame()->eventHandler()->mouseMoved(event);
     297            m_mainFrame->coreFrame()->eventHandler()->mouseMoved(platformMouseEvent);
    294298            break;
    295299        default:
     
    299303}
    300304
    301 void WebPage::wheelEvent(PlatformWheelEvent& event)
    302 {
     305void WebPage::wheelEvent(const WebWheelEvent& wheelEvent)
     306{
     307    WebProcess::shared().connection()->send(WebPageProxyMessage::DidReceiveEvent, m_pageID, CoreIPC::In(static_cast<uint32_t>(wheelEvent.type())));
    303308    if (!m_mainFrame->coreFrame()->view())
    304309        return;
    305310
    306     m_mainFrame->coreFrame()->eventHandler()->handleWheelEvent(event);
    307 }
    308 
    309 void WebPage::keyEvent(const PlatformKeyboardEvent& event)
    310 {
     311    PlatformWheelEvent platformWheelEvent = platform(wheelEvent);
     312    m_mainFrame->coreFrame()->eventHandler()->handleWheelEvent(platformWheelEvent);
     313}
     314
     315void WebPage::keyEvent(const WebKeyboardEvent& keyboardEvent)
     316{
     317    WebProcess::shared().connection()->send(WebPageProxyMessage::DidReceiveEvent, m_pageID, CoreIPC::In(static_cast<uint32_t>(keyboardEvent.type())));
     318
    311319    if (!m_mainFrame->coreFrame()->view())
    312320        return;
    313321
    314     m_page->focusController()->focusedOrMainFrame()->eventHandler()->keyEvent(event);
     322    PlatformKeyboardEvent platformKeyboardEvent = platform(keyboardEvent);
     323    m_page->focusController()->focusedOrMainFrame()->eventHandler()->keyEvent(platformKeyboardEvent);
    315324}
    316325
     
    441450            if (!arguments.decode(event))
    442451                return;
    443             connection->send(WebPageProxyMessage::DidReceiveEvent, m_pageID, CoreIPC::In((uint32_t)event.type()));
    444             PlatformMouseEvent platformEvent = platform(event);
    445             mouseEvent(platformEvent);
     452            mouseEvent(event);
    446453            return;
    447454        }
     
    458465            if (!arguments.decode(event))
    459466                return;
    460             connection->send(WebPageProxyMessage::DidReceiveEvent, m_pageID, CoreIPC::In((uint32_t)event.type()));
    461             PlatformWheelEvent platformEvent = platform(event);
    462             wheelEvent(platformEvent);
     467
     468            wheelEvent(event);
    463469            return;
    464470        }
     
    467473            if (!arguments.decode(event))
    468474                return;
    469             connection->send(WebPageProxyMessage::DidReceiveEvent, m_pageID, CoreIPC::In((uint32_t)event.type()));
    470             PlatformKeyboardEvent platformEvent = platform(event);
    471             keyEvent(platformEvent);
     475
     476            keyEvent(event);
    472477            return;
    473478        }
  • trunk/WebKit2/WebProcess/WebPage/WebPage.h

    r63930 r64050  
    4949    class KeyboardEvent;
    5050    class Page;
    51     class PlatformKeyboardEvent;
    52     class PlatformMouseEvent;
    53     class PlatformWheelEvent;
    5451    class String;
    5552}
     
    5956class DrawingArea;
    6057class WebFrame;
     58class WebKeyboardEvent;
     59class WebMouseEvent;
     60class WebWheelEvent;
    6161struct WebPreferencesStore;
    6262
     
    127127    void setFocused(bool);
    128128    void setIsInWindow(bool);
    129     void mouseEvent(const WebCore::PlatformMouseEvent&);
    130     void wheelEvent(WebCore::PlatformWheelEvent&);
    131     void keyEvent(const WebCore::PlatformKeyboardEvent&);
     129    void mouseEvent(const WebMouseEvent&);
     130    void wheelEvent(const WebWheelEvent&);
     131    void keyEvent(const WebKeyboardEvent&);
    132132    void runJavaScriptInMainFrame(const WebCore::String&, uint64_t callbackID);
    133133    void getRenderTreeExternalRepresentation(uint64_t callbackID);
Note: See TracChangeset for help on using the changeset viewer.