Changeset 65419 in webkit
- Timestamp:
- Aug 16, 2010 5:52:20 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKit2/ChangeLog
r65403 r65419 1 2010-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 1 28 2010-08-16 Balazs Kelemen <kb@inf.u-szeged.hu> 2 29 -
trunk/WebKit2/Shared/CoreIPCSupport/WebPageProxyMessageKinds.h
r65337 r65419 39 39 RunJavaScriptConfirm, 40 40 RunJavaScriptPrompt, 41 41 42 42 ClosePage, 43 ContentsSizeChanged, 43 44 DecidePolicyForMIMEType, 44 45 DecidePolicyForNavigationAction, -
trunk/WebKit2/UIProcess/API/C/WKPage.h
r65341 r65419 131 131 typedef bool (*WKPageRunJavaScriptConfirmCallback)(WKPageRef page, WKStringRef message, WKFrameRef frame, const void *clientInfo); 132 132 typedef WKStringRef (*WKPageRunJavaScriptPromptCallback)(WKPageRef page, WKStringRef message, WKStringRef defaultValue, WKFrameRef frame, const void *clientInfo); 133 typedef void (*WKPageContentsSizeChangedCallback)(WKPageRef page, int width, int height, WKFrameRef frame, const void *clientInfo); 133 134 134 135 struct WKPageUIClient { … … 141 142 WKPageRunJavaScriptConfirmCallback runJavaScriptConfirm; 142 143 WKPageRunJavaScriptPromptCallback runJavaScriptPrompt; 144 WKPageContentsSizeChangedCallback contentsSizeChanged; 143 145 }; 144 146 typedef struct WKPageUIClient WKPageUIClient; -
trunk/WebKit2/UIProcess/API/qt/qwkpage.cpp
r64992 r65419 228 228 qt_wk_runJavaScriptAlert, 229 229 0, /* runJavaScriptConfirm */ 230 0 /* runJavaScriptPrompt */ 230 0, /* runJavaScriptPrompt */ 231 0 /* contentsSizeChanged */ 231 232 }; 232 233 WKPageSetPageUIClient(pageRef(), &uiClient); -
trunk/WebKit2/UIProcess/WebPageProxy.cpp
r65341 r65419 606 606 break; 607 607 } 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 } 608 616 default: 609 617 ASSERT_NOT_REACHED(); … … 877 885 } 878 886 887 void WebPageProxy::contentsSizeChanged(WebFrameProxy* frame, const WebCore::IntSize& size) 888 { 889 m_uiClient.contentsSizeChanged(this, size, frame); 890 } 891 879 892 // BackForwardList 880 893 -
trunk/WebKit2/UIProcess/WebPageProxy.h
r65341 r65419 201 201 bool runJavaScriptConfirm(WebFrameProxy* frame, const WTF::String&); 202 202 WTF::String runJavaScriptPrompt(WebFrameProxy* frame, const WTF::String&, const WTF::String&); 203 void contentsSizeChanged(WebFrameProxy*, const WebCore::IntSize&); 203 204 204 205 void addItemToBackForwardList(WebBackForwardListItem*); -
trunk/WebKit2/UIProcess/WebUIClient.cpp
r64485 r65419 28 28 #include "WKAPICast.h" 29 29 #include "WebPageProxy.h" 30 #include <WebCore/IntSize.h> 30 31 #include <WebCore/PlatformString.h> 31 32 #include <string.h> … … 103 104 } 104 105 106 void 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 105 114 } // namespace WebKit -
trunk/WebKit2/UIProcess/WebUIClient.h
r65021 r65419 31 31 #include <wtf/PassRefPtr.h> 32 32 33 namespace WebCore { 34 class IntSize; 35 class String; 36 } 37 33 38 namespace WebKit { 34 39 … … 47 52 bool runJavaScriptConfirm(WebPageProxy*, const WTF::String&, WebFrameProxy*); 48 53 WTF::String runJavaScriptPrompt(WebPageProxy*, const WTF::String&, const WTF::String&, WebFrameProxy*); 54 void contentsSizeChanged(WebPageProxy*, const WebCore::IntSize&, WebFrameProxy*); 49 55 50 56 private: -
trunk/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp
r64797 r65419 346 346 } 347 347 348 void WebChromeClient::contentsSizeChanged(Frame*, const IntSize&) const 349 { 350 notImplemented(); 348 void 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)); 351 353 } 352 354 -
trunk/WebKitTools/ChangeLog
r65418 r65419 1 2010-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 1 14 2010-08-16 Ariya Hidayat <ariya@sencha.com> 2 15 -
trunk/WebKitTools/MiniBrowser/mac/BrowserWindowController.m
r64247 r65419 412 412 runJavaScriptAlert, 413 413 runJavaScriptConfirm, 414 runJavaScriptPrompt 414 runJavaScriptPrompt, 415 0 /* contentsSizeChanged */ 415 416 }; 416 417 WKPageSetPageUIClient(_webView.pageRef, &uiClient); -
trunk/WebKitTools/MiniBrowser/win/BrowserView.cpp
r61500 r65419 84 84 showPage, 85 85 closePage, 86 runJavaScriptAlert 86 runJavaScriptAlert, 87 0 /* contentsSizeChanged */ 87 88 }; 88 89 WKPageSetPageUIClient(WKViewGetPage(m_webView), &uiClient);
Note: See TracChangeset
for help on using the changeset viewer.