Changeset 229182 in webkit


Ignore:
Timestamp:
Mar 2, 2018 10:33:54 AM (6 years ago)
Author:
timothy_horton@apple.com
Message:

Make it possible to disable WKPDFView
https://bugs.webkit.org/show_bug.cgi?id=183281

Reviewed by Dan Bates.

  • UIProcess/API/Cocoa/WKWebView.mm:

(-[WKWebView _isBackground]):
(-[WKWebView _isDisplayingPDF]):
(-[WKWebView _dataForDisplayedPDF]):
(-[WKWebView _suggestedFilenameForDisplayedPDF]):

  • UIProcess/Cocoa/WKWebViewContentProviderRegistry.mm:

(-[WKWebViewContentProviderRegistry init]):

  • UIProcess/ios/WKPDFView.h:
  • UIProcess/ios/WKPDFView.mm:
  • wtf/FeatureDefines.h:
Location:
trunk/Source
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WTF/ChangeLog

    r229180 r229182  
     12018-03-02  Tim Horton  <timothy_horton@apple.com>
     2
     3        Make it possible to disable WKPDFView
     4        https://bugs.webkit.org/show_bug.cgi?id=183281
     5        <rdar://problem/38060815>
     6
     7        Reviewed by Dan Bates.
     8
     9        * wtf/FeatureDefines.h:
     10
    1112018-03-02  Yusuke Suzuki  <utatane.tea@gmail.com>
    212
  • trunk/Source/WTF/wtf/FeatureDefines.h

    r225091 r229182  
    161161#endif
    162162
     163#if !defined(ENABLE_WKPDFVIEW)
     164#if !PLATFORM(WATCHOS) && !PLATFORM(APPLETV)
     165#define ENABLE_WKPDFVIEW 1
     166#endif
     167#endif
     168
    163169#endif /* PLATFORM(IOS) */
    164170
  • trunk/Source/WebKit/ChangeLog

    r229178 r229182  
     12018-03-02  Tim Horton  <timothy_horton@apple.com>
     2
     3        Make it possible to disable WKPDFView
     4        https://bugs.webkit.org/show_bug.cgi?id=183281
     5        <rdar://problem/38060815>
     6
     7        Reviewed by Dan Bates.
     8
     9        * UIProcess/API/Cocoa/WKWebView.mm:
     10        (-[WKWebView _isBackground]):
     11        (-[WKWebView _isDisplayingPDF]):
     12        (-[WKWebView _dataForDisplayedPDF]):
     13        (-[WKWebView _suggestedFilenameForDisplayedPDF]):
     14        * UIProcess/Cocoa/WKWebViewContentProviderRegistry.mm:
     15        (-[WKWebViewContentProviderRegistry init]):
     16        * UIProcess/ios/WKPDFView.h:
     17        * UIProcess/ios/WKPDFView.mm:
     18
    1192018-03-02  Youenn Fablet  <youenn@apple.com>
    220
  • trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm

    r229066 r229182  
    12951295- (BOOL)_isBackground
    12961296{
     1297#if ENABLE(WKPDFVIEW)
    12971298    if ([self _isDisplayingPDF])
    12981299        return [(WKPDFView *)_customContentView isBackground];
    1299 
     1300#endif
    13001301    return [_contentView isBackground];
    13011302}
     
    54035404- (BOOL)_isDisplayingPDF
    54045405{
     5406#if ENABLE(WKPDFVIEW)
    54055407    return [_customContentView isKindOfClass:[WKPDFView class]];
     5408#else
     5409    return NO;
     5410#endif
    54065411}
    54075412
    54085413- (NSData *)_dataForDisplayedPDF
    54095414{
     5415#if ENABLE(WKPDFVIEW)
    54105416    if (![self _isDisplayingPDF])
    54115417        return nil;
    54125418    CGPDFDocumentRef pdfDocument = [(WKPDFView *)_customContentView pdfDocument];
    54135419    return [(NSData *)CGDataProviderCopyData(CGPDFDocumentGetDataProvider(pdfDocument)) autorelease];
     5420#else
     5421    return nil;
     5422#endif
    54145423}
    54155424
    54165425- (NSString *)_suggestedFilenameForDisplayedPDF
    54175426{
     5427#if ENABLE(WKPDFVIEW)
    54185428    if (![self _isDisplayingPDF])
    54195429        return nil;
    54205430    return [(WKPDFView *)_customContentView.get() suggestedFilename];
     5431#else
     5432    return nil;
     5433#endif
    54215434}
    54225435
  • trunk/Source/WebKit/UIProcess/Cocoa/WKWebViewContentProviderRegistry.mm

    r223149 r229182  
    5252        return nil;
    5353
     54#if ENABLE(WKPDFVIEW)
    5455    for (auto& mimeType : WebCore::MIMETypeRegistry::getPDFMIMETypes())
    5556        [self registerProvider:[WKPDFView class] forMIMEType:mimeType];
     57#endif
    5658
    5759    return self;
  • trunk/Source/WebKit/UIProcess/ios/WKPDFView.h

    r210943 r229182  
    2424 */
    2525
    26 #if PLATFORM(IOS)
     26#if PLATFORM(IOS) && ENABLE(WKPDFVIEW)
    2727
    2828#import "CorePDFSPI.h"
     
    3838@end
    3939
    40 #endif // PLATFORM(IOS)
     40#endif // PLATFORM(IOS) && ENABLE(WKPDFVIEW)
  • trunk/Source/WebKit/UIProcess/ios/WKPDFView.mm

    r226533 r229182  
    2727#import "WKPDFView.h"
    2828
    29 #if PLATFORM(IOS)
     29#if PLATFORM(IOS) && ENABLE(WKPDFVIEW)
    3030
    3131#import "APIFindClient.h"
     
    893893#pragma clang diagnostic pop
    894894
    895 #endif /* PLATFORM(IOS) */
     895#endif // PLATFORM(IOS) && ENABLE(WKPDFVIEW)
Note: See TracChangeset for help on using the changeset viewer.