[iOS] WKWebView shouldn't know about WKPDFView
authoraestes@apple.com <aestes@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 4 Apr 2018 02:41:42 +0000 (02:41 +0000)
committeraestes@apple.com <aestes@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 4 Apr 2018 02:41:42 +0000 (02:41 +0000)
commitac1963b8bd2ea9dfb867fd30fd8c86a65f3973aa
treea51e17da85b0288a20f79713b54e755c6a381e67
parentb0f468a041b09533cc0d67d486b507c850cbd792
[iOS] WKWebView shouldn't know about WKPDFView
https://bugs.webkit.org/show_bug.cgi?id=184283

Reviewed by Timothy Hatcher.

WKWebView shouldn't be checking if _customContentView is a particular kind of
class (e.g., WKPDFView). Instead, it should interact with the _customContentView
using the WKWebViewContentProvider protocol.

Reimplement -_isBackground, -_isDisplayingPDF, -_dataForDisplayedPDF, and
-_suggestedFilenameForDisplayedPDF using new WKWebViewContentProvider protocol
methods that WKPDFView implements.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _isBackground]):
(-[WKWebView _isDisplayingPDF]):
(-[WKWebView _dataForDisplayedPDF]):
(-[WKWebView _suggestedFilenameForDisplayedPDF]):
* UIProcess/Cocoa/WKWebViewContentProvider.h:
* UIProcess/ios/WKPDFView.h:
* UIProcess/ios/WKPDFView.mm:
(-[WKPDFView web_dataRepresentation]):
(-[WKPDFView web_suggestedFilename]):
(-[WKPDFView web_isBackground]):
(-[WKPDFView suggestedFilename]): Deleted.
(-[WKPDFView pdfDocument]): Deleted.
(-[WKPDFView isBackground]): Deleted.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@230231 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebKit/ChangeLog
Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm
Source/WebKit/UIProcess/Cocoa/WKWebViewContentProvider.h
Source/WebKit/UIProcess/ios/WKPDFView.h
Source/WebKit/UIProcess/ios/WKPDFView.mm