Commit 6be0ee60 authored by andersca@apple.com's avatar andersca@apple.com
Browse files

Add a pageDidScroll BundleUIClient callback

https://bugs.webkit.org/show_bug.cgi?id=48260
<rdar://problem/8531159>

Reviewed by Adam Roben.

WebKit2:

* WebProcess/InjectedBundle/API/c/WKBundlePage.h:
* WebProcess/InjectedBundle/InjectedBundlePageUIClient.cpp:
(WebKit::InjectedBundlePageUIClient::pageDidScroll):
Call the pageDidScroll callback.

* WebProcess/InjectedBundle/InjectedBundlePageUIClient.h:
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::invalidateContentsForSlowScroll):
(WebKit::WebChromeClient::scroll):
Call pageDidScroll.

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::pageDidScroll):
Hide the find banner UI and call the BundleUIClient pageDidScroll callback.

WebKitTools:

* WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
(WTR::InjectedBundlePage::InjectedBundlePage):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@70480 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent ee4fefeb
2010-10-25 Anders Carlsson <andersca@apple.com>
Reviewed by Adam Roben.
Add a pageDidScroll BundleUIClient callback
https://bugs.webkit.org/show_bug.cgi?id=48260
<rdar://problem/8531159>
* WebProcess/InjectedBundle/API/c/WKBundlePage.h:
* WebProcess/InjectedBundle/InjectedBundlePageUIClient.cpp:
(WebKit::InjectedBundlePageUIClient::pageDidScroll):
Call the pageDidScroll callback.
* WebProcess/InjectedBundle/InjectedBundlePageUIClient.h:
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::invalidateContentsForSlowScroll):
(WebKit::WebChromeClient::scroll):
Call pageDidScroll.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::pageDidScroll):
Hide the find banner UI and call the BundleUIClient pageDidScroll callback.
2010-10-25 Brian Weinstein <bweinstein@apple.com>
 
Reviewed by Adam Roben.
......
......@@ -119,6 +119,7 @@ typedef void (*WKBundlePageWillRunJavaScriptAlertCallback)(WKBundlePageRef page,
typedef void (*WKBundlePageWillRunJavaScriptConfirmCallback)(WKBundlePageRef page, WKStringRef message, WKBundleFrameRef frame, const void *clientInfo);
typedef void (*WKBundlePageWillRunJavaScriptPromptCallback)(WKBundlePageRef page, WKStringRef message, WKStringRef defaultValue, WKBundleFrameRef frame, const void *clientInfo);
typedef void (*WKBundlePageMouseDidMoveOverElementCallback)(WKBundlePageRef page, WKBundleHitTestResultRef hitTestResult, WKEventModifiers modifiers, WKTypeRef* userData, const void *clientInfo);
typedef void (*WKBundlePageDidScrollCallback)(WKBundlePageRef page, const void *clientInfo);
struct WKBundlePageUIClient {
int version;
......@@ -129,6 +130,7 @@ struct WKBundlePageUIClient {
WKBundlePageWillRunJavaScriptConfirmCallback willRunJavaScriptConfirm;
WKBundlePageWillRunJavaScriptPromptCallback willRunJavaScriptPrompt;
WKBundlePageMouseDidMoveOverElementCallback mouseDidMoveOverElement;
WKBundlePageDidScrollCallback pageDidScroll;
};
typedef struct WKBundlePageUIClient WKBundlePageUIClient;
......
......@@ -89,4 +89,10 @@ void InjectedBundlePageUIClient::mouseDidMoveOverElement(WebPage* page, const Hi
userData = adoptRef(toImpl(userDataToPass));
}
void InjectedBundlePageUIClient::pageDidScroll(WebPage* page)
{
if (m_client.pageDidScroll)
m_client.pageDidScroll(toAPI(page), m_client.clientInfo);
}
} // namespace WebKit
......@@ -51,6 +51,7 @@ public:
void willRunJavaScriptConfirm(WebPage*, const String&, WebFrame*);
void willRunJavaScriptPrompt(WebPage*, const String&, const String&, WebFrame*);
void mouseDidMoveOverElement(WebPage*, const WebCore::HitTestResult&, WebEvent::Modifiers, RefPtr<APIObject>& userData);
void pageDidScroll(WebPage*);
private:
WKBundlePageUIClient m_client;
......
......@@ -325,17 +325,13 @@ void WebChromeClient::invalidateContentsAndWindow(const IntRect& rect, bool imme
void WebChromeClient::invalidateContentsForSlowScroll(const IntRect& rect, bool immediate)
{
// Hide the find indicator.
m_page->findController().hideFindIndicator();
m_page->pageDidScroll();
m_page->drawingArea()->invalidateContentsForSlowScroll(rect, immediate);
}
void WebChromeClient::scroll(const IntSize& scrollDelta, const IntRect& rectToScroll, const IntRect& clipRect)
{
// Hide the find indicator.
m_page->findController().hideFindIndicator();
m_page->pageDidScroll();
m_page->drawingArea()->scroll(scrollDelta, rectToScroll, clipRect);
}
......
......@@ -448,6 +448,14 @@ void WebPage::uninstallPageOverlay()
m_drawingArea->setNeedsDisplay(IntRect(IntPoint(0, 0), m_viewSize));
}
void WebPage::pageDidScroll()
{
// Hide the find indicator.
m_findController.hideFindIndicator();
m_uiClient.pageDidScroll(this);
}
// Events
static const WebEvent* g_currentEvent = 0;
......
......@@ -168,6 +168,8 @@ public:
FindController& findController() { return m_findController; }
void pageDidScroll();
private:
WebPage(uint64_t pageID, const WebPageCreationParameters&);
......
2010-10-25 Anders Carlsson <andersca@apple.com>
Reviewed by Adam Roben.
Add a pageDidScroll BundleUIClient callback
https://bugs.webkit.org/show_bug.cgi?id=48260
<rdar://problem/8531159>
* WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
(WTR::InjectedBundlePage::InjectedBundlePage):
2010-10-25 Johnny Ding <jnd@chromium.org>
 
Reviewed by Tony Chang.
......
......@@ -189,7 +189,8 @@ InjectedBundlePage::InjectedBundlePage(WKBundlePageRef page)
willRunJavaScriptAlert,
willRunJavaScriptConfirm,
willRunJavaScriptPrompt,
0 /*mouseDidMoveOverElement*/
0, /*mouseDidMoveOverElement*/
0, /*pageDidScroll*/
};
WKBundlePageSetUIClient(m_page, &uiClient);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment