Move SystemPreview code from WebKitAdditions to WebKit
authordino@apple.com <dino@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 4 Sep 2018 19:38:33 +0000 (19:38 +0000)
committerdino@apple.com <dino@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 4 Sep 2018 19:38:33 +0000 (19:38 +0000)
commitf0d3bc5d98b0259659038dbe02c75ec71b427c33
treef3d2d979f2b4a5e2f4e955c25d8b3603fa8d5c7a
parenteb80b561c38135b3ab627734e7bd2e94732046b2
Move SystemPreview code from WebKitAdditions to WebKit
https://bugs.webkit.org/show_bug.cgi?id=189252
<rdar://problem/44080245>

Reviewed by Wenson Hsieh.

Source/WebCore:

Move the WebKitAdditions code into WebKit/WebCore.

* html/HTMLAnchorElement.cpp:
(WebCore::HTMLAnchorElement::relList const): Look for "ar".
(WebCore::HTMLAnchorElement::isSystemPreviewLink const): Ditto.

* platform/MIMETypeRegistry.cpp: Add a couple of new static methods
for System Preview MIME types.
(WebCore::initializeSystemPreviewMIMETypes):
(WebCore::MIMETypeRegistry::getSystemPreviewMIMETypes):
(WebCore::MIMETypeRegistry::isSystemPreviewMIMEType):
* platform/MIMETypeRegistry.h:

* rendering/RenderThemeIOS.mm: Load the ARKit artwork from the framework.
(WebCore::arKitBundle):
(WebCore::loadARKitPDFPage):
(WebCore::systemPreviewLogo):
(WebCore::RenderThemeIOS::paintSystemPreviewBadge):

* testing/Internals.cpp: Remove internal helper.
(WebCore::Internals::systemPreviewRelType): Deleted.
* testing/Internals.h:
* testing/Internals.idl:

Source/WebKit:

Move the WebKitAdditions code into WebKit/WebCore.

* UIProcess/Cocoa/SystemPreviewControllerCocoa.mm:
(getUTIForMIMEType): Helper to get the system UTI for USDZ files.
(-[_WKPreviewControllerDataSource previewController:previewItemAtIndex:]):

* UIProcess/Cocoa/WKWebViewContentProviderRegistry.mm: Use the new methods
in MIMETypeRegistry.
(-[WKWebViewContentProviderRegistry initWithConfiguration:]):

* UIProcess/SystemPreviewController.cpp: Ditto.
(WebKit::SystemPreviewController::canPreview const):

* UIProcess/ios/WKSystemPreviewView.mm:
(getUTIForMIMEType): Similar helper to above.
(-[WKSystemPreviewView web_setContentProviderData:suggestedFilename:]):

LayoutTests:

This test no longer needs an internal helper.

* system-preview/detection.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@235626 268f45cc-cd09-0410-ab3c-d52691b4dbfc
15 files changed:
LayoutTests/ChangeLog
LayoutTests/system-preview/detection.html
Source/WebCore/ChangeLog
Source/WebCore/html/HTMLAnchorElement.cpp
Source/WebCore/platform/MIMETypeRegistry.cpp
Source/WebCore/platform/MIMETypeRegistry.h
Source/WebCore/rendering/RenderThemeIOS.mm
Source/WebCore/testing/Internals.cpp
Source/WebCore/testing/Internals.h
Source/WebCore/testing/Internals.idl
Source/WebKit/ChangeLog
Source/WebKit/UIProcess/Cocoa/SystemPreviewControllerCocoa.mm
Source/WebKit/UIProcess/Cocoa/WKWebViewContentProviderRegistry.mm
Source/WebKit/UIProcess/SystemPreviewController.cpp
Source/WebKit/UIProcess/ios/WKSystemPreviewView.mm