Changeset 65419 in webkit


Ignore:
Timestamp:
Aug 16, 2010 5:52:20 AM (14 years ago)
Author:
abecsi@webkit.org
Message:

2010-08-16 Balazs Kelemen <kb@inf.u-szeged.hu>

Reviewed by Kenneth Rohde Christiansen.

Handle content size change in WebKit2

https://bugs.webkit.org/show_bug.cgi?id=43198

  • MiniBrowser/mac/BrowserWindowController.m: (-[BrowserWindowController awakeFromNib]): Initialize WKPageUICallback::contetsSizeChanged to 0.
  • MiniBrowser/win/BrowserView.cpp: (BrowserView::create): Initialize WKPageUICallback::contetsSizeChanged to 0.

2010-08-16 Balazs Kelemen <kb@inf.u-szeged.hu>

Reviewed by Kenneth Rohde Christiansen.

Handle content size change in WebKit2

https://bugs.webkit.org/show_bug.cgi?id=43198

Based on the work of Antti Koivisto.
Send message to the UI client when the contents size has changed through the WebChromeClient
and propagate it to the WKPageUIClient.

  • Shared/CoreIPCSupport/WebPageProxyMessageKinds.h: (WebPageProxyMessage::): Added ContentsSizeChanged message kind.
  • UIProcess/API/C/WKPage.h: Added WKPageContentsSizeChangedCallback callback to the WKPageUIClient.
  • UIProcess/API/qt/qwkpage.cpp: (QWKPage::QWKPage): Initialize the new callback to 0.
  • UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didReceiveMessage): Handle ContentsSizeChanged message. Calls contetsSizeChanged. (WebKit::WebPageProxy::contentsSizeChanged): Added. Propagate the event to the the UI client.
  • UIProcess/WebPageProxy.h:
  • UIProcess/WebUIClient.cpp: (WebKit::WebUIClient::contentsSizeChanged): Added. Propagate the event forward to the WKPageUIClient.
  • UIProcess/WebUIClient.h:
  • WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::contentsSizeChanged): Implemented.
Location:
trunk
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKit2/ChangeLog

    r65403 r65419  
     12010-08-16  Balazs Kelemen  <kb@inf.u-szeged.hu>
     2
     3        Reviewed by Kenneth Rohde Christiansen.
     4
     5        Handle content size change in WebKit2
     6
     7        https://bugs.webkit.org/show_bug.cgi?id=43198
     8
     9        Based on the work of Antti Koivisto.
     10        Send message to the UI client when the contents size has changed through the WebChromeClient
     11        and propagate it to the WKPageUIClient.
     12
     13        * Shared/CoreIPCSupport/WebPageProxyMessageKinds.h:
     14        (WebPageProxyMessage::): Added ContentsSizeChanged message kind.
     15        * UIProcess/API/C/WKPage.h: Added WKPageContentsSizeChangedCallback callback to the WKPageUIClient.
     16        * UIProcess/API/qt/qwkpage.cpp:
     17        (QWKPage::QWKPage): Initialize the new callback to 0.
     18        * UIProcess/WebPageProxy.cpp:
     19        (WebKit::WebPageProxy::didReceiveMessage): Handle ContentsSizeChanged message. Calls contetsSizeChanged.
     20        (WebKit::WebPageProxy::contentsSizeChanged): Added. Propagate the event to the the UI client.
     21        * UIProcess/WebPageProxy.h:
     22        * UIProcess/WebUIClient.cpp:
     23        (WebKit::WebUIClient::contentsSizeChanged): Added. Propagate the event forward to the WKPageUIClient.
     24        * UIProcess/WebUIClient.h:
     25        * WebProcess/WebCoreSupport/WebChromeClient.cpp:
     26        (WebKit::WebChromeClient::contentsSizeChanged): Implemented.
     27
    1282010-08-16  Balazs Kelemen  <kb@inf.u-szeged.hu>
    229
  • trunk/WebKit2/Shared/CoreIPCSupport/WebPageProxyMessageKinds.h

    r65337 r65419  
    3939    RunJavaScriptConfirm,
    4040    RunJavaScriptPrompt,
    41    
     41
    4242    ClosePage,
     43    ContentsSizeChanged,
    4344    DecidePolicyForMIMEType,
    4445    DecidePolicyForNavigationAction,
  • trunk/WebKit2/UIProcess/API/C/WKPage.h

    r65341 r65419  
    131131typedef bool (*WKPageRunJavaScriptConfirmCallback)(WKPageRef page, WKStringRef message, WKFrameRef frame, const void *clientInfo);
    132132typedef WKStringRef (*WKPageRunJavaScriptPromptCallback)(WKPageRef page, WKStringRef message, WKStringRef defaultValue, WKFrameRef frame, const void *clientInfo);
     133typedef void (*WKPageContentsSizeChangedCallback)(WKPageRef page, int width, int height, WKFrameRef frame, const void *clientInfo);
    133134
    134135struct WKPageUIClient {
     
    141142    WKPageRunJavaScriptConfirmCallback                                  runJavaScriptConfirm;
    142143    WKPageRunJavaScriptPromptCallback                                   runJavaScriptPrompt;
     144    WKPageContentsSizeChangedCallback                                   contentsSizeChanged;
    143145};
    144146typedef struct WKPageUIClient WKPageUIClient;
  • trunk/WebKit2/UIProcess/API/qt/qwkpage.cpp

    r64992 r65419  
    228228        qt_wk_runJavaScriptAlert,
    229229        0,  /* runJavaScriptConfirm */
    230         0   /* runJavaScriptPrompt */
     230        0,  /* runJavaScriptPrompt */
     231        0   /* contentsSizeChanged */
    231232    };
    232233    WKPageSetPageUIClient(pageRef(), &uiClient);
  • trunk/WebKit2/UIProcess/WebPageProxy.cpp

    r65341 r65419  
    606606            break;
    607607        }
     608        case WebPageProxyMessage::ContentsSizeChanged: {
     609            IntSize size;
     610            uint64_t frameID;
     611            if (!arguments->decode(CoreIPC::Out(frameID, size)))
     612                return;
     613            contentsSizeChanged(webFrame(frameID), size);
     614            break;
     615        }
    608616        default:
    609617            ASSERT_NOT_REACHED();
     
    877885}
    878886
     887void WebPageProxy::contentsSizeChanged(WebFrameProxy* frame, const WebCore::IntSize& size)
     888{
     889    m_uiClient.contentsSizeChanged(this, size, frame);
     890}
     891
    879892// BackForwardList
    880893
  • trunk/WebKit2/UIProcess/WebPageProxy.h

    r65341 r65419  
    201201    bool runJavaScriptConfirm(WebFrameProxy* frame, const WTF::String&);
    202202    WTF::String runJavaScriptPrompt(WebFrameProxy* frame, const WTF::String&, const WTF::String&);
     203    void contentsSizeChanged(WebFrameProxy*, const WebCore::IntSize&);
    203204
    204205    void addItemToBackForwardList(WebBackForwardListItem*);
  • trunk/WebKit2/UIProcess/WebUIClient.cpp

    r64485 r65419  
    2828#include "WKAPICast.h"
    2929#include "WebPageProxy.h"
     30#include <WebCore/IntSize.h>
    3031#include <WebCore/PlatformString.h>
    3132#include <string.h>
     
    103104}
    104105
     106void WebUIClient::contentsSizeChanged(WebPageProxy* page, const IntSize& size, WebFrameProxy* frame)
     107{
     108    if (!m_pageUIClient.contentsSizeChanged)
     109        return;
     110
     111    m_pageUIClient.contentsSizeChanged(toRef(page), size.width(), size.height(), toRef(frame), m_pageUIClient.clientInfo);
     112}
     113
    105114} // namespace WebKit
  • trunk/WebKit2/UIProcess/WebUIClient.h

    r65021 r65419  
    3131#include <wtf/PassRefPtr.h>
    3232
     33namespace WebCore {
     34class IntSize;
     35class String;
     36}
     37
    3338namespace WebKit {
    3439
     
    4752    bool runJavaScriptConfirm(WebPageProxy*, const WTF::String&, WebFrameProxy*);
    4853    WTF::String runJavaScriptPrompt(WebPageProxy*, const WTF::String&, const WTF::String&, WebFrameProxy*);
     54    void contentsSizeChanged(WebPageProxy*, const WebCore::IntSize&, WebFrameProxy*);
    4955
    5056private:
  • trunk/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp

    r64797 r65419  
    346346}
    347347
    348 void WebChromeClient::contentsSizeChanged(Frame*, const IntSize&) const
    349 {
    350     notImplemented();
     348void WebChromeClient::contentsSizeChanged(Frame* frame, const IntSize& size) const
     349{
     350    WebFrame* webFrame =  static_cast<WebFrameLoaderClient*>(frame->loader()->client())->webFrame();
     351    WebProcess::shared().connection()->send(WebPageProxyMessage::ContentsSizeChanged, m_page->pageID(),
     352                                            CoreIPC::In(webFrame->frameID(), size));
    351353}
    352354
  • trunk/WebKitTools/ChangeLog

    r65418 r65419  
     12010-08-16  Balazs Kelemen  <kb@inf.u-szeged.hu>
     2
     3        Reviewed by Kenneth Rohde Christiansen.
     4
     5        Handle content size change in WebKit2
     6
     7        https://bugs.webkit.org/show_bug.cgi?id=43198
     8
     9        * MiniBrowser/mac/BrowserWindowController.m:
     10        (-[BrowserWindowController awakeFromNib]): Initialize WKPageUICallback::contetsSizeChanged to 0.
     11        * MiniBrowser/win/BrowserView.cpp:
     12        (BrowserView::create): Initialize WKPageUICallback::contetsSizeChanged to 0.
     13
    1142010-08-16  Ariya Hidayat  <ariya@sencha.com>
    215
  • trunk/WebKitTools/MiniBrowser/mac/BrowserWindowController.m

    r64247 r65419  
    412412        runJavaScriptAlert,
    413413        runJavaScriptConfirm,
    414         runJavaScriptPrompt
     414        runJavaScriptPrompt,
     415        0           /* contentsSizeChanged */
    415416    };
    416417    WKPageSetPageUIClient(_webView.pageRef, &uiClient);
  • trunk/WebKitTools/MiniBrowser/win/BrowserView.cpp

    r61500 r65419  
    8484        showPage,
    8585        closePage,
    86         runJavaScriptAlert
     86        runJavaScriptAlert,
     87        0               /* contentsSizeChanged */
    8788    };
    8889    WKPageSetPageUIClient(WKViewGetPage(m_webView), &uiClient);
Note: See TracChangeset for help on using the changeset viewer.