diff options
Diffstat (limited to 'Source/WebKit2/WebProcess/InjectedBundle/API/c')
-rw-r--r-- | Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp | 19 | ||||
-rw-r--r-- | Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h | 4 |
2 files changed, 22 insertions, 1 deletions
diff --git a/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp b/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp index 18247b664..c635e6e84 100644 --- a/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp +++ b/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp @@ -44,6 +44,7 @@ #include <WebCore/AccessibilityObject.h> #include <WebCore/Frame.h> #include <WebCore/KURL.h> +#include <WebCore/MIMETypeRegistry.h> #include <WebCore/Page.h> #if ENABLE(WEB_INTENTS) @@ -413,3 +414,21 @@ void WKBundlePageConfirmCompositionWithText(WKBundlePageRef pageRef, WKStringRef { toImpl(pageRef)->confirmCompositionForTesting(toImpl(text)->string()); } + +bool WKBundlePageCanShowMIMEType(WKBundlePageRef, WKStringRef mimeTypeRef) +{ + using WebCore::MIMETypeRegistry; + + const WTF::String mimeType = toImpl(mimeTypeRef)->string(); + + if (MIMETypeRegistry::isSupportedNonImageMIMEType(mimeType)) + return true; + + if (MIMETypeRegistry::isSupportedImageMIMEType(mimeType)) + return true; + + if (mimeType.startsWith("text/", false)) + return !MIMETypeRegistry::isUnsupportedTextMIMEType(mimeType); + + return false; +} diff --git a/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h b/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h index b7c82b811..c7393ba3f 100644 --- a/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h +++ b/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h @@ -71,8 +71,10 @@ WK_EXPORT bool WKBundlePageHasComposition(WKBundlePageRef page); WK_EXPORT void WKBundlePageConfirmComposition(WKBundlePageRef page); WK_EXPORT void WKBundlePageConfirmCompositionWithText(WKBundlePageRef page, WKStringRef text); +WK_EXPORT bool WKBundlePageCanShowMIMEType(WKBundlePageRef, WKStringRef mimeType); + WK_EXPORT void* WKAccessibilityRootObject(WKBundlePageRef); -WK_EXPORT void* WKAccessibilityFocusedObject(WKBundlePageRef); +WK_EXPORT void* WKAccessibilityFocusedObject(WKBundlePageRef); #ifdef __cplusplus } |