Title: [104217] branches/safari-534.54-branch/Source/WebKit2

Diff

Modified: branches/safari-534.54-branch/Source/WebKit2/ChangeLog (104216 => 104217)


--- branches/safari-534.54-branch/Source/WebKit2/ChangeLog	2012-01-05 22:03:04 UTC (rev 104216)
+++ branches/safari-534.54-branch/Source/WebKit2/ChangeLog	2012-01-05 22:04:30 UTC (rev 104217)
@@ -1,5 +1,29 @@
 2011-1-5  Lucas Forschler  <lforsch...@apple.com>
 
+    Merge 98513
+
+    2011-10-26  Jeff Miller  <je...@apple.com>
+
+            WebKit2 should respect secret WebKitOmitPDFSupport preference on the Mac
+            https://bugs.webkit.org/show_bug.cgi?id=70943
+
+            If WebKitOmitPDFSupport pref is set, disable both the new "plug-in" for subframes and the PDFKit-based support for the main frame only.
+
+            Reviewed by Alexey Proskuryakov.
+
+            * UIProcess/WebContext.cpp:
+            (WebKit::WebContext::getPlugins): Don't register built-in PDF plugin if WebKitOmitPDFSupport pref is set.
+
+            * UIProcess/WebContext.h: Added omitPDFSupport().
+
+            * UIProcess/WebFrameProxy.cpp:
+            (WebKit::WebFrameProxy::canShowMIMEType): Don't show PDFs if WebKitOmitPDFSupport is set.
+
+            * UIProcess/mac/WebContextMac.mm:
+            (WebKit::WebContext::omitPDFSupport): Added.
+
+2011-1-5  Lucas Forschler  <lforsch...@apple.com>
+
     Merge 98362
 
     2011-10-25  John Sullivan  <sulli...@apple.com>

Modified: branches/safari-534.54-branch/Source/WebKit2/UIProcess/WebContext.cpp (104216 => 104217)


--- branches/safari-534.54-branch/Source/WebKit2/UIProcess/WebContext.cpp	2012-01-05 22:03:04 UTC (rev 104216)
+++ branches/safari-534.54-branch/Source/WebKit2/UIProcess/WebContext.cpp	2012-01-05 22:04:30 UTC (rev 104217)
@@ -550,7 +550,8 @@
 
 #if PLATFORM(MAC)
     // Add built-in PDF last, so that it's not used when a real plug-in is installed.
-    pluginInfos.append(BuiltInPDFView::pluginInfo());
+    if (!omitPDFSupport())
+        pluginInfos.append(BuiltInPDFView::pluginInfo());
 #endif
 }
 

Modified: branches/safari-534.54-branch/Source/WebKit2/UIProcess/WebContext.h (104216 => 104217)


--- branches/safari-534.54-branch/Source/WebKit2/UIProcess/WebContext.h	2012-01-05 22:03:04 UTC (rev 104216)
+++ branches/safari-534.54-branch/Source/WebKit2/UIProcess/WebContext.h	2012-01-05 22:04:30 UTC (rev 104217)
@@ -183,6 +183,10 @@
     void getWebCoreStatistics(PassRefPtr<DictionaryCallback>);
     void garbageCollectJavaScriptObjects();
 
+#if PLATFORM(MAC)
+    static bool omitPDFSupport();
+#endif
+
 private:
     WebContext(ProcessModel, const String& injectedBundlePath);
 

Modified: branches/safari-534.54-branch/Source/WebKit2/UIProcess/WebFrameProxy.cpp (104216 => 104217)


--- branches/safari-534.54-branch/Source/WebKit2/UIProcess/WebFrameProxy.cpp	2012-01-05 22:03:04 UTC (rev 104216)
+++ branches/safari-534.54-branch/Source/WebKit2/UIProcess/WebFrameProxy.cpp	2012-01-05 22:04:30 UTC (rev 104217)
@@ -110,7 +110,7 @@
 #if PLATFORM(MAC)
     // On Mac, we can show PDFs.
     if (!mimeType.isEmpty())
-        return WebContext::pdfAndPostScriptMIMETypes().contains(mimeType);
+        return WebContext::pdfAndPostScriptMIMETypes().contains(mimeType) && !WebContext::omitPDFSupport();
 #endif
 
     return false;

Modified: branches/safari-534.54-branch/Source/WebKit2/UIProcess/mac/WebContextMac.mm (104216 => 104217)


--- branches/safari-534.54-branch/Source/WebKit2/UIProcess/mac/WebContextMac.mm	2012-01-05 22:03:04 UTC (rev 104216)
+++ branches/safari-534.54-branch/Source/WebKit2/UIProcess/mac/WebContextMac.mm	2012-01-05 22:04:30 UTC (rev 104217)
@@ -135,5 +135,11 @@
     return [localStorageDirectory stringByStandardizingPath];
 }
 
+bool WebContext::omitPDFSupport()
+{
+    // Since this is a "secret default" we don't bother registering it.
+    return [[NSUserDefaults standardUserDefaults] boolForKey:@"WebKitOmitPDFSupport"];
+}
+
 } // namespace WebKit
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to