Only reveal selection service UI after a short delay.
authorbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 1 May 2014 04:48:35 +0000 (04:48 +0000)
committerbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 1 May 2014 04:48:35 +0000 (04:48 +0000)
commit1affbabe8cb1b31fbf583a20c9568ce398bc18e1
treeb5b047ff94269c861a0662ad6cbb3a88b0a60c9d
parentd5b7487d9479f0f5d5f0c85b1dc24b1e72db03f9
Only reveal selection service UI after a short delay.
<rdar://problem/16777346> and https://bugs.webkit.org/show_bug.cgi?id=132418

Reviewed by Sam Weinig.

* WebProcess/WebPage/SelectionOverlayController.cpp:
(WebKit::SelectionOverlayController::SelectionOverlayController):
(WebKit::SelectionOverlayController::destroyOverlay): Also stop the hover timer.
(WebKit::SelectionOverlayController::selectionRectsDidChange): Mark the highlight as dirty.
(WebKit::SelectionOverlayController::hoverTimerFired): If the mouse is still over the highlight,
  set the visible flag and setNeedsDisplay().
* WebProcess/WebPage/SelectionOverlayController.h:

* WebProcess/WebPage/mac/SelectionOverlayControllerMac.mm:
(WebKit::SelectionOverlayController::drawRect): Recreate the highlight if it exists but
  is marked as dirty. After doing that, possibly reset the hover timer.
  Also, only performing the actual drawing if the visible flag is set.
(WebKit::SelectionOverlayController::mouseEvent): If the mouse moves on or off the highlight,
  start or stop the hover timer accordingly.
(WebKit::SelectionOverlayController::mouseHoverStateChanged): Handle starting/stopping the
  hover timer.
(WebKit::SelectionOverlayController::clearHighlight): Deleted.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@168084 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/WebPage/SelectionOverlayController.cpp
Source/WebKit2/WebProcess/WebPage/SelectionOverlayController.h
Source/WebKit2/WebProcess/WebPage/mac/SelectionOverlayControllerMac.mm