Changeset 232090 in webkit


Ignore:
Timestamp:
May 22, 2018 4:56:01 PM (6 years ago)
Author:
dino@apple.com
Message:

Optimized path zoom animation needs a valid UIImage and CGRect
https://bugs.webkit.org/show_bug.cgi?id=185883
<rdar://problem/40306056>

Reviewed by Jon Lee.

Source/WebCore:

Pass the bounding box of the element that was clicked onto
the UI process, so it can perform an animation from that spot.

This involved adding an IntRect to the ResourceRequest, and passing
that info into it from the HTMLAnchorElement, using a new struct
called SystemPreviewInfo.

  • html/HTMLAnchorElement.cpp:

(WebCore::HTMLAnchorElement::handleClick):

  • loader/FrameLoadRequest.cpp:

(WebCore::FrameLoadRequest::FrameLoadRequest):

  • loader/FrameLoadRequest.h:

(WebCore::FrameLoadRequest::FrameLoadRequest):
(WebCore::FrameLoadRequest::isSystemPreview const):
(WebCore::FrameLoadRequest::systemPreviewRect const):

  • loader/FrameLoader.cpp:

(WebCore::FrameLoader::urlSelected):
(WebCore::FrameLoader::loadURL):

  • loader/FrameLoader.h:

(WebCore::FrameLoader::urlSelected):

  • loader/FrameLoaderTypes.h:
  • platform/network/ResourceRequestBase.cpp:

(WebCore::ResourceRequestBase::systemPreviewRect const):
(WebCore::ResourceRequestBase::setSystemPreviewRect):

  • platform/network/ResourceRequestBase.h:

Source/WebKit:

Take the rectangle that was passed into the ResourceRequest and
use it for the origin of an animation into QuickLook.

  • Shared/WebCoreArgumentCoders.cpp:

(IPC::ArgumentCoder<ResourceRequest>::encode):
(IPC::ArgumentCoder<ResourceRequest>::decode):

  • UIProcess/Cocoa/DownloadClient.mm:

(WebKit::DownloadClient::didStart):

  • UIProcess/Cocoa/SystemPreviewControllerCocoa.mm:

(-[_WKPreviewControllerDelegate initWithSystemPreviewController:fromRect:]):
(-[_WKPreviewControllerDelegate presentingViewController]):
(-[_WKPreviewControllerDelegate previewController:frameForPreviewItem:inSourceView:]):
(-[_WKPreviewControllerDelegate previewController:transitionImageForPreviewItem:contentRect:]):
(WebKit::SystemPreviewController::start):
(-[_WKPreviewControllerDelegate initWithSystemPreviewController:]): Deleted.

  • UIProcess/Downloads/DownloadProxy.h:

(WebKit::DownloadProxy::systemPreviewDownloadRect const):

  • UIProcess/SystemPreviewController.h:
  • UIProcess/WebPageProxy.cpp:

(WebKit::WebPageProxy::syncRootViewToScreen):

  • UIProcess/WebPageProxy.h:
Location:
trunk/Source
Files:
17 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r232088 r232090  
     12018-05-22  Dean Jackson  <dino@apple.com>
     2
     3        Optimized path zoom animation needs a valid UIImage and CGRect
     4        https://bugs.webkit.org/show_bug.cgi?id=185883
     5        <rdar://problem/40306056>
     6
     7        Reviewed by Jon Lee.
     8
     9        Pass the bounding box of the element that was clicked onto
     10        the UI process, so it can perform an animation from that spot.
     11
     12        This involved adding an IntRect to the ResourceRequest, and passing
     13        that info into it from the HTMLAnchorElement, using a new struct
     14        called SystemPreviewInfo.
     15
     16        * html/HTMLAnchorElement.cpp:
     17        (WebCore::HTMLAnchorElement::handleClick):
     18        * loader/FrameLoadRequest.cpp:
     19        (WebCore::FrameLoadRequest::FrameLoadRequest):
     20        * loader/FrameLoadRequest.h:
     21        (WebCore::FrameLoadRequest::FrameLoadRequest):
     22        (WebCore::FrameLoadRequest::isSystemPreview const):
     23        (WebCore::FrameLoadRequest::systemPreviewRect const):
     24        * loader/FrameLoader.cpp:
     25        (WebCore::FrameLoader::urlSelected):
     26        (WebCore::FrameLoader::loadURL):
     27        * loader/FrameLoader.h:
     28        (WebCore::FrameLoader::urlSelected):
     29        * loader/FrameLoaderTypes.h:
     30        * platform/network/ResourceRequestBase.cpp:
     31        (WebCore::ResourceRequestBase::systemPreviewRect const):
     32        (WebCore::ResourceRequestBase::setSystemPreviewRect):
     33        * platform/network/ResourceRequestBase.h:
     34
    1352018-05-22  Chris Dumez  <cdumez@apple.com>
    236
  • trunk/Source/WebCore/html/HTMLAnchorElement.cpp

    r231795 r232090  
    418418#endif
    419419
    420     bool isSystemPreview = false;
     420    SystemPreviewInfo systemPreviewInfo;
    421421#if USE(SYSTEM_PREVIEW)
    422     isSystemPreview = isSystemPreviewLink();
     422    systemPreviewInfo.isSystemPreview = isSystemPreviewLink();
     423
     424    if (systemPreviewInfo.isSystemPreview) {
     425        if (auto* child = firstElementChild())
     426            systemPreviewInfo.systemPreviewRect = child->boundsInRootViewSpace();
     427    }
    423428#endif
    424429
    425430    ShouldSendReferrer shouldSendReferrer = hasRel(Relation::NoReferrer) ? NeverSendReferrer : MaybeSendReferrer;
    426431    auto newFrameOpenerPolicy = hasRel(Relation::NoOpener) ? std::make_optional(NewFrameOpenerPolicy::Suppress) : std::nullopt;
    427     frame->loader().urlSelected(completedURL, target(), &event, LockHistory::No, LockBackForwardList::No, shouldSendReferrer, document().shouldOpenExternalURLsPolicyToPropagate(), newFrameOpenerPolicy, downloadAttribute, isSystemPreview);
     432    frame->loader().urlSelected(completedURL, target(), &event, LockHistory::No, LockBackForwardList::No, shouldSendReferrer, document().shouldOpenExternalURLsPolicyToPropagate(), newFrameOpenerPolicy, downloadAttribute, systemPreviewInfo);
    428433
    429434    sendPings(completedURL);
  • trunk/Source/WebCore/loader/FrameLoadRequest.cpp

    r231507 r232090  
    3838namespace WebCore {
    3939
    40 FrameLoadRequest::FrameLoadRequest(Document& requester, SecurityOrigin& requesterSecurityOrigin, const ResourceRequest& resourceRequest, const String& frameName, LockHistory lockHistory, LockBackForwardList lockBackForwardList, ShouldSendReferrer shouldSendReferrer, AllowNavigationToInvalidURL allowNavigationToInvalidURL, NewFrameOpenerPolicy newFrameOpenerPolicy, ShouldOpenExternalURLsPolicy shouldOpenExternalURLsPolicy, InitiatedByMainFrame initiatedByMainFrame, ShouldReplaceDocumentIfJavaScriptURL shouldReplaceDocumentIfJavaScriptURL, const AtomicString& downloadAttribute, bool isSystemPreview)
     40FrameLoadRequest::FrameLoadRequest(Document& requester, SecurityOrigin& requesterSecurityOrigin, const ResourceRequest& resourceRequest, const String& frameName, LockHistory lockHistory, LockBackForwardList lockBackForwardList, ShouldSendReferrer shouldSendReferrer, AllowNavigationToInvalidURL allowNavigationToInvalidURL, NewFrameOpenerPolicy newFrameOpenerPolicy, ShouldOpenExternalURLsPolicy shouldOpenExternalURLsPolicy, InitiatedByMainFrame initiatedByMainFrame, ShouldReplaceDocumentIfJavaScriptURL shouldReplaceDocumentIfJavaScriptURL, const AtomicString& downloadAttribute, const SystemPreviewInfo& systemPreviewInfo)
    4141    : m_requester { makeRef(requester) }
    4242    , m_requesterSecurityOrigin { makeRef(requesterSecurityOrigin) }
     
    5252    , m_downloadAttribute { downloadAttribute }
    5353    , m_initiatedByMainFrame { initiatedByMainFrame }
    54     , m_isSystemPreview { isSystemPreview }
     54    , m_systemPreviewInfo { systemPreviewInfo }
    5555{
    5656}
  • trunk/Source/WebCore/loader/FrameLoadRequest.h

    r231507 r232090  
    3939class FrameLoadRequest {
    4040public:
    41     WEBCORE_EXPORT FrameLoadRequest(Document&, SecurityOrigin&, const ResourceRequest&, const String& frameName, LockHistory, LockBackForwardList, ShouldSendReferrer, AllowNavigationToInvalidURL, NewFrameOpenerPolicy, ShouldOpenExternalURLsPolicy, InitiatedByMainFrame, ShouldReplaceDocumentIfJavaScriptURL = ReplaceDocumentIfJavaScriptURL, const AtomicString& downloadAttribute = { }, bool isSystemPreview = false);
     41    WEBCORE_EXPORT FrameLoadRequest(Document&, SecurityOrigin&, const ResourceRequest&, const String& frameName, LockHistory, LockBackForwardList, ShouldSendReferrer, AllowNavigationToInvalidURL, NewFrameOpenerPolicy, ShouldOpenExternalURLsPolicy, InitiatedByMainFrame, ShouldReplaceDocumentIfJavaScriptURL = ReplaceDocumentIfJavaScriptURL, const AtomicString& downloadAttribute = { }, const SystemPreviewInfo& = { });
    4242    WEBCORE_EXPORT FrameLoadRequest(Frame&, const ResourceRequest&, ShouldOpenExternalURLsPolicy, const SubstituteData& = SubstituteData());
    4343
     
    8888    bool isCrossOriginWindowOpenNavigation() const { return m_isCrossOriginWindowOpenNavigation; }
    8989
    90     bool isSystemPreview() const { return m_isSystemPreview; }
     90    bool isSystemPreview() const { return m_systemPreviewInfo.isSystemPreview; }
     91    const IntRect& systemPreviewRect() const { return m_systemPreviewInfo.systemPreviewRect; }
    9192
    9293private:
     
    110111    bool m_isCrossOriginWindowOpenNavigation { false };
    111112    bool m_isSystemPreview { false };
     113    SystemPreviewInfo m_systemPreviewInfo;
    112114};
    113115
  • trunk/Source/WebCore/loader/FrameLoader.cpp

    r232081 r232090  
    371371}
    372372
    373 void FrameLoader::urlSelected(const URL& url, const String& passedTarget, Event* triggeringEvent, LockHistory lockHistory, LockBackForwardList lockBackForwardList, ShouldSendReferrer shouldSendReferrer, ShouldOpenExternalURLsPolicy shouldOpenExternalURLsPolicy, std::optional<NewFrameOpenerPolicy> openerPolicy, const AtomicString& downloadAttribute, bool isSystemPreview)
     373void FrameLoader::urlSelected(const URL& url, const String& passedTarget, Event* triggeringEvent, LockHistory lockHistory, LockBackForwardList lockBackForwardList, ShouldSendReferrer shouldSendReferrer, ShouldOpenExternalURLsPolicy shouldOpenExternalURLsPolicy, std::optional<NewFrameOpenerPolicy> openerPolicy, const AtomicString& downloadAttribute, const SystemPreviewInfo& systemPreviewInfo)
    374374{
    375375    auto* frame = lexicalFrameFromCommonVM();
     
    377377
    378378    NewFrameOpenerPolicy newFrameOpenerPolicy = openerPolicy.value_or(shouldSendReferrer == NeverSendReferrer ? NewFrameOpenerPolicy::Suppress : NewFrameOpenerPolicy::Allow);
    379     urlSelected(FrameLoadRequest(*m_frame.document(), m_frame.document()->securityOrigin(), { url }, passedTarget, lockHistory, lockBackForwardList, shouldSendReferrer, AllowNavigationToInvalidURL::Yes, newFrameOpenerPolicy, shouldOpenExternalURLsPolicy, initiatedByMainFrame, DoNotReplaceDocumentIfJavaScriptURL, downloadAttribute, isSystemPreview), triggeringEvent);
     379    urlSelected(FrameLoadRequest(*m_frame.document(), m_frame.document()->securityOrigin(), { url }, passedTarget, lockHistory, lockBackForwardList, shouldSendReferrer, AllowNavigationToInvalidURL::Yes, newFrameOpenerPolicy, shouldOpenExternalURLsPolicy, initiatedByMainFrame, DoNotReplaceDocumentIfJavaScriptURL, downloadAttribute, systemPreviewInfo), triggeringEvent);
    380380}
    381381
     
    13671367    // Must grab this now, since this load may stop the previous load and clear this flag.
    13681368    bool isRedirect = m_quickRedirectComing;
    1369     request.setSystemPreview(frameLoadRequest.isSystemPreview());
     1369#if USE(SYSTEM_PREVIEW)
     1370    bool isSystemPreview = frameLoadRequest.isSystemPreview();
     1371    request.setSystemPreview(isSystemPreview);
     1372    if (isSystemPreview)
     1373        request.setSystemPreviewRect(frameLoadRequest.systemPreviewRect());
     1374#endif
    13701375    loadWithNavigationAction(request, action, lockHistory, newLoadType, formState, allowNavigationToInvalidURL, [this, isRedirect, sameURL, newLoadType, protectedFrame = makeRef(m_frame), completionHandler = completionHandlerCaller.release()] {
    13711376        if (isRedirect) {
  • trunk/Source/WebCore/loader/FrameLoader.h

    r231507 r232090  
    122122
    123123    void changeLocation(FrameLoadRequest&&);
    124     WEBCORE_EXPORT void urlSelected(const URL&, const String& target, Event*, LockHistory, LockBackForwardList, ShouldSendReferrer, ShouldOpenExternalURLsPolicy, std::optional<NewFrameOpenerPolicy> = std::nullopt, const AtomicString& downloadAttribute = nullAtom(), bool isSystemPreview = false);
     124    WEBCORE_EXPORT void urlSelected(const URL&, const String& target, Event*, LockHistory, LockBackForwardList, ShouldSendReferrer, ShouldOpenExternalURLsPolicy, std::optional<NewFrameOpenerPolicy> = std::nullopt, const AtomicString& downloadAttribute = nullAtom(), const SystemPreviewInfo& = { });
    125125    void submitForm(Ref<FormSubmission>&&);
    126126
  • trunk/Source/WebCore/loader/FrameLoaderTypes.h

    r229926 r232090  
    2828
    2929#pragma once
     30
     31#include "IntRect.h"
    3032
    3133namespace WebCore {
     
    148150};
    149151
     152
     153struct SystemPreviewInfo {
     154    IntRect systemPreviewRect;
     155    bool isSystemPreview { false };
     156};
     157
    150158} // namespace WebCore
    151159
  • trunk/Source/WebCore/platform/network/ResourceRequestBase.cpp

    r231507 r232090  
    577577}
    578578
     579#if USE(SYSTEM_PREVIEW)
    579580bool ResourceRequestBase::isSystemPreview() const
    580581{
     
    586587    m_isSystemPreview = s;
    587588}
     589
     590const IntRect& ResourceRequestBase::systemPreviewRect() const
     591{
     592    return m_systemPreviewRect;
     593}
     594
     595void ResourceRequestBase::setSystemPreviewRect(const IntRect& rect)
     596{
     597    m_systemPreviewRect = rect;
     598}
     599#endif
    588600
    589601bool equalIgnoringHeaderFields(const ResourceRequestBase& a, const ResourceRequestBase& b)
  • trunk/Source/WebCore/platform/network/ResourceRequestBase.h

    r232032 r232090  
    3131#include "FormData.h"
    3232#include "HTTPHeaderMap.h"
     33#include "IntRect.h"
    3334#include "URL.h"
    3435#include "ResourceLoadPriority.h"
     
    172173    void setInitiatorIdentifier(const String& identifier) { m_initiatorIdentifier = identifier; }
    173174
     175#if USE(SYSTEM_PREVIEW)
    174176    WEBCORE_EXPORT bool isSystemPreview() const;
    175177    WEBCORE_EXPORT void setSystemPreview(bool);
     178
     179    WEBCORE_EXPORT const IntRect& systemPreviewRect() const;
     180    WEBCORE_EXPORT void setSystemPreviewRect(const IntRect&);
     181#endif
    176182
    177183#if !PLATFORM(COCOA)
     
    234240    String m_initiatorIdentifier;
    235241    String m_cachePartition { emptyString() };
     242#if USE(SYSTEM_PREVIEW)
    236243    bool m_isSystemPreview { false };
     244    IntRect m_systemPreviewRect;
     245#endif
    237246
    238247private:
  • trunk/Source/WebKit/ChangeLog

    r232083 r232090  
     12018-05-22  Dean Jackson  <dino@apple.com>
     2
     3        Optimized path zoom animation needs a valid UIImage and CGRect
     4        https://bugs.webkit.org/show_bug.cgi?id=185883
     5        <rdar://problem/40306056>
     6
     7        Reviewed by Jon Lee.
     8
     9        Take the rectangle that was passed into the ResourceRequest and
     10        use it for the origin of an animation into QuickLook.
     11
     12        * Shared/WebCoreArgumentCoders.cpp:
     13        (IPC::ArgumentCoder<ResourceRequest>::encode):
     14        (IPC::ArgumentCoder<ResourceRequest>::decode):
     15        * UIProcess/Cocoa/DownloadClient.mm:
     16        (WebKit::DownloadClient::didStart):
     17        * UIProcess/Cocoa/SystemPreviewControllerCocoa.mm:
     18        (-[_WKPreviewControllerDelegate initWithSystemPreviewController:fromRect:]):
     19        (-[_WKPreviewControllerDelegate presentingViewController]):
     20        (-[_WKPreviewControllerDelegate previewController:frameForPreviewItem:inSourceView:]):
     21        (-[_WKPreviewControllerDelegate previewController:transitionImageForPreviewItem:contentRect:]):
     22        (WebKit::SystemPreviewController::start):
     23        (-[_WKPreviewControllerDelegate initWithSystemPreviewController:]): Deleted.
     24        * UIProcess/Downloads/DownloadProxy.h:
     25        (WebKit::DownloadProxy::systemPreviewDownloadRect const):
     26        * UIProcess/SystemPreviewController.h:
     27        * UIProcess/WebPageProxy.cpp:
     28        (WebKit::WebPageProxy::syncRootViewToScreen):
     29        * UIProcess/WebPageProxy.h:
     30
    1312018-05-22  Sihui Liu  <sihui_liu@apple.com>
    232
  • trunk/Source/WebKit/Shared/WebCoreArgumentCoders.cpp

    r231507 r232090  
    12381238    encoder << resourceRequest.cachePartition();
    12391239    encoder << resourceRequest.hiddenFromInspector();
    1240     encoder << resourceRequest.isSystemPreview();
     1240
     1241#if USE(SYSTEM_PREVIEW)
     1242    if (resourceRequest.isSystemPreview()) {
     1243        encoder << true;
     1244        encoder << resourceRequest.systemPreviewRect();
     1245    } else
     1246        encoder << false;
     1247#endif
    12411248
    12421249    if (resourceRequest.encodingRequiresPlatformData()) {
     
    12611268    resourceRequest.setHiddenFromInspector(isHiddenFromInspector);
    12621269
     1270#if USE(SYSTEM_PREVIEW)
    12631271    bool isSystemPreview;
    12641272    if (!decoder.decode(isSystemPreview))
    12651273        return false;
    12661274    resourceRequest.setSystemPreview(isSystemPreview);
     1275
     1276    if (isSystemPreview) {
     1277        IntRect systemPreviewRect;
     1278        if (!decoder.decode(systemPreviewRect))
     1279            return false;
     1280        resourceRequest.setSystemPreviewRect(systemPreviewRect);
     1281    }
     1282#endif
    12671283
    12681284    bool hasPlatformData;
  • trunk/Source/WebKit/UIProcess/Cocoa/DownloadClient.mm

    r231825 r232090  
    7979        if (auto* webPage = downloadProxy.originatingPage()) {
    8080            // FIXME: Update the MIME-type once it is known in the ResourceResponse.
    81             webPage->systemPreviewController()->start(ASCIILiteral { "application/octet-stream" });
     81            webPage->systemPreviewController()->start(ASCIILiteral { "application/octet-stream" }, downloadProxy.systemPreviewDownloadRect());
    8282        }
    8383        takeActivityToken(downloadProxy);
  • trunk/Source/WebKit/UIProcess/Cocoa/SystemPreviewControllerCocoa.mm

    r232082 r232090  
    112112@interface _WKPreviewControllerDelegate : NSObject <QLPreviewControllerDelegate> {
    113113    WebKit::SystemPreviewController* _previewController;
     114    WebCore::IntRect _linkRect;
    114115};
    115116@end
     
    117118@implementation _WKPreviewControllerDelegate
    118119
    119 - (id)initWithSystemPreviewController:(WebKit::SystemPreviewController*)previewController
     120- (id)initWithSystemPreviewController:(WebKit::SystemPreviewController*)previewController fromRect:(WebCore::IntRect)rect
    120121{
    121122    if (!(self = [super init]))
     
    123124
    124125    _previewController = previewController;
     126    _linkRect = rect;
    125127    return self;
    126128}
     
    132134}
    133135
     136- (UIViewController *)presentingViewController
     137{
     138    if (!_previewController)
     139        return nil;
     140
     141    return _previewController->page().uiClient().presentingViewController();
     142}
     143
    134144- (CGRect)previewController:(QLPreviewController *)controller frameForPreviewItem:(id <QLPreviewItem>)item inSourceView:(UIView * *)view
    135145{
    136     if (!_previewController)
    137         return CGRectZero;
    138 
    139     UIViewController *presentingViewController = _previewController->page().uiClient().presentingViewController();
     146    UIViewController *presentingViewController = [self presentingViewController];
    140147
    141148    if (!presentingViewController)
     
    143150
    144151    *view = presentingViewController.view;
    145     CGRect frame = presentingViewController.view.frame;
    146     // Create a smaller rectangle centered in the frame.
    147     CGFloat halfWidth = frame.size.width / 2;
    148     CGFloat halfHeight = frame.size.height / 2;
    149     frame = CGRectMake(CGRectGetMidX(frame) - halfWidth / 2, CGRectGetMidY(frame) - halfHeight / 2, halfWidth, halfHeight);
    150     return frame;
     152
     153    if (_linkRect.isEmpty()) {
     154        CGRect frame;
     155        frame.size.width = presentingViewController.view.frame.size.width / 2.0;
     156        frame.size.height = presentingViewController.view.frame.size.height / 2.0;
     157        frame.origin.x = (presentingViewController.view.frame.size.width - frame.size.width) / 2.0;
     158        frame.origin.y = (presentingViewController.view.frame.size.height - frame.size.height) / 2.0;
     159        return frame;
     160    }
     161
     162    return _previewController->page().syncRootViewToScreen(_linkRect);
    151163}
    152164
    153165- (UIImage *)previewController:(QLPreviewController *)controller transitionImageForPreviewItem:(id <QLPreviewItem>)item contentRect:(CGRect *)contentRect
    154166{
    155     return nil;
     167    *contentRect = CGRectZero;
     168
     169    UIViewController *presentingViewController = [self presentingViewController];
     170    if (presentingViewController) {
     171        if (_linkRect.isEmpty())
     172            *contentRect = {CGPointZero, {presentingViewController.view.frame.size.width / 2.0, presentingViewController.view.frame.size.height / 2.0}};
     173        else {
     174            WebCore::IntRect screenRect = _previewController->page().syncRootViewToScreen(_linkRect);
     175            *contentRect = { CGPointZero, { static_cast<CGFloat>(screenRect.width()), static_cast<CGFloat>(screenRect.height()) } };
     176        }
     177    }
     178
     179    return [UIImage new];
    156180}
    157181
     
    160184namespace WebKit {
    161185
    162 void SystemPreviewController::start(const String& mimeType)
     186void SystemPreviewController::start(const String& mimeType, const WebCore::IntRect& fromRect)
    163187{
    164188    ASSERT(!m_qlPreviewController);
     
    173197    m_qlPreviewController = adoptNS([allocQLPreviewControllerInstance() init]);
    174198
    175     m_qlPreviewControllerDelegate = adoptNS([[_WKPreviewControllerDelegate alloc] initWithSystemPreviewController:this]);
     199    m_qlPreviewControllerDelegate = adoptNS([[_WKPreviewControllerDelegate alloc] initWithSystemPreviewController:this fromRect:fromRect]);
    176200    [m_qlPreviewController setDelegate:m_qlPreviewControllerDelegate.get()];
    177201
  • trunk/Source/WebKit/UIProcess/Downloads/DownloadProxy.h

    r231795 r232090  
    4242namespace WebCore {
    4343class AuthenticationChallenge;
     44class IntRect;
    4445class ProtectionSpace;
    4546class ResourceError;
     
    9293#if USE(SYSTEM_PREVIEW)
    9394    bool isSystemPreviewDownload() const { return request().isSystemPreview(); }
     95    const WebCore::IntRect& systemPreviewDownloadRect() const { return request().systemPreviewRect(); }
    9496#endif
    9597
  • trunk/Source/WebKit/UIProcess/SystemPreviewController.h

    r231797 r232090  
    2828#if USE(SYSTEM_PREVIEW)
    2929
     30#include <WebCore/IntRect.h>
    3031#include <WebCore/URL.h>
    3132#include <wtf/RetainPtr.h>
     
    4748    bool canPreview(const String& mimeType) const;
    4849
    49     void start(const String& mimeType);
     50    void start(const String& mimeType, const WebCore::IntRect&);
    5051    void updateProgress(float);
    5152    void finish(WebCore::URL);
  • trunk/Source/WebKit/UIProcess/WebPageProxy.cpp

    r231931 r232090  
    39953995    uint64_t newNavigationID = navigation->navigationID();
    39963996    navigation->setWasUserInitiated(!!navigationActionData.userGestureTokenIdentifier);
     3997#if USE(SYSTEM_PREVIEW)
    39973998    navigation->setShouldForceDownload(!navigationActionData.downloadAttribute.isNull() || request.isSystemPreview());
     3999#else
     4000    navigation->setShouldForceDownload(!navigationActionData.downloadAttribute.isNull());
     4001#endif
    39984002    navigation->setCurrentRequest(ResourceRequest(request), m_process->coreProcessIdentifier());
    39994003    navigation->setCurrentRequestIsRedirect(navigationActionData.isRedirect);
     
    44514455    reply(m_pageClient.rootViewToScreen(viewRect));
    44524456}
    4453    
     4457
     4458IntRect WebPageProxy::syncRootViewToScreen(const IntRect& viewRect)
     4459{
     4460    return m_pageClient.rootViewToScreen(viewRect);
     4461}
     4462
    44544463#if PLATFORM(IOS)
    44554464void WebPageProxy::accessibilityScreenToRootView(const IntPoint& screenPoint, IntPoint& windowPoint)
  • trunk/Source/WebKit/UIProcess/WebPageProxy.h

    r231931 r232090  
    13121312    void setDefersLoadingForTesting(bool);
    13131313
     1314    WebCore::IntRect syncRootViewToScreen(const WebCore::IntRect& viewRect);
     1315
    13141316private:
    13151317    WebPageProxy(PageClient&, WebProcessProxy&, uint64_t pageID, Ref<API::PageConfiguration>&&);
Note: See TracChangeset for help on using the changeset viewer.