Move knowledge of PDF/PostScript MIME types into MIMETypeRegistry
https://bugs.webkit.org/show_bug.cgi?id=115487
Reviewed by Darin Adler.
No new tests, just a refactoring.
* UIProcess/WebContext.cpp:
* UIProcess/WebContext.h:
Remove pdfAndPostScriptMIMETypes.
* UIProcess/WebFrameProxy.cpp:
(WebKit::WebFrameProxy::canShowMIMEType): Move PDF bits to WebPageProxy.
(WebKit::WebFrameProxy::isDisplayingPDFDocument):
Make use of WebCore's newfound knowledge of PDF and PostScript MIME types,
so we don't have to duplicate it unnecessarily in WebKit2.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::canShowMIMEType):
Add code which used to be in WebFrameProxy::canShowMIMEType, and adapt it
to use WebCore's knowledge of PDF and PostScript MIME types.
* WebProcess/Plugins/PDF/SimplePDFPlugin.mm:
(WebKit::SimplePDFPlugin::pluginInfo):
We previously supported the "text/pdf" MIME type for PDFViewController,
so SimplePDFPlugin and PDFPlugin should support it as well.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::createPlugin):
Adopt MIMETypeRegistry::isPDFOrPostScriptMIMEType.
* WebProcess/WebPage/WebPage.h:
(WebPage):
Remove pdfAndPostScriptMIMETypes.
* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::platformPreferencesDidChange):
Adopt getPDFAndPostScriptMIMETypes instead of duplicating the list in WebKit2.
* WebCore.exp.in:
Export newly-added isPDFOrPostScriptMIMEType and getPDFAndPostScriptMIMETypes.
* dom/DOMImplementation.cpp:
(WebCore::DOMImplementation::createDocument):
Adopt MIMETypeRegistry::isPDFOrPostScriptMIMEType instead of duplicating
the list of MIME types. The previous list did not include PostScript, but
it seems reasonable to put plugins ahead of built-in support for it in addition to PDF.
* platform/MIMETypeRegistry.cpp:
(WebCore::initializePDFAndPostScriptMIMETypes): Added.
(WebCore::initializeMIMETypeRegistry): Call initializePDFAndPostScriptMIMETypes.
(WebCore::MIMETypeRegistry::isPDFOrPostScriptMIMEType):
Consult our new HashSet to see if the given MIME type is one of those used for PDF or PS.
(WebCore::MIMETypeRegistry::getPDFAndPostScriptMIMETypes): Added.
* platform/MIMETypeRegistry.h:
(MIMETypeRegistry): Add isPDFOrPostScriptMIMEType and getPDFAndPostScriptMIMETypes.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@149464
268f45cc-cd09-0410-ab3c-
d52691b4dbfc