Title: [144228] trunk/Source/WebKit2
Revision
144228
Author
jer.no...@apple.com
Date
2013-02-27 12:44:46 -0800 (Wed, 27 Feb 2013)

Log Message

REGRESSION (48533): Full-frame plugins stopped working (download instead of loading the plugin)
https://bugs.webkit.org/show_bug.cgi?id=111003

Reviewed by Anders Carlsson.

Also query the Page's pluginData when determining whether a given MIME type can be shown.

* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(WKBundlePageCanShowMIMEType):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::canShowMIMEType):
* WebProcess/WebPage/WebPage.h:

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (144227 => 144228)


--- trunk/Source/WebKit2/ChangeLog	2013-02-27 20:43:46 UTC (rev 144227)
+++ trunk/Source/WebKit2/ChangeLog	2013-02-27 20:44:46 UTC (rev 144228)
@@ -1,3 +1,18 @@
+2013-02-27  Jer Noble  <jer.no...@apple.com>
+
+        REGRESSION (48533): Full-frame plugins stopped working (download instead of loading the plugin)
+        https://bugs.webkit.org/show_bug.cgi?id=111003
+
+        Reviewed by Anders Carlsson.
+
+        Also query the Page's pluginData when determining whether a given MIME type can be shown.
+
+        * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
+        (WKBundlePageCanShowMIMEType):
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::canShowMIMEType):
+        * WebProcess/WebPage/WebPage.h:
+
 2013-02-27  Manuel Rego Casasnovas  <r...@igalia.com>
 
         Add smartInsertDeleteEnabled setting to WebCore::Page

Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp (144227 => 144228)


--- trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp	2013-02-27 20:43:46 UTC (rev 144227)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp	2013-02-27 20:44:46 UTC (rev 144228)
@@ -50,7 +50,6 @@
 #include <WebCore/AccessibilityObject.h>
 #include <WebCore/Frame.h>
 #include <WebCore/KURL.h>
-#include <WebCore/MIMETypeRegistry.h>
 #include <WebCore/Page.h>
 #include <wtf/UnusedParam.h>
 
@@ -446,11 +445,9 @@
     toImpl(pageRef)->confirmCompositionForTesting(toWTFString(text));
 }
 
-bool WKBundlePageCanShowMIMEType(WKBundlePageRef, WKStringRef mimeTypeRef)
+bool WKBundlePageCanShowMIMEType(WKBundlePageRef pageRef, WKStringRef mimeTypeRef)
 {
-    const String mimeType = toWTFString(mimeTypeRef);
-
-    return WebCore::MIMETypeRegistry::canShowMIMEType(mimeType);
+    return toImpl(pageRef)->canShowMIMEType(toWTFString(mimeTypeRef));
 }
 
 void WKBundlePageSetViewMode(WKBundlePageRef pageRef, WKStringRef mode)

Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (144227 => 144228)


--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp	2013-02-27 20:43:46 UTC (rev 144227)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp	2013-02-27 20:44:46 UTC (rev 144228)
@@ -103,6 +103,7 @@
 #include <WebCore/HTMLPlugInElement.h>
 #include <WebCore/HistoryItem.h>
 #include <WebCore/KeyboardEvent.h>
+#include <WebCore/MIMETypeRegistry.h>
 #include <WebCore/MouseEvent.h>
 #include <WebCore/Page.h>
 #include <WebCore/PlatformKeyboardEvent.h>
@@ -3793,4 +3794,17 @@
     m_page->settings()->setSmartInsertDeleteEnabled(enabled);
 }
 
+bool WebPage::canShowMIMEType(const String& MIMEType) const
+{
+    if (MIMETypeRegistry::canShowMIMEType(MIMEType))
+        return true;
+
+    if (PluginData* pluginData = m_page->pluginData()) {
+        if (pluginData->supportsMimeType(MIMEType) && m_page->settings()->arePluginsEnabled())
+            return true;
+    }
+
+    return false;
+}
+
 } // namespace WebKit

Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h (144227 => 144228)


--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h	2013-02-27 20:43:46 UTC (rev 144227)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h	2013-02-27 20:44:46 UTC (rev 144228)
@@ -607,6 +607,8 @@
     void setMinimumLayoutWidth(double);
     double minimumLayoutWidth() const { return m_minimumLayoutWidth; }
 
+    bool canShowMIMEType(const String& MIMEType) const;
+
 private:
     WebPage(uint64_t pageID, const WebPageCreationParameters&);
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to