From 6916255e3bc5760bcaac2ec7d5057e057bd3de6a Mon Sep 17 00:00:00 2001 From: Patrick Scott Date: Wed, 13 Jan 2010 14:10:56 -0500 Subject: Call into MimeTypeMap to get the mime type for an extension. Use the default method to obtain the content type of a plugin. Implement extension to mime type by calling into the java map. Requires a small change to the webkit package. Bug: 2368893 --- .../WebCoreSupport/FrameLoaderClientAndroid.cpp | 30 +--------------------- 1 file changed, 1 insertion(+), 29 deletions(-) (limited to 'WebKit/android/WebCoreSupport') diff --git a/WebKit/android/WebCoreSupport/FrameLoaderClientAndroid.cpp b/WebKit/android/WebCoreSupport/FrameLoaderClientAndroid.cpp index c928d46..cb361bf 100644 --- a/WebKit/android/WebCoreSupport/FrameLoaderClientAndroid.cpp +++ b/WebKit/android/WebCoreSupport/FrameLoaderClientAndroid.cpp @@ -1033,35 +1033,7 @@ WTF::PassRefPtr FrameLoaderClientAndroid::createJavaAppletWidget(const I // the contents and work out if it can render it. ObjectContentType FrameLoaderClientAndroid::objectContentType(const KURL& url, const String& mimeType) { - if (mimeType.length() == 0) - { - // Guess the mimeType from the extension - if (url.hasPath()) - { - String path = url.path(); - int lastIndex = path.reverseFind('.'); - static const String image("image/"); - if (lastIndex >= 0) - { - String mime(path.substring(lastIndex + 1)); - mime.insert(image, 0); - if (Image::supportsType(mime)) - return ObjectContentImage; - } - } - return ObjectContentFrame; - } - - if (Image::supportsType(mimeType)) - return ObjectContentImage; - - if (PluginDatabase::installedPlugins()->isMIMETypeRegistered(mimeType)) - return ObjectContentOtherPlugin; - - if (MIMETypeRegistry::isSupportedNonImageMIMEType(mimeType)) - return ObjectContentFrame; - - return ObjectContentNone; + return FrameLoader::defaultObjectContentType(url, mimeType); } // This function allows the application to set the correct CSS media -- cgit v1.1