Changeset 69877 in webkit


Ignore:
Timestamp:
Oct 15, 2010 2:05:20 PM (14 years ago)
Author:
andersca@apple.com
Message:

Hide the find indicator/overlay when necessary
https://bugs.webkit.org/show_bug.cgi?id=47737

Reviewed by Sam Weinig.

  • WebProcess/WebCoreSupport/WebChromeClient.cpp:

(WebKit::WebChromeClient::invalidateContentsForSlowScroll):
Hide the find indicator.

(WebKit::WebChromeClient::scroll):
Ditto.

  • WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:

(WebKit::WebFrameLoaderClient::dispatchDidStartProvisionalLoad):
Hide the find indicator and the find overlay.

  • WebProcess/WebPage/FindController.cpp:

(WebKit::FindController::findString):
Always hide all previous find matches. Only clear the selection if the string
not found wasn't empty.

(WebKit::FindController::hideFindUI):
Uninstall the page overlay and hide the find indicator.

(WebKit::FindController::hideFindIndicator):
Rename resetFindIndicator to hideFindIndicator.

  • WebProcess/WebPage/WebPage.cpp:

(WebKit::WebPage::uninstallPageOverlay):
Invalidate the entire page.

Location:
trunk/WebKit2
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKit2/ChangeLog

    r69871 r69877  
     12010-10-15  Anders Carlsson  <andersca@apple.com>
     2
     3        Reviewed by Sam Weinig.
     4
     5        Hide the find indicator/overlay when necessary
     6        https://bugs.webkit.org/show_bug.cgi?id=47737
     7
     8        * WebProcess/WebCoreSupport/WebChromeClient.cpp:
     9        (WebKit::WebChromeClient::invalidateContentsForSlowScroll):
     10        Hide the find indicator.
     11
     12        (WebKit::WebChromeClient::scroll):
     13        Ditto.
     14
     15        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
     16        (WebKit::WebFrameLoaderClient::dispatchDidStartProvisionalLoad):
     17        Hide the find indicator and the find overlay.
     18
     19        * WebProcess/WebPage/FindController.cpp:
     20        (WebKit::FindController::findString):
     21        Always hide all previous find matches. Only clear the selection if the string
     22        not found wasn't empty.
     23
     24        (WebKit::FindController::hideFindUI):
     25        Uninstall the page overlay and hide the find indicator.
     26
     27        (WebKit::FindController::hideFindIndicator):
     28        Rename resetFindIndicator to hideFindIndicator.
     29
     30        * WebProcess/WebPage/WebPage.cpp:
     31        (WebKit::WebPage::uninstallPageOverlay):
     32        Invalidate the entire page.
     33
    1342010-10-15  Anders Carlsson  <andersca@apple.com>
    235
  • trunk/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp

    r69491 r69877  
    323323void WebChromeClient::invalidateContentsForSlowScroll(const IntRect& rect, bool immediate)
    324324{
     325    // Hide the find indicator.
     326    m_page->findController().hideFindIndicator();
     327
    325328    m_page->drawingArea()->invalidateContentsForSlowScroll(rect, immediate);
    326329}
     
    328331void WebChromeClient::scroll(const IntSize& scrollDelta, const IntRect& rectToScroll, const IntRect& clipRect)
    329332{
     333    // Hide the find indicator.
     334    m_page->findController().hideFindIndicator();
     335
    330336    m_page->drawingArea()->scroll(scrollDelta, rectToScroll, clipRect);
    331337}
  • trunk/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp

    r69688 r69877  
    290290        return;
    291291
     292    webPage->findController().hideFindUI();
     293   
    292294    DocumentLoader* provisionalLoader = m_frame->coreFrame()->loader()->provisionalDocumentLoader();
    293295    const String& url = provisionalLoader->url().string();
  • trunk/WebKit2/WebProcess/WebPage/FindController.cpp

    r69862 r69877  
    5959void FindController::findString(const String& string, FindDirection findDirection, FindOptions findOptions, unsigned maxNumMatches)
    6060{
     61    m_webPage->corePage()->unmarkAllTextMatches();
     62
    6163    TextCaseSensitivity caseSensitivity = findOptions & FindOptionsCaseInsensitive ? TextCaseInsensitive : TextCaseSensitive;
    6264    bool found = m_webPage->corePage()->findString(string, caseSensitivity,
     
    6971
    7072    if (!found) {
    71         // We didn't find the string, clear all text matches.
    72         m_webPage->corePage()->unmarkAllTextMatches();
    73 
    7473        // And clear the selection.
    75         if (selectedFrame)
     74        if (!string.isEmpty() && selectedFrame)
    7675            selectedFrame->selection()->clear();
    7776
    78         resetFindIndicator();
     77        hideFindIndicator();
    7978    } else {
    8079        shouldShowOverlay = findOptions & FindOptionsShowOverlay;
     
    9089        if (!(findOptions & FindOptionsShowFindIndicator) || !updateFindIndicator(selectedFrame, shouldShowOverlay)) {
    9190            // Either we shouldn't show the find indicator, or we couldn't update it.
    92             resetFindIndicator();
     91            hideFindIndicator();
    9392        }
    9493    }
     
    116115void FindController::hideFindUI()
    117116{
    118     // FIXME: Implement.
     117    if (m_findPageOverlay)
     118        m_webPage->uninstallPageOverlay();
     119
     120    hideFindIndicator();
    119121}
    120122
     
    169171}
    170172
    171 void FindController::resetFindIndicator()
     173void FindController::hideFindIndicator()
    172174{
    173175    if (!m_isShowingFindIndicator)
  • trunk/WebKit2/WebProcess/WebPage/FindController.h

    r69862 r69877  
    5151    void findPageOverlayDestroyed();
    5252
     53    void hideFindIndicator();
     54
    5355private:
    5456    bool updateFindIndicator(WebCore::Frame* selectedFrame, bool isShowingOverlay);
    55     void resetFindIndicator();
    5657   
    5758    WebPage* m_webPage;
  • trunk/WebKit2/WebProcess/WebPage/WebPage.cpp

    r69826 r69877  
    425425{
    426426    m_pageOverlay = 0;
     427    m_drawingArea->setNeedsDisplay(IntRect(IntPoint(0, 0), m_viewSize));
    427428}
    428429
  • trunk/WebKit2/WebProcess/WebPage/WebPage.h

    r69826 r69877  
    164164    static const WebEvent* currentEvent();
    165165
     166    FindController& findController() { return m_findController; }
     167
    166168private:
    167169    WebPage(uint64_t pageID, const WebPageCreationParameters&);
Note: See TracChangeset for help on using the changeset viewer.