[iOS] did{Start,Finish}LoadForQuickLookDocumentInMainFrame is never called on WKNavig...
[WebKit-https.git] / Source / WebKit2 / UIProcess / ios / WebPageProxyIOS.mm
index 2725606edd2c48bf0ef0846bbe8e24c4345d9d0e..e9e12a06339c4c0959e22eca2762d3588639aa50 100644 (file)
@@ -51,6 +51,7 @@
 
 #if USE(QUICK_LOOK)
 #import "APILoaderClient.h"
+#import "APINavigationClient.h"
 #import <wtf/text/WTFString.h>
 #endif
 
@@ -951,12 +952,18 @@ void WebPageProxy::didStartLoadForQuickLookDocumentInMainFrame(const String& fil
 {
     // Ensure that fileName isn't really a path name
     static_assert(notFound + 1 == 0, "The following line assumes WTF::notFound equals -1");
-    m_loaderClient->didStartLoadForQuickLookDocumentInMainFrame(fileName.substring(fileName.reverseFind('/') + 1), uti);
+    if (m_navigationClient)
+        m_navigationClient->didStartLoadForQuickLookDocumentInMainFrame(fileName.substring(fileName.reverseFind('/') + 1), uti);
+    else
+        m_loaderClient->didStartLoadForQuickLookDocumentInMainFrame(fileName.substring(fileName.reverseFind('/') + 1), uti);
 }
 
 void WebPageProxy::didFinishLoadForQuickLookDocumentInMainFrame(const QuickLookDocumentData& data)
 {
-    m_loaderClient->didFinishLoadForQuickLookDocumentInMainFrame(data);
+    if (m_navigationClient)
+        m_navigationClient->didFinishLoadForQuickLookDocumentInMainFrame(data);
+    else
+        m_loaderClient->didFinishLoadForQuickLookDocumentInMainFrame(data);
 }
 #endif