Changeset 70004 in webkit


Ignore:
Timestamp:
Oct 18, 2010 3:40:38 PM (14 years ago)
Author:
andersca@apple.com
Message:

WebKit2 should handle dismissing the Find overlay on mouse-down
https://bugs.webkit.org/show_bug.cgi?id=47854

Reviewed by John Sullivan.

  • WebProcess/WebPage/FindPageOverlay.cpp:

(WebKit::FindPageOverlay::mouseEvent):
Dismiss the find UI on MouseDown.

  • WebProcess/WebPage/WebPage.cpp:

(WebKit::WebPage::mouseEvent):
If there's a page overlay, let it have a go at the event.

Location:
trunk/WebKit2
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKit2/ChangeLog

    r70001 r70004  
     12010-10-18  Anders Carlsson  <andersca@apple.com>
     2
     3        Reviewed by John Sullivan.
     4
     5        WebKit2 should handle dismissing the Find overlay on mouse-down
     6        https://bugs.webkit.org/show_bug.cgi?id=47854
     7
     8        * WebProcess/WebPage/FindPageOverlay.cpp:
     9        (WebKit::FindPageOverlay::mouseEvent):
     10        Dismiss the find UI on MouseDown.
     11
     12        * WebProcess/WebPage/WebPage.cpp:
     13        (WebKit::WebPage::mouseEvent):
     14        If there's a page overlay, let it have a go at the event.
     15
    1162010-10-18  Anders Carlsson  <andersca@apple.com>
    217
  • trunk/WebKit2/WebProcess/WebPage/FindPageOverlay.cpp

    r69711 r70004  
    141141}
    142142
     143bool FindPageOverlay::mouseEvent(const WebMouseEvent& event)
     144{
     145    if (event.type() == WebEvent::MouseDown) {
     146        // Dismiss the overlay.
     147        m_findController->hideFindUI();
     148        return false;
     149    }
     150
     151    return false;
     152}
     153
    143154} // namespace WebKit
  • trunk/WebKit2/WebProcess/WebPage/FindPageOverlay.h

    r69625 r70004  
    4747    // PageOverlay.
    4848    virtual void drawRect(WebCore::GraphicsContext&, const WebCore::IntRect& dirtyRect);
     49    virtual bool mouseEvent(const WebMouseEvent&);
    4950
    5051    FindController* m_findController;
  • trunk/WebKit2/WebProcess/WebPage/PageOverlay.h

    r69625 r70004  
    3636namespace WebKit {
    3737
     38class WebMouseEvent;
    3839class WebPage;
    3940
     
    4445    virtual ~PageOverlay();
    4546    virtual void drawRect(WebCore::GraphicsContext&, const WebCore::IntRect& dirtyRect) = 0;
    46    
     47    virtual bool mouseEvent(const WebMouseEvent&) = 0;
     48
    4749    void setPage(WebPage*);
    4850    void setNeedsDisplay();
  • trunk/WebKit2/WebProcess/WebPage/WebPage.cpp

    r69997 r70004  
    494494void WebPage::mouseEvent(const WebMouseEvent& mouseEvent)
    495495{
    496     CurrentEvent currentEvent(mouseEvent);
    497 
    498     bool handled = handleMouseEvent(mouseEvent, m_page.get());
     496    bool handled = false;
     497   
     498    if (m_pageOverlay) {
     499        // Let the page overlay handle the event.
     500        handled = m_pageOverlay->mouseEvent(mouseEvent);
     501    }
     502
     503    if (!handled) {
     504        CurrentEvent currentEvent(mouseEvent);
     505
     506        handled = handleMouseEvent(mouseEvent, m_page.get());
     507    }
     508
    499509    WebProcess::shared().connection()->send(Messages::WebPageProxy::DidReceiveEvent(static_cast<uint32_t>(mouseEvent.type()), handled), m_pageID);
    500510}
Note: See TracChangeset for help on using the changeset viewer.