Skip to content
Permalink
Browse files
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.

Canonical link: https://commits.webkit.org/60569@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@70004 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
Anders Carlsson committed Oct 18, 2010
1 parent 495b928 commit 536bdf371c6537388d8efa85609f791a7eff6c0e
Showing 5 changed files with 42 additions and 3 deletions.
@@ -1,3 +1,18 @@
2010-10-18 Anders Carlsson <andersca@apple.com>

Reviewed by John Sullivan.

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

* 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.

2010-10-18 Anders Carlsson <andersca@apple.com>

Fix clang build.
@@ -140,4 +140,15 @@ void FindPageOverlay::drawRect(GraphicsContext& graphicsContext, const IntRect&
graphicsContext.endTransparencyLayer();
}

bool FindPageOverlay::mouseEvent(const WebMouseEvent& event)
{
if (event.type() == WebEvent::MouseDown) {
// Dismiss the overlay.
m_findController->hideFindUI();
return false;
}

return false;
}

} // namespace WebKit
@@ -46,6 +46,7 @@ class FindPageOverlay : public PageOverlay {

// PageOverlay.
virtual void drawRect(WebCore::GraphicsContext&, const WebCore::IntRect& dirtyRect);
virtual bool mouseEvent(const WebMouseEvent&);

FindController* m_findController;
};
@@ -35,6 +35,7 @@ namespace WebCore {

namespace WebKit {

class WebMouseEvent;
class WebPage;

class PageOverlay {
@@ -43,7 +44,8 @@ class PageOverlay {
public:
virtual ~PageOverlay();
virtual void drawRect(WebCore::GraphicsContext&, const WebCore::IntRect& dirtyRect) = 0;

virtual bool mouseEvent(const WebMouseEvent&) = 0;

void setPage(WebPage*);
void setNeedsDisplay();

@@ -493,9 +493,19 @@ static bool handleMouseEvent(const WebMouseEvent& mouseEvent, Page* page)

void WebPage::mouseEvent(const WebMouseEvent& mouseEvent)
{
CurrentEvent currentEvent(mouseEvent);
bool handled = false;

if (m_pageOverlay) {
// Let the page overlay handle the event.
handled = m_pageOverlay->mouseEvent(mouseEvent);
}

if (!handled) {
CurrentEvent currentEvent(mouseEvent);

handled = handleMouseEvent(mouseEvent, m_page.get());
}

bool handled = handleMouseEvent(mouseEvent, m_page.get());
WebProcess::shared().connection()->send(Messages::WebPageProxy::DidReceiveEvent(static_cast<uint32_t>(mouseEvent.type()), handled), m_pageID);
}

0 comments on commit 536bdf3

Please sign in to comment.