Skip to content
Permalink
Browse files
2010-10-27 Kenneth Rohde Christiansen <kenneth@webkit.org>
        Reviewed by Anders Carlsson.

        Move contentsSizeChange from the UIClient into the PageClient and
        and make it a private Qt-only API in the process.

        Make WKPageContentsSizeChangedCallback be a private API
        https://bugs.webkit.org/show_bug.cgi?id=48409

        * UIProcess/API/C/WKPage.h:
        * UIProcess/API/qt/qwkpage.cpp:
        (QWKPagePrivate::didChangeContentsSize):
        (QWKPage::QWKPage):
        * UIProcess/API/qt/qwkpage_p.h:
        * UIProcess/PageClient.h:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::didChangeContentsSize):
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebPageProxy.messages.in:
        * UIProcess/WebUIClient.cpp:
        * WebProcess/WebCoreSupport/WebChromeClient.cpp:
        (WebKit::WebChromeClient::contentsSizeChanged):
2010-10-27  Kenneth Rohde Christiansen  <kenneth@webkit.org>

        Reviewed by Anders Carlsson.

        Remove contentSizeChanged callbacks as it is no longer
        part of the public UIClient.

        Make WKPageContentsSizeChangedCallback be a private API
        https://bugs.webkit.org/show_bug.cgi?id=48409

        * MiniBrowser/mac/BrowserWindowController.m:
        (-[BrowserWindowController awakeFromNib]):
        * MiniBrowser/win/BrowserView.cpp:
        (BrowserView::create):
        * WebKitTestRunner/TestController.cpp:
        (WTR::createOtherPage):
        (WTR::TestController::initialize):

Canonical link: https://commits.webkit.org/61197@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@70676 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
Kenneth Rohde Christiansen committed Oct 27, 2010
1 parent a2ebb6d commit 74b7ab7fb4fc6f45a7ba87656ea3ab4f10c0ec93
Showing 14 changed files with 71 additions and 33 deletions.
@@ -1,3 +1,27 @@
2010-10-27 Kenneth Rohde Christiansen <kenneth@webkit.org>

Reviewed by Anders Carlsson.

Move contentsSizeChange from the UIClient into the PageClient and
and make it a private Qt-only API in the process.

Make WKPageContentsSizeChangedCallback be a private API
https://bugs.webkit.org/show_bug.cgi?id=48409

* UIProcess/API/C/WKPage.h:
* UIProcess/API/qt/qwkpage.cpp:
(QWKPagePrivate::didChangeContentsSize):
(QWKPage::QWKPage):
* UIProcess/API/qt/qwkpage_p.h:
* UIProcess/PageClient.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didChangeContentsSize):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/WebUIClient.cpp:
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::contentsSizeChanged):

2010-10-26 Brian Weinstein <bweinstein@apple.com>

Reviewed by Adam Roben.
@@ -141,7 +141,6 @@ typedef bool (*WKPageRunJavaScriptConfirmCallback)(WKPageRef page, WKStringRef m
typedef WKStringRef (*WKPageRunJavaScriptPromptCallback)(WKPageRef page, WKStringRef message, WKStringRef defaultValue, WKFrameRef frame, const void *clientInfo);
typedef void (*WKPageSetStatusTextCallback)(WKPageRef page, WKStringRef text, const void *clientInfo);
typedef void (*WKPageMouseDidMoveOverElementCallback)(WKPageRef page, WKEventModifiers modifiers, WKTypeRef userData, const void *clientInfo);
typedef void (*WKPageContentsSizeChangedCallback)(WKPageRef page, int width, int height, WKFrameRef frame, const void *clientInfo);
typedef void (*WKPageDidNotHandleKeyEventCallback)(WKPageRef page, WKNativeEventPtr event, const void *clientInfo);
typedef WKRect (*WKPageGetWindowFrameCallback)(WKPageRef page, const void *clientInfo);
typedef void (*WKPageSetWindowFrameCallback)(WKPageRef page, WKRect frame, const void *clientInfo);
@@ -161,7 +160,6 @@ struct WKPageUIClient {
WKPageRunJavaScriptPromptCallback runJavaScriptPrompt;
WKPageSetStatusTextCallback setStatusText;
WKPageMouseDidMoveOverElementCallback mouseDidMoveOverElement;
WKPageContentsSizeChangedCallback contentsSizeChanged;
WKPageDidNotHandleKeyEventCallback didNotHandleKeyEvent;
WKPageGetWindowFrameCallback getWindowFrame;
WKPageSetWindowFrameCallback setWindowFrame;
@@ -97,6 +97,11 @@ void QWKPagePrivate::setViewportArguments(const ViewportArguments& args)
emit q->viewportChangeRequested();
}

void QWKPagePrivate::didChangeContentsSize(const IntSize& newSize)
{
emit q->contentsSizeChanged(QSize(newSize));
}

void QWKPagePrivate::toolTipChanged(const String&, const String& newTooltip)
{
emit q->statusBarMessage(QString(newTooltip));
@@ -314,7 +319,6 @@ QWKPage::QWKPage(WKPageNamespaceRef namespaceRef)
0, /* runJavaScriptPrompt */
0, /* setStatusText */
0, /* mouseDidMoveOverElement */
0, /* contentsSizeChanged */
0, /* didNotHandleKeyEvent */
0, /* getWindowFrame */
0, /* setWindowFrame */
@@ -50,6 +50,7 @@ class QWKPagePrivate : WebKit::PageClient {
#endif // USE(ACCELERATED_COMPOSITING)
virtual void processDidCrash() { }
virtual void didRelaunchProcess() { }
virtual void didChangeContentsSize(const WebCore::IntSize&);
virtual void setCursor(const WebCore::Cursor&);
virtual void setViewportArguments(const WebCore::ViewportArguments&);
virtual void takeFocus(bool direction) { }
@@ -52,6 +52,10 @@ class PageClient {
virtual void takeFocus(bool direction) = 0;
virtual void toolTipChanged(const String&, const String&) = 0;

#if PLATFORM(QT)
virtual void didChangeContentsSize(const WebCore::IntSize&) = 0;
#endif

virtual void setCursor(const WebCore::Cursor&) = 0;
virtual void setViewportArguments(const WebCore::ViewportArguments&) = 0;

@@ -917,11 +917,6 @@ void WebPageProxy::mouseDidMoveOverElement(uint32_t opaqueModifiers, CoreIPC::Ar
m_uiClient.mouseDidMoveOverElement(this, modifiers, userData.get());
}

void WebPageProxy::contentsSizeChanged(uint64_t frameID, const WebCore::IntSize& size)
{
m_uiClient.contentsSizeChanged(this, size, process()->webFrame(frameID));
}

void WebPageProxy::setWindowFrame(const FloatRect& newWindowFrame)
{
m_uiClient.setWindowFrame(this, m_pageClient->convertToDeviceSpace(newWindowFrame));
@@ -952,6 +947,13 @@ void WebPageProxy::pageDidScroll()
m_uiClient.pageDidScroll(this);
}

#if PLATFORM(QT)
void WebPageProxy::didChangeContentsSize(const WebCore::IntSize& size)
{
m_pageClient->didChangeContentsSize(size);
}
#endif

void WebPageProxy::didDraw()
{
m_uiClient.didDraw(this);
@@ -270,13 +270,15 @@ class WebPageProxy : public APIObject {
void runJavaScriptPrompt(uint64_t frameID, const String&, const String&, String& result);
void setStatusText(const String&);
void mouseDidMoveOverElement(uint32_t modifiers, CoreIPC::ArgumentDecoder*);
void contentsSizeChanged(uint64_t frameID, const WebCore::IntSize&);
void setWindowFrame(const WebCore::FloatRect&);
void getWindowFrame(WebCore::FloatRect&);
void canRunBeforeUnloadConfirmPanel(bool& canRun);
void runBeforeUnloadConfirmPanel(const String& message, uint64_t frameID, bool& shouldClose);
void didChangeViewportData(const WebCore::ViewportArguments&);
void pageDidScroll();
#if PLATFORM(QT)
void didChangeContentsSize(const WebCore::IntSize&);
#endif

// Back/Forward list management
void backForwardAddItem(uint64_t itemID);
@@ -29,7 +29,6 @@ messages -> WebPageProxy {
RunJavaScriptConfirm(uint64_t frameID, WTF::String message) -> (bool result)
RunJavaScriptPrompt(uint64_t frameID, WTF::String message, WTF::String defaultValue) -> (WTF::String result)
MouseDidMoveOverElement(uint32_t modifiers, WebKit::InjectedBundleUserMessageEncoder userData);
ContentsSizeChanged(uint64_t frameID, WebCore::IntSize newSize)
DidChangeViewportData(WebCore::ViewportArguments arguments)
DidReceiveEvent(uint32_t type, bool handled)
DidValidateMenuItem(WTF::String commandName, bool isEnabled, int32_t state)
@@ -42,6 +41,9 @@ messages -> WebPageProxy {
CanRunBeforeUnloadConfirmPanel() -> (bool canRun)
RunBeforeUnloadConfirmPanel(WTF::String message, uint64_t frameID) -> (bool shouldClose)
PageDidScroll()
#if PLATFORM(QT)
DidChangeContentsSize(WebCore::IntSize newSize)
#endif

# Policy messages.
DecidePolicyForMIMEType(uint64_t frameID, WTF::String MIMEType, WTF::String url, uint64_t listenerID)
@@ -141,15 +141,6 @@ void WebUIClient::mouseDidMoveOverElement(WebPageProxy* page, WebEvent::Modifier
m_pageUIClient.mouseDidMoveOverElement(toAPI(page), toAPI(modifiers), toAPI(userData), m_pageUIClient.clientInfo);
}


void WebUIClient::contentsSizeChanged(WebPageProxy* page, const IntSize& size, WebFrameProxy* frame)
{
if (!m_pageUIClient.contentsSizeChanged)
return;

m_pageUIClient.contentsSizeChanged(toAPI(page), size.width(), size.height(), toAPI(frame), m_pageUIClient.clientInfo);
}

void WebUIClient::didNotHandleKeyEvent(WebPageProxy* page, const NativeWebKeyboardEvent& event)
{
if (!m_pageUIClient.didNotHandleKeyEvent)
@@ -355,9 +355,14 @@ PlatformPageClient WebChromeClient::platformPageClient() const

void WebChromeClient::contentsSizeChanged(Frame* frame, const IntSize& size) const
{
#if PLATFORM(QT)
WebFrame* webFrame = static_cast<WebFrameLoaderClient*>(frame->loader()->client())->webFrame();

WebProcess::shared().connection()->send(Messages::WebPageProxy::ContentsSizeChanged(webFrame->frameID(), size), m_page->pageID());
if (!m_page->mainFrame() || m_page->mainFrame() != webFrame)
return;

WebProcess::shared().connection()->send(Messages::WebPageProxy::DidChangeContentsSize(size), m_page->pageID());
#endif
}

void WebChromeClient::scrollRectIntoView(const IntRect&, const ScrollView*) const
@@ -1,3 +1,21 @@
2010-10-27 Kenneth Rohde Christiansen <kenneth@webkit.org>

Reviewed by Anders Carlsson.

Remove contentSizeChanged callbacks as it is no longer
part of the public UIClient.

Make WKPageContentsSizeChangedCallback be a private API
https://bugs.webkit.org/show_bug.cgi?id=48409

* MiniBrowser/mac/BrowserWindowController.m:
(-[BrowserWindowController awakeFromNib]):
* MiniBrowser/win/BrowserView.cpp:
(BrowserView::create):
* WebKitTestRunner/TestController.cpp:
(WTR::createOtherPage):
(WTR::TestController::initialize):

2010-10-27 Gabor Rapcsanyi <rgabor@inf.u-szeged.hu>

Reviewed by Ojan Vafai.
@@ -489,11 +489,6 @@ static void mouseDidMoveOverElement(WKPageRef page, WKEventModifiers modifiers,
LOG(@"mouseDidMoveOverElement");
}

static void contentsSizeChanged(WKPageRef page, int width, int height, WKFrameRef frame, const void *clientInfo)
{
LOG(@"contentsSizeChanged");
}

static WKRect getWindowFrame(WKPageRef page, const void* clientInfo)
{
NSRect rect = [[(BrowserWindowController *)clientInfo window] frame];
@@ -589,7 +584,6 @@ - (void)awakeFromNib
runJavaScriptPrompt,
setStatusText,
mouseDidMoveOverElement,
contentsSizeChanged,
0, /* didNotHandleKeyEvent */
getWindowFrame,
setWindowFrame,
@@ -78,10 +78,6 @@ static void mouseDidMoveOverElement(WKPageRef page, WKEventModifiers modifiers,
{
}

static void contentsSizeChanged(WKPageRef page, int width, int height, WKFrameRef frame, const void *clientInfo)
{
}

void BrowserView::create(RECT webViewRect, BrowserWindow* parentWindow)
{
assert(!m_webView);
@@ -109,7 +105,6 @@ void BrowserView::create(RECT webViewRect, BrowserWindow* parentWindow)
runJavaScriptPrompt,
setStatusText,
mouseDidMoveOverElement,
contentsSizeChanged,
0 /* didNotHandleKeyEvent */
};

@@ -116,7 +116,6 @@ static WKPageRef createOtherPage(WKPageRef oldPage, WKDictionaryRef, WKEventModi
0, // runJavaScriptPrompt
0, // setStatusText
0, // mouseDidMoveOverElement
0, // contentsSizeChanged
0, // didNotHandleKeyEvent
getWindowFrameOtherPage,
setWindowFrameOtherPage,
@@ -202,7 +201,6 @@ void TestController::initialize(int argc, const char* argv[])
0, // runJavaScriptPrompt
0, // setStatusText
0, // mouseDidMoveOverElement
0, // contentsSizeChanged
0, // didNotHandleKeyEvent
getWindowFrameMainPage,
setWindowFrameMainPage,

0 comments on commit 74b7ab7

Please sign in to comment.