Expose a way for MiniBrowser to simulate header and footer banners
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 18 Dec 2016 21:09:34 +0000 (21:09 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 18 Dec 2016 21:09:34 +0000 (21:09 +0000)
commitb0f6ec443ed738d366bb2b07241fbf1664a04bf9
tree8f8226a5ee2bf65e4c22e42378f1494d675e163d
parentc9f6bbec309803c309f211da66e60f2796958b1d
Expose a way for MiniBrowser to simulate header and footer banners
https://bugs.webkit.org/show_bug.cgi?id=166005

Reviewed by Wenson Hsieh.

Source/WebKit2:

Expose testing SPI that allows a client to simulate the presence of header
and footer banners. These are simply plumbed through to set FrameView's
m_headerHeight and m_footerHeight.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _setHeaderBannerHeightForTesting:]):
(-[WKWebView _setFooterBannerHeightForTesting:]):
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::setHeaderBannerHeightForTesting):
(WebKit::WebPageProxy::setFooterBannerHeightForTesting):
* UIProcess/WebPageProxy.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::setHeaderBannerHeightForTesting):
(WebKit::WebPage::setFooterBannerHeightForTesting):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:

Tools:

Add a MiniBrowser menu item and setting to toggle adding space for header and footer
banners. This only works in WebKit2.

We need to reset these on each navigation, since newly created FrameViews
don't re-fetch the header and footer height stored on Page.

Also fix the signature of webView:didFinishNavigation: to follow API changes,
as well as fixing webViewWebContentProcessDidTerminate:

* MiniBrowser/mac/SettingsController.h:
* MiniBrowser/mac/SettingsController.m:
(-[SettingsController _populateMenu]):
(-[SettingsController validateMenuItem:]):
(-[SettingsController toggleReserveSpaceForBanners:]):
(-[SettingsController isSpaceReservedForBanners]):
* MiniBrowser/mac/WK2BrowserWindowController.m:
(-[WK2BrowserWindowController didChangeSettings]):
(-[WK2BrowserWindowController webView:didFinishNavigation:]):
(-[WK2BrowserWindowController webViewWebContentProcessDidTerminate:]):
(-[WK2BrowserWindowController webView:didFinishLoadingNavigation:]): Deleted.
(-[WK2BrowserWindowController _webViewWebProcessDidCrash:]): Deleted.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209975 268f45cc-cd09-0410-ab3c-d52691b4dbfc
12 files changed:
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm
Source/WebKit2/UIProcess/API/Cocoa/WKWebViewPrivate.h
Source/WebKit2/UIProcess/WebPageProxy.cpp
Source/WebKit2/UIProcess/WebPageProxy.h
Source/WebKit2/WebProcess/WebPage/WebPage.cpp
Source/WebKit2/WebProcess/WebPage/WebPage.h
Source/WebKit2/WebProcess/WebPage/WebPage.messages.in
Tools/ChangeLog
Tools/MiniBrowser/mac/SettingsController.h
Tools/MiniBrowser/mac/SettingsController.m
Tools/MiniBrowser/mac/WK2BrowserWindowController.m