Title: [131867] trunk/Source/WebKit2
- Revision
- 131867
- Author
- [email protected]
- Date
- 2012-10-19 00:18:58 -0700 (Fri, 19 Oct 2012)
Log Message
WebPageProxy::canShowMIMEType() should return false for plugins when they are disabled
https://bugs.webkit.org/show_bug.cgi?id=99449
Reviewed by Anders Carlsson.
* UIProcess/API/gtk/tests/GNUmakefile.am:
* UIProcess/API/gtk/tests/TestWebKitWebView.cpp:
(testWebViewCanShowMIMEType): Test that
webkit_web_view_can_show_mime_type() returns FALSE if plugins are
disabled.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::canShowMIMEType): Return false for
MIME-Type of plugins if they are disabled.
Modified Paths
Diff
Modified: trunk/Source/WebKit2/ChangeLog (131866 => 131867)
--- trunk/Source/WebKit2/ChangeLog 2012-10-19 07:07:58 UTC (rev 131866)
+++ trunk/Source/WebKit2/ChangeLog 2012-10-19 07:18:58 UTC (rev 131867)
@@ -1,3 +1,19 @@
+2012-10-18 Carlos Garcia Campos <[email protected]>
+
+ WebPageProxy::canShowMIMEType() should return false for plugins when they are disabled
+ https://bugs.webkit.org/show_bug.cgi?id=99449
+
+ Reviewed by Anders Carlsson.
+
+ * UIProcess/API/gtk/tests/GNUmakefile.am:
+ * UIProcess/API/gtk/tests/TestWebKitWebView.cpp:
+ (testWebViewCanShowMIMEType): Test that
+ webkit_web_view_can_show_mime_type() returns FALSE if plugins are
+ disabled.
+ * UIProcess/WebPageProxy.cpp:
+ (WebKit::WebPageProxy::canShowMIMEType): Return false for
+ MIME-Type of plugins if they are disabled.
+
2012-10-18 Brady Eidson <[email protected]>
Move ConnectionStack out of WebProcessConnection into its own files.
Modified: trunk/Source/WebKit2/UIProcess/API/gtk/tests/GNUmakefile.am (131866 => 131867)
--- trunk/Source/WebKit2/UIProcess/API/gtk/tests/GNUmakefile.am 2012-10-19 07:07:58 UTC (rev 131866)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/tests/GNUmakefile.am 2012-10-19 07:18:58 UTC (rev 131867)
@@ -31,6 +31,7 @@
-DWEBKIT_EXEC_PATH=\"${shell pwd}/$(top_builddir)/Programs\" \
-DWEBKIT_SRC_DIR=\"${shell pwd}/${srcdir}\" \
-DWEBKIT_DERIVED_SRC_DIR=\"${shell pwd}/${top_builddir}/DerivedSources\" \
+ -DWEBKIT_TEST_PLUGIN_DIR=\"${shell pwd}/${top_builddir}/TestNetscapePlugin/.libs\" \
$(_javascript_core_cppflags) \
-I$(srcdir)/Source/_javascript_Core \
-I$(srcdir)/Source \
@@ -83,9 +84,7 @@
Programs_WebKit2APITests_TestWebKitWebContext_SOURCES = \
Source/WebKit2/UIProcess/API/gtk/tests/TestWebKitWebContext.cpp
-Programs_WebKit2APITests_TestWebKitWebContext_CPPFLAGS = \
- -DWEBKIT_TEST_PLUGIN_DIR=\"${shell pwd}/${top_builddir}/TestNetscapePlugin/.libs\" \
- $(webkit2_tests_cppflags)
+Programs_WebKit2APITests_TestWebKitWebContext_CPPFLAGS = $(webkit2_tests_cppflags)
Programs_WebKit2APITests_TestWebKitWebContext_LDADD = $(webkit2_tests_ldadd)
Programs_WebKit2APITests_TestWebKitWebContext_LDFLAGS = $(webkit2_tests_ldflags)
Modified: trunk/Source/WebKit2/UIProcess/API/gtk/tests/TestWebKitWebView.cpp (131866 => 131867)
--- trunk/Source/WebKit2/UIProcess/API/gtk/tests/TestWebKitWebView.cpp 2012-10-19 07:07:58 UTC (rev 131866)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/tests/TestWebKitWebView.cpp 2012-10-19 07:18:58 UTC (rev 131867)
@@ -857,6 +857,12 @@
g_assert(!webkit_web_view_can_show_mime_type(test->m_webView, "application/pdf"));
g_assert(!webkit_web_view_can_show_mime_type(test->m_webView, "application/zip"));
g_assert(!webkit_web_view_can_show_mime_type(test->m_webView, "application/octet-stream"));
+
+ // Plugins are only supported when enabled.
+ webkit_web_context_set_additional_plugins_directory(webkit_web_view_get_context(test->m_webView), WEBKIT_TEST_PLUGIN_DIR);
+ g_assert(webkit_web_view_can_show_mime_type(test->m_webView, "application/x-webkit-test-netscape"));
+ webkit_settings_set_enable_plugins(webkit_web_view_get_settings(test->m_webView), FALSE);
+ g_assert(!webkit_web_view_can_show_mime_type(test->m_webView, "application/x-webkit-test-netscape"));
}
class FormClientTest: public WebViewTest {
Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp (131866 => 131867)
--- trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp 2012-10-19 07:07:58 UTC (rev 131866)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp 2012-10-19 07:18:58 UTC (rev 131867)
@@ -782,7 +782,7 @@
#if ENABLE(NETSCAPE_PLUGIN_API)
String newMimeType = mimeType;
PluginModuleInfo plugin = m_process->context()->pluginInfoStore().findPlugin(newMimeType, KURL());
- if (!plugin.path.isNull())
+ if (!plugin.path.isNull() && m_pageGroup->preferences()->pluginsEnabled())
return true;
#endif // ENABLE(NETSCAPE_PLUGIN_API)
return false;
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes