⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 98513 in webkit


Ignore:
Timestamp:
Oct 26, 2011, 1:19:14 PM (15 years ago)
Author:
jeffm@apple.com
Message:

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.

Location:
trunk/Source/WebKit2
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r98509 r98513  
     12011-10-26  Jeff Miller  <jeffm@apple.com>
     2
     3        WebKit2 should respect secret WebKitOmitPDFSupport preference on the Mac
     4        https://bugs.webkit.org/show_bug.cgi?id=70943
     5       
     6        If WebKitOmitPDFSupport pref is set, disable both the new "plug-in" for subframes and the PDFKit-based support for the main frame only.
     7
     8        Reviewed by Alexey Proskuryakov.
     9
     10        * UIProcess/WebContext.cpp:
     11        (WebKit::WebContext::getPlugins): Don't register built-in PDF plugin if WebKitOmitPDFSupport pref is set.
     12       
     13        * UIProcess/WebContext.h: Added omitPDFSupport().
     14       
     15        * UIProcess/WebFrameProxy.cpp:
     16        (WebKit::WebFrameProxy::canShowMIMEType): Don't show PDFs if WebKitOmitPDFSupport is set.
     17       
     18        * UIProcess/mac/WebContextMac.mm:
     19        (WebKit::WebContext::omitPDFSupport): Added.
     20
    1212011-10-26  Sam Weinig  <sam@webkit.org>
    222
  • trunk/Source/WebKit2/UIProcess/WebContext.cpp

    r96969 r98513  
    569569#if PLATFORM(MAC)
    570570    // Add built-in PDF last, so that it's not used when a real plug-in is installed.
    571     pluginInfos.append(BuiltInPDFView::pluginInfo());
     571    if (!omitPDFSupport())
     572        pluginInfos.append(BuiltInPDFView::pluginInfo());
    572573#endif
    573574}
  • trunk/Source/WebKit2/UIProcess/WebContext.h

    r96969 r98513  
    185185    void garbageCollectJavaScriptObjects();
    186186
     187#if PLATFORM(MAC)
     188    static bool omitPDFSupport();
     189#endif
     190
    187191private:
    188192    WebContext(ProcessModel, const String& injectedBundlePath);
  • trunk/Source/WebKit2/UIProcess/WebFrameProxy.cpp

    r96653 r98513  
    112112    // On Mac, we can show PDFs.
    113113    if (!mimeType.isEmpty())
    114         return WebContext::pdfAndPostScriptMIMETypes().contains(mimeType);
     114        return WebContext::pdfAndPostScriptMIMETypes().contains(mimeType) && !WebContext::omitPDFSupport();
    115115#endif
    116116
  • trunk/Source/WebKit2/UIProcess/mac/WebContextMac.mm

    r96969 r98513  
    140140}
    141141
     142bool WebContext::omitPDFSupport()
     143{
     144    // Since this is a "secret default" we don't bother registering it.
     145    return [[NSUserDefaults standardUserDefaults] boolForKey:@"WebKitOmitPDFSupport"];
     146}
     147
    142148} // namespace WebKit
    143149
Note: See TracChangeset for help on using the changeset viewer.