WebKit Bugzilla
Attachment 339837 Details for
Bug 185397
: Use thumbnails in System Previews
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-185397-20180508110846.patch (text/plain), 18.82 KB, created by
Dean Jackson
on 2018-05-08 11:08:47 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Dean Jackson
Created:
2018-05-08 11:08:47 PDT
Size:
18.82 KB
patch
obsolete
>Subversion Revision: 231399 >diff --git a/Source/WTF/ChangeLog b/Source/WTF/ChangeLog >index b2bea75c04d9732b15e5a64daf9d3a7cd65c2d11..62af7e070e9ea472126db05acf167959d927d3d7 100644 >--- a/Source/WTF/ChangeLog >+++ b/Source/WTF/ChangeLog >@@ -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 NOBODY (OOPS!). >+ >+ SYSTEM_PREVIEW is only available on some platforms. >+ >+ * wtf/Platform.h: >+ > 2018-05-04 Tim Horton <timothy_horton@apple.com> > > Shift to a lower-level framework for simplifying URLs >diff --git a/Source/WebCore/PAL/ChangeLog b/Source/WebCore/PAL/ChangeLog >index 351a72f957b760550a1b9ea6deee3ff27bc9a4f8..151cbd50f6121d810ba79cb4849017fc7769c147 100644 >--- a/Source/WebCore/PAL/ChangeLog >+++ b/Source/WebCore/PAL/ChangeLog >@@ -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 NOBODY (OOPS!). >+ >+ * 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 >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 12f0f573f4ddacdd86cee54c79a3674ecb095aed..b3b5308792bd7864d04676b6187575a0bb76ca11 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -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 NOBODY (OOPS!). >+ >+ 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-07 Dean Jackson <dino@apple.com> > > Use a dark gray for system preview bbackground >diff --git a/Source/WTF/wtf/Platform.h b/Source/WTF/wtf/Platform.h >index 52279ffda39563981c3f3167ee2b0c18a0989bfb..1cebefbd383894772f78fa7a303af531311fe896 100644 >--- a/Source/WTF/wtf/Platform.h >+++ b/Source/WTF/wtf/Platform.h >@@ -1037,7 +1037,7 @@ > #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 > >diff --git a/Source/WebCore/PAL/PAL.xcodeproj/project.pbxproj b/Source/WebCore/PAL/PAL.xcodeproj/project.pbxproj >index 94849ceaf2bfd383dac976bac5390aaceec0325b..6f9e744a4a9c233fdd1f81c155b3f3b52831110d 100644 >--- a/Source/WebCore/PAL/PAL.xcodeproj/project.pbxproj >+++ b/Source/WebCore/PAL/PAL.xcodeproj/project.pbxproj >@@ -107,6 +107,7 @@ > 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 */; }; >@@ -253,6 +254,7 @@ > 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>"; }; >@@ -402,6 +404,7 @@ > 0C5AF9151F43A4C7002EAC02 /* OpenGLESSPI.h */, > 0C5AF9161F43A4C7002EAC02 /* QuickLookSPI.h */, > 0C5AF9171F43A4C7002EAC02 /* SQLite3SPI.h */, >+ 31308B1320A21705003FB929 /* SystemPreviewSPI.h */, > 0C5AF9181F43A4C7002EAC02 /* UIKitSPI.h */, > ); > path = ios; >@@ -705,6 +708,7 @@ > 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 >index 0000000000000000000000000000000000000000..888451a581bdb3039bce5fc66d8927dedc4b52cd >--- /dev/null >+++ b/Source/WebCore/PAL/pal/spi/ios/SystemPreviewSPI.h >@@ -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 >+ >diff --git a/Source/WebKit/Configurations/WebKit.xcconfig b/Source/WebKit/Configurations/WebKit.xcconfig >index 871f04717136826d496d181f3ecf96c8fb5c1396..bfcb4258bbc6694043890059ee51afb42a74af9e 100644 >--- a/Source/WebKit/Configurations/WebKit.xcconfig >+++ b/Source/WebKit/Configurations/WebKit.xcconfig >@@ -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; >diff --git a/Source/WebKit/UIProcess/ios/WKSystemPreviewView.h b/Source/WebKit/UIProcess/ios/WKSystemPreviewView.h >index f02ce5798100af4b408c5d47cab3896bf28fd5e8..69025287d805ba00a909a6ca8d203334bee2a320 100644 >--- a/Source/WebKit/UIProcess/ios/WKSystemPreviewView.h >+++ b/Source/WebKit/UIProcess/ios/WKSystemPreviewView.h >@@ -23,14 +23,14 @@ > * 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 > >diff --git a/Source/WebKit/UIProcess/ios/WKSystemPreviewView.mm b/Source/WebKit/UIProcess/ios/WKSystemPreviewView.mm >index 34da80cf34e5eaf79a62ab3b92a0a57eb60d8579..b279ea46aa6ec497c205796e88c0ee4f303e17fd 100644 >--- a/Source/WebKit/UIProcess/ios/WKSystemPreviewView.mm >+++ b/Source/WebKit/UIProcess/ios/WKSystemPreviewView.mm >@@ -35,24 +35,30 @@ > #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
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
jonlee
:
review+
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 185397
:
339778
| 339837