Use thumbnails in System Previews
authordino@apple.com <dino@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 8 May 2018 18:57:48 +0000 (18:57 +0000)
committerdino@apple.com <dino@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 8 May 2018 18:57:48 +0000 (18:57 +0000)
https://bugs.webkit.org/show_bug.cgi?id=185397
<rdar://problem/40039376>

Reviewed by Jon Lee.

Source/WebCore/PAL:

* PAL.xcodeproj/project.pbxproj:
* pal/spi/ios/SystemPreviewSPI.h: New file holding the non-public parts of System Preview.

Source/WebKit:

A system preview that goes through the WKWebViewContentProvider will
show a static thumbnail/snapshot of the item, rather than jumping
directly to QuickLook.

This means we have to link to the AssetViewer framework. That provides
a ASVThumbnailView that will trigger QuickLook for us.

* Configurations/WebKit.xcconfig: Link to AssetViewer.

* UIProcess/ios/WKSystemPreviewView.h: Better macro use. Remove some unneeded protocols.
* UIProcess/ios/WKSystemPreviewView.mm:
(-[WKSystemPreviewView web_setContentProviderData:suggestedFilename:]): Update this
to use an ASVThumbnailView, when on the internal SDK (because it is private).
(-[WKSystemPreviewView _layoutThumbnailView]): Use the content insets to put
the thumbnail in the right place.
(-[WKSystemPreviewView thumbnailView:wantsToPresentPreviewController:forItem:]):
Delegate method.
(-[WKSystemPreviewView web_contentView]):
(-[WKSystemPreviewView web_computedContentInsetDidChange]):
(-[WKSystemPreviewView numberOfPreviewItemsInPreviewController:]): Deleted.
(-[WKSystemPreviewView previewController:previewItemAtIndex:]): Deleted.
(-[WKSystemPreviewView previewControllerWillDismiss:]): Deleted.

Source/WTF:

SYSTEM_PREVIEW is only available on some platforms.

* wtf/Platform.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231497 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WTF/ChangeLog
Source/WTF/wtf/Platform.h
Source/WebCore/PAL/ChangeLog
Source/WebCore/PAL/PAL.xcodeproj/project.pbxproj
Source/WebCore/PAL/pal/spi/ios/SystemPreviewSPI.h [new file with mode: 0644]
Source/WebKit/ChangeLog
Source/WebKit/Configurations/WebKit.xcconfig
Source/WebKit/UIProcess/ios/WKSystemPreviewView.h
Source/WebKit/UIProcess/ios/WKSystemPreviewView.mm

index 43fdfac..8cddf1f 100644 (file)
@@ -1,3 +1,15 @@
+2018-05-08  Dean Jackson  <dino@apple.com>
+
+        Use thumbnails in System Previews
+        https://bugs.webkit.org/show_bug.cgi?id=185397
+        <rdar://problem/40039376>
+
+        Reviewed by Jon Lee.
+
+        SYSTEM_PREVIEW is only available on some platforms.
+
+        * wtf/Platform.h:
+
 2018-05-08  Ryan Haddad  <ryanhaddad@apple.com>
 
         Unreviewed, rolling out r231468.
index da8444f..002aae6 100644 (file)
 #endif
 #endif
 
-#if PLATFORM(IOS) && USE(QUICK_LOOK)
+#if PLATFORM(IOS) && USE(QUICK_LOOK) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 120000
 #define USE_SYSTEM_PREVIEW 1
 #endif
 
index 351a72f..a0902a2 100644 (file)
@@ -1,3 +1,14 @@
+2018-05-08  Dean Jackson  <dino@apple.com>
+
+        Use thumbnails in System Previews
+        https://bugs.webkit.org/show_bug.cgi?id=185397
+        <rdar://problem/40039376>
+
+        Reviewed by Jon Lee.
+
+        * PAL.xcodeproj/project.pbxproj:
+        * pal/spi/ios/SystemPreviewSPI.h: New file holding the non-public parts of System Preview.
+
 2018-05-04  Tim Horton  <timothy_horton@apple.com>
 
         Shift to a lower-level framework for simplifying URLs
index 94849ce..6f9e744 100644 (file)
                1C4876D91F8D7F4E00CCEEBD /* Logging.h in Headers */ = {isa = PBXBuildFile; fileRef = 1C4876D71F8D7F4E00CCEEBD /* Logging.h */; };
                1C4876E01F8D837500CCEEBD /* LoggingCocoa.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1C4876DF1F8D837500CCEEBD /* LoggingCocoa.mm */; };
                2D02E93C2056FAA700A13797 /* AudioToolboxSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 2D02E93B2056FAA700A13797 /* AudioToolboxSPI.h */; };
+               31308B1420A21705003FB929 /* SystemPreviewSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 31308B1320A21705003FB929 /* SystemPreviewSPI.h */; };
                57F12518205787D7001AB8A6 /* DeviceIdentitySPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 57F12517205787C8001AB8A6 /* DeviceIdentitySPI.h */; };
                7A1656441F97B2B900BA3CE4 /* NSKeyedArchiverSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 7A1656431F97B2B800BA3CE4 /* NSKeyedArchiverSPI.h */; };
                A10265871F56746100B4C844 /* FoundationSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = A10265861F56746100B4C844 /* FoundationSPI.h */; };
                1C67CEA11E32EDA800F80F2E /* FeatureDefines.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = FeatureDefines.xcconfig; sourceTree = "<group>"; };
                1C67CEA21E32EE2600F80F2E /* Version.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Version.xcconfig; sourceTree = "<group>"; };
                2D02E93B2056FAA700A13797 /* AudioToolboxSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AudioToolboxSPI.h; sourceTree = "<group>"; };
+               31308B1320A21705003FB929 /* SystemPreviewSPI.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SystemPreviewSPI.h; sourceTree = "<group>"; };
                57F12517205787C8001AB8A6 /* DeviceIdentitySPI.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DeviceIdentitySPI.h; sourceTree = "<group>"; };
                7A1656431F97B2B800BA3CE4 /* NSKeyedArchiverSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSKeyedArchiverSPI.h; sourceTree = "<group>"; };
                93E5909C1F93BF1E0067F8CF /* UnencodableHandling.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = UnencodableHandling.h; sourceTree = "<group>"; };
                                0C5AF9151F43A4C7002EAC02 /* OpenGLESSPI.h */,
                                0C5AF9161F43A4C7002EAC02 /* QuickLookSPI.h */,
                                0C5AF9171F43A4C7002EAC02 /* SQLite3SPI.h */,
+                               31308B1320A21705003FB929 /* SystemPreviewSPI.h */,
                                0C5AF9181F43A4C7002EAC02 /* UIKitSPI.h */,
                        );
                        path = ios;
                                A3788E981F05B6CE00679425 /* Sound.h in Headers */,
                                A1175B491F6AFF8E00C4B9F0 /* SpeechSynthesisSPI.h in Headers */,
                                0C5AF9211F43A4C7002EAC02 /* SQLite3SPI.h in Headers */,
+                               31308B1420A21705003FB929 /* SystemPreviewSPI.h in Headers */,
                                A3AB6E581F3D1DDB009C14B1 /* SystemSleepListener.h in Headers */,
                                A3AB6E641F3D217F009C14B1 /* SystemSleepListenerMac.h in Headers */,
                                0C7785A11F45130F00F4EBB6 /* TUCallSPI.h in Headers */,
diff --git a/Source/WebCore/PAL/pal/spi/ios/SystemPreviewSPI.h b/Source/WebCore/PAL/pal/spi/ios/SystemPreviewSPI.h
new file mode 100644 (file)
index 0000000..888451a
--- /dev/null
@@ -0,0 +1,49 @@
+/*
+ * Copyright (C) 2018 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#if USE(APPLE_INTERNAL_SDK)
+
+#import <AssetViewer/ASVThumbnailView.h>
+
+#else
+
+#import <UIKit/UIKit.h>
+
+@class ASVThumbnailView;
+@class QLItem;
+@class QLPreviewController;
+
+@protocol ASVThumbnailViewDelegate <NSObject>
+- (void)thumbnailView:(ASVThumbnailView *)thumbnailView wantsToPresentPreviewController:(QLPreviewController *)previewController forItem:(QLItem *)item
+@end
+
+@interface ASVThumbnailView : UIView
+@property (nonatomic, weak) id<ASVThumbnailViewDelegate> delegate;
+@property (nonatomic) QLItem *thumbnailItem;
+@property (nonatomic) CGSize maxThumbnailSize;
+@end
+
+#endif
+
index 833246d..9805463 100644 (file)
@@ -1,3 +1,34 @@
+2018-05-08  Dean Jackson  <dino@apple.com>
+
+        Use thumbnails in System Previews
+        https://bugs.webkit.org/show_bug.cgi?id=185397
+        <rdar://problem/40039376>
+
+        Reviewed by Jon Lee.
+
+        A system preview that goes through the WKWebViewContentProvider will
+        show a static thumbnail/snapshot of the item, rather than jumping
+        directly to QuickLook.
+
+        This means we have to link to the AssetViewer framework. That provides
+        a ASVThumbnailView that will trigger QuickLook for us.
+
+        * Configurations/WebKit.xcconfig: Link to AssetViewer.
+
+        * UIProcess/ios/WKSystemPreviewView.h: Better macro use. Remove some unneeded protocols.
+        * UIProcess/ios/WKSystemPreviewView.mm:
+        (-[WKSystemPreviewView web_setContentProviderData:suggestedFilename:]): Update this
+        to use an ASVThumbnailView, when on the internal SDK (because it is private).
+        (-[WKSystemPreviewView _layoutThumbnailView]): Use the content insets to put
+        the thumbnail in the right place.
+        (-[WKSystemPreviewView thumbnailView:wantsToPresentPreviewController:forItem:]):
+        Delegate method.
+        (-[WKSystemPreviewView web_contentView]):
+        (-[WKSystemPreviewView web_computedContentInsetDidChange]):
+        (-[WKSystemPreviewView numberOfPreviewItemsInPreviewController:]): Deleted.
+        (-[WKSystemPreviewView previewController:previewItemAtIndex:]): Deleted.
+        (-[WKSystemPreviewView previewControllerWillDismiss:]): Deleted.
+
 2018-05-08  Youenn Fablet  <youenn@apple.com>
 
         Allow WebResourceLoader to cancel a load served from a service worker
index 871f047..bfcb425 100644 (file)
@@ -106,13 +106,19 @@ WK_SAFE_BROWSING_LDFLAGS_iphonesimulator[sdk=iphone*10.*] = ;
 WK_SAFE_BROWSING_LDFLAGS_macosx = $(WK_SAFE_BROWSING_LDFLAGS$(WK_MACOS_1013));
 WK_SAFE_BROWSING_LDFLAGS_MACOS_SINCE_1013 = -weak_framework SafariSafeBrowsing;
 
+WK_SYSTEM_PREVIEW_LDFLAGS = $(WK_SYSTEM_PREVIEW_LDFLAGS_$(WK_PLATFORM_NAME));
+WK_SYSTEM_PREVIEW_LDFLAGS_iphoneos = -framework AssetViewer;
+WK_SYSTEM_PREVIEW_LDFLAGS_iphonesimulator = -framework AssetViewer;
+WK_SYSTEM_PREVIEW_LDFLAGS_iphoneos[sdk=iphone*11.*] = ;
+WK_SYSTEM_PREVIEW_LDFLAGS_iphonesimulator[sdk=iphone*11.*] = ;
+
 WK_UIKIT_LDFLAGS = $(WK_UIKIT_LDFLAGS_$(WK_COCOA_TOUCH));
 WK_UIKIT_LDFLAGS_cocoatouch = -framework UIKit;
 
 WK_URL_FORMATTING_LDFLAGS = $(WK_URL_FORMATTING_LDFLAGS_$(WK_HAVE_URL_FORMATTING));
 WK_URL_FORMATTING_LDFLAGS_YES = -framework URLFormatting;
 
-FRAMEWORK_AND_LIBRARY_LDFLAGS = -lobjc -framework CFNetwork -framework CoreAudio -framework CoreFoundation -framework CoreGraphics -framework CoreText -framework Foundation -framework ImageIO -framework IOKit -framework WebKitLegacy -lnetwork $(WK_ACCESSIBILITY_LDFLAGS) $(WK_APPKIT_LDFLAGS) $(WK_ASSERTION_SERVICES_LDFLAGS) $(WK_CARBON_LDFLAGS) $(WK_CORE_PDF_LDFLAGS) $(WK_CORE_PREDICTION_LDFLAGS) $(WK_CORE_SERVICES_LDFLAGS) $(WK_GRAPHICS_SERVICES_LDFLAGS) $(WK_IOSURFACE_LDFLAGS) $(WK_LIBWEBRTC_LDFLAGS) $(WK_MOBILE_CORE_SERVICES_LDFLAGS) $(WK_MOBILE_GESTALT_LDFLAGS) $(WK_OPENGL_LDFLAGS) $(WK_PDFKIT_LDFLAGS) $(WK_SAFE_BROWSING_LDFLAGS) $(WK_UIKIT_LDFLAGS) $(WK_URL_FORMATTING_LDFLAGS);
+FRAMEWORK_AND_LIBRARY_LDFLAGS = -lobjc -framework CFNetwork -framework CoreAudio -framework CoreFoundation -framework CoreGraphics -framework CoreText -framework Foundation -framework ImageIO -framework IOKit -framework WebKitLegacy -lnetwork $(WK_ACCESSIBILITY_LDFLAGS) $(WK_APPKIT_LDFLAGS) $(WK_ASSERTION_SERVICES_LDFLAGS) $(WK_CARBON_LDFLAGS) $(WK_CORE_PDF_LDFLAGS) $(WK_CORE_PREDICTION_LDFLAGS) $(WK_CORE_SERVICES_LDFLAGS) $(WK_GRAPHICS_SERVICES_LDFLAGS) $(WK_IOSURFACE_LDFLAGS) $(WK_LIBWEBRTC_LDFLAGS) $(WK_MOBILE_CORE_SERVICES_LDFLAGS) $(WK_MOBILE_GESTALT_LDFLAGS) $(WK_OPENGL_LDFLAGS) $(WK_PDFKIT_LDFLAGS) $(WK_SAFE_BROWSING_LDFLAGS) $(WK_SYSTEM_PREVIEW_LDFLAGS) $(WK_UIKIT_LDFLAGS) $(WK_URL_FORMATTING_LDFLAGS);
 
 // Prevent C++ standard library operator new, delete and their related exception types from being exported as weak symbols.
 UNEXPORTED_SYMBOL_LDFLAGS = -Wl,-unexported_symbol -Wl,__ZTISt9bad_alloc -Wl,-unexported_symbol -Wl,__ZTISt9exception -Wl,-unexported_symbol -Wl,__ZTSSt9bad_alloc -Wl,-unexported_symbol -Wl,__ZTSSt9exception -Wl,-unexported_symbol -Wl,__ZdlPvS_ -Wl,-unexported_symbol -Wl,__ZnwmPv -Wl,-unexported_symbol -Wl,__Znwm -Wl,-unexported_symbol, -Wl,__ZNSt3__18functionIFvN7WebCore12PolicyActionEEEC2EOS4_ -Wl,-unexported_symbol, -Wl,__ZNSt3__18functionIFvN7WebCore12PolicyActionEEEC1EOS4_ -Wl,-unexported_symbol, -Wl,__ZNSt3__18functionIFvN7WebCore12PolicyActionEEEaSEDn -Wl,-unexported_symbol, -Wl,__ZNKSt3__18functionIFvN7WebCore12PolicyActionEEEclES2_ -Wl,-unexported_symbol, -Wl,__ZNSt3__18functionIFvN7WebCore12PolicyActionEEE4swapERS4_ -Wl,-unexported_symbol, -Wl,__ZNSt3__18functionIFvN7WebCore12PolicyActionEEEC1ERKS4_ -Wl,-unexported_symbol, -Wl,__ZNSt3__18functionIFvN7WebCore12PolicyActionEEEC2ERKS4_ -Wl,-unexported_symbol, -Wl,__ZNSt3__18functionIFvN7WebCore12PolicyActionEEED1Ev -Wl,-unexported_symbol, -Wl,__ZNSt3__18functionIFvN7WebCore12PolicyActionEEED2Ev -Wl,-unexported_symbol, -Wl,__ZNSt3__18functionIFvN7WebCore12PolicyActionEEEaSERKS4_ -Wl,-unexported_symbol, -Wl,__ZTVNSt3__117bad_function_callE;
index f02ce57..6902528 100644 (file)
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#if PLATFORM(IOS) && USE(QUICK_LOOK)
+#if USE(SYSTEM_PREVIEW)
 
 #import "WKWebViewContentProvider.h"
 #import <QuickLook/QuickLook.h>
 #import <UIKit/UIKit.h>
 #import <pal/spi/ios/QuickLookSPI.h>
 
-@interface WKSystemPreviewView : UIView <WKWebViewContentProvider, QLPreviewControllerDataSource, QLPreviewControllerDelegate, QLPreviewItemDataProvider>
+@interface WKSystemPreviewView : UIView <WKWebViewContentProvider, QLPreviewItemDataProvider>
 
 @end
 
index 34da80c..b279ea4 100644 (file)
 #import <MobileCoreServices/MobileCoreServices.h>
 #import <WebCore/FloatRect.h>
 #import <WebCore/LocalizedStrings.h>
+#import <pal/spi/ios/SystemPreviewSPI.h>
 #import <wtf/RetainPtr.h>
 #import <wtf/SoftLinking.h>
 #import <wtf/Vector.h>
 
+#if USE(APPLE_INTERNAL_SDK)
+#import <WebKitAdditions/SystemPreviewTypes.cpp>
+#endif
+
 using namespace WebCore;
 using namespace WebKit;
 
 SOFT_LINK_FRAMEWORK(QuickLook)
 SOFT_LINK_CLASS(QuickLook, QLItem);
-SOFT_LINK_CLASS(QuickLook, QLPreviewController);
+
+@interface WKSystemPreviewView () <ASVThumbnailViewDelegate>
+@end
 
 @implementation WKSystemPreviewView {
-    RetainPtr<QLPreviewController> _qlPreviewController;
     RetainPtr<NSItemProvider> _itemProvider;
-    RetainPtr<QLItem> _item;
     RetainPtr<NSData> _data;
     RetainPtr<NSString> _suggestedFilename;
-
+    RetainPtr<QLItem> _item;
+    RetainPtr<ASVThumbnailView> _thumbnailView;
     WKWebView *_webView;
 }
 
@@ -89,12 +95,48 @@ SOFT_LINK_CLASS(QuickLook, QLPreviewController);
     RetainPtr<CFStringRef> contentType = adoptCF(UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension, (__bridge CFStringRef)extension, nil));
 
     _item = adoptNS([allocQLItemInstance() initWithDataProvider:self contentType:(NSString *)contentType.get() previewTitle:_suggestedFilename.get()]);
+    [_item setUseLoadingTimeout:NO];
+
+    _thumbnailView = adoptNS([ASVThumbnailView new]);
+    [_thumbnailView setDelegate:self];
+    [self setAutoresizingMask:UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight];
+
+    [self setAutoresizesSubviews:YES];
+    [self setClipsToBounds:YES];
+    [self addSubview:_thumbnailView.get()];
+    [self _layoutThumbnailView];
 
-    _qlPreviewController = adoptNS([allocQLPreviewControllerInstance() init]);
-    [_qlPreviewController setDelegate:self];
-    [_qlPreviewController setDataSource:self];
+    auto screenBounds = UIScreen.mainScreen.bounds;
+    CGFloat maxDimension = CGFloatMin(screenBounds.size.width, screenBounds.size.height);
+    [_thumbnailView setMaxThumbnailSize:CGSizeMake(maxDimension, maxDimension)];
 
-    [presentingViewController presentViewController:_qlPreviewController.get() animated:YES completion:nullptr];
+    [_thumbnailView setThumbnailItem:_item.get()];
+}
+
+- (void)_layoutThumbnailView
+{
+    if (_thumbnailView) {
+        UIEdgeInsets safeAreaInsets = _webView._computedUnobscuredSafeAreaInset;
+        CGRect layoutFrame = CGRectMake(0, 0, self.frame.size.width - safeAreaInsets.left - safeAreaInsets.right, self.frame.size.height - safeAreaInsets.top - safeAreaInsets.bottom);
+        [_thumbnailView setFrame:layoutFrame];
+        [_thumbnailView setAutoresizingMask:UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight];
+    }
+}
+
+#pragma mark ASVThumbnailViewDelegate
+
+- (void)thumbnailView:(ASVThumbnailView *)thumbnailView wantsToPresentPreviewController:(QLPreviewController *)previewController forItem:(QLItem *)item
+{
+    RefPtr<WebKit::WebPageProxy> page = _webView->_page;
+    UIViewController *presentingViewController = page->uiClient().presentingViewController();
+    [presentingViewController presentViewController:previewController animated:YES completion:nil];
+}
+
+#pragma mark WKWebViewContentProvider protocol
+
+- (UIView *)web_contentView
+{
+    return self;
 }
 
 - (void)web_setMinimumSize:(CGSize)size
@@ -107,6 +149,7 @@ SOFT_LINK_CLASS(QuickLook, QLPreviewController);
 
 - (void)web_computedContentInsetDidChange
 {
+    [self _layoutThumbnailView];
 }
 
 - (void)web_setFixedOverlayView:(UIView *)fixedOverlayView
@@ -117,11 +160,6 @@ SOFT_LINK_CLASS(QuickLook, QLPreviewController);
 {
 }
 
-- (UIView *)web_contentView
-{
-    return self;
-}
-
 #pragma mark Find-in-Page
 
 - (void)web_countStringMatches:(NSString *)string options:(_WKFindOptions)options maxCount:(NSUInteger)maxCount
@@ -140,18 +178,6 @@ SOFT_LINK_CLASS(QuickLook, QLPreviewController);
 {
 }
 
-#pragma mark QLPreviewControllerDataSource
-
-- (NSInteger)numberOfPreviewItemsInPreviewController:(QLPreviewController *)controller
-{
-    return 1;
-}
-
-- (id<QLPreviewItem>)previewController:(QLPreviewController *)controller previewItemAtIndex:(NSInteger)index
-{
-    return static_cast<id<QLPreviewItem>>(_item.get());
-}
-
 #pragma mark QLPreviewItemDataProvider
 
 - (NSData *)provideDataForItem:(QLItem *)item
@@ -159,14 +185,6 @@ SOFT_LINK_CLASS(QuickLook, QLPreviewController);
     return _data.get();
 }
 
-#pragma mark QLPreviewControllerDelegate
-
-- (void)previewControllerWillDismiss:(QLPreviewController *)controller
-{
-    RefPtr<WebKit::WebPageProxy> page = _webView->_page;
-    page->goBack();
-}
-
 @end
 
 #endif