⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 283320 in webkit


Ignore:
Timestamp:
Sep 30, 2021, 10:48:19 AM (5 years ago)
Author:
commit-queue@webkit.org
Message:

Adopt presentationSceneIdentifierForPaymentAuthorizationController delegate call from PassKit
https://bugs.webkit.org/show_bug.cgi?id=230874

Patch by Eddy Wong <eddy_wong@apple.com> on 2021-09-30
Reviewed by Devin Rousso.

Source/WebKit:

  • NetworkProcess/NetworkConnectionToWebProcess.h:
  • NetworkProcess/ios/NetworkConnectionToWebProcessIOS.mm:

(WebKit::NetworkConnectionToWebProcess::getWindowSceneIdentifierForPaymentPresentation): Implements getWindowSceneIdentifierForPaymentPresentation() by asking parent process (UIProcess) for scene ID via new XPC message.

  • Platform/cocoa/PaymentAuthorizationPresenter.h:

(WebKit::PaymentAuthorizationPresenter::sceneIdentifier const): Holds temporarily the scene ID we'd like to use when presenting the payment sheet, to be read by WKPaymentAuthorizationControllerDelegate.

  • Platform/cocoa/PaymentAuthorizationViewController.h: Declares presentInScene() which is just for conformance to PaymentAuthorizationPresenter
  • Platform/cocoa/PaymentAuthorizationViewController.mm:

(WebKit::PaymentAuthorizationViewController::presentInScene): Provides a dummy implementation for presentInScene() for conformance.

  • Platform/cocoa/WKPaymentAuthorizationDelegate.h: Surfaces _presenter for PaymentAuthorizationPresenter's use.
  • Platform/cocoa/WKPaymentAuthorizationDelegate.mm: Ditto.
  • Platform/ios/PaymentAuthorizationController.h:
  • Platform/ios/PaymentAuthorizationController.mm:

(-[WKPaymentAuthorizationControllerDelegate presentationSceneIdentifierForPaymentAuthorizationController:]): Implements the new PassKit delegate call returning the scene ID for the UIProcess.
(WebKit::PaymentAuthorizationController::dismiss): House keeping.
(WebKit::PaymentAuthorizationController::presentInScene): Stores the scene ID from the caller for WKPaymentAuthorizationControllerDelegate to read from.

  • Shared/ApplePay/WebPaymentCoordinatorProxy.cpp:

(WebKit::WebPaymentCoordinatorProxy::showPaymentUI): Relays webPageProxyID for use by UIProcess ultimately to look up the correct WebPageProxy.

  • Shared/ApplePay/WebPaymentCoordinatorProxy.h: Ditto.
  • Shared/ApplePay/WebPaymentCoordinatorProxy.messages.in: Ditto.
  • Shared/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm:

(WebKit::WebPaymentCoordinatorProxy::platformShowPaymentUI): Presents payment sheet with scene ID if applicable.

  • Shared/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm:

(WebKit::WebPaymentCoordinatorProxy::platformShowPaymentUI): Signature change.

  • UIProcess/Network/NetworkProcessProxy.cpp:

(WebKit::NetworkProcessProxy::getWindowSceneIdentifierForPaymentPresentation): Looks up the correct WebPageProxy and retrieve the scene ID for the caller (NetworkProcess).

  • UIProcess/Network/NetworkProcessProxy.h: Ditto.
  • UIProcess/Network/NetworkProcessProxy.messages.in: Ditto.
  • UIProcess/PageClient.h: Adds ability to retrieve scene ID.
  • UIProcess/WebPageProxy.h:
  • UIProcess/ios/PageClientImplIOS.h: Ditto.
  • UIProcess/ios/PageClientImplIOS.mm:

(WebKit::PageClientImpl::sceneID): Ditto.

  • UIProcess/ios/WebPageProxyIOS.mm:

(WebKit::WebPageProxy::getWindowSceneIdentifierForPaymentPresentation): Dummy implementation for conformance to WebPageProxy. WebProcess does not talk to UIProcess directly for this function.

  • WebProcess/ApplePay/WebPaymentCoordinator.cpp:

(WebKit::WebPaymentCoordinator::showPaymentUI): Passes the WebPageProxyIdentifier along.

Source/WTF:

  • wtf/PlatformEnableCocoa.h: Defines new flag ENABLE_APPLE_PAY_REMOTE_UI_USES_SCENE
Location:
trunk/Source
Files:
27 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WTF/ChangeLog

    r283317 r283320  
     12021-09-30  Eddy Wong  <eddy_wong@apple.com>
     2
     3        Adopt presentationSceneIdentifierForPaymentAuthorizationController delegate call from PassKit
     4        https://bugs.webkit.org/show_bug.cgi?id=230874
     5
     6        Reviewed by Devin Rousso.
     7
     8        * wtf/PlatformEnableCocoa.h: Defines new flag ENABLE_APPLE_PAY_REMOTE_UI_USES_SCENE
     9
    1102021-09-30  Darin Adler  <darin@apple.com>
    211
  • trunk/Source/WTF/wtf/PlatformEnableCocoa.h

    r282954 r283320  
    8484#endif
    8585
    86 #if !defined(ENABLE_APPLE_PAY_REMOTE_UI) && !PLATFORM(MAC) && !PLATFORM(MACCATALYST) && !PLATFORM(WATCHOS) && !PLATFORM(APPLETV)
     86#if !PLATFORM(MAC) && !PLATFORM(MACCATALYST) && !PLATFORM(WATCHOS) && !PLATFORM(APPLETV)
     87
     88#if !defined(ENABLE_APPLE_PAY_REMOTE_UI)
    8789#define ENABLE_APPLE_PAY_REMOTE_UI 1
    8890#endif
     91
     92#if !defined(ENABLE_APPLE_PAY_REMOTE_UI_USES_SCENE) && HAVE(UIKIT_WEBKIT_INTERNALS)
     93#define ENABLE_APPLE_PAY_REMOTE_UI_USES_SCENE 1
     94#endif
     95
     96#endif // !PLATFORM(MAC) && !PLATFORM(MACCATALYST) && !PLATFORM(WATCHOS) && !PLATFORM(APPLETV)
    8997
    9098#if !defined(ENABLE_APPLE_PAY_SESSION_V11) && ((PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 110300) || (PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 140500))
  • trunk/Source/WebKit/ChangeLog

    r283319 r283320  
     12021-09-30  Eddy Wong  <eddy_wong@apple.com>
     2
     3        Adopt presentationSceneIdentifierForPaymentAuthorizationController delegate call from PassKit
     4        https://bugs.webkit.org/show_bug.cgi?id=230874
     5
     6        Reviewed by Devin Rousso.
     7
     8        * NetworkProcess/NetworkConnectionToWebProcess.h:
     9        * NetworkProcess/ios/NetworkConnectionToWebProcessIOS.mm:         
     10        (WebKit::NetworkConnectionToWebProcess::getWindowSceneIdentifierForPaymentPresentation): Implements getWindowSceneIdentifierForPaymentPresentation() by asking parent process (UIProcess) for scene ID via new XPC message.
     11        * Platform/cocoa/PaymentAuthorizationPresenter.h:
     12        (WebKit::PaymentAuthorizationPresenter::sceneIdentifier const): Holds temporarily the scene ID we'd like to use when presenting the payment sheet, to be read by WKPaymentAuthorizationControllerDelegate.
     13        * Platform/cocoa/PaymentAuthorizationViewController.h: Declares presentInScene() which is just for conformance to PaymentAuthorizationPresenter
     14        * Platform/cocoa/PaymentAuthorizationViewController.mm:
     15        (WebKit::PaymentAuthorizationViewController::presentInScene): Provides a dummy implementation for presentInScene() for conformance.
     16        * Platform/cocoa/WKPaymentAuthorizationDelegate.h: Surfaces _presenter for PaymentAuthorizationPresenter's use.
     17        * Platform/cocoa/WKPaymentAuthorizationDelegate.mm: Ditto.
     18        * Platform/ios/PaymentAuthorizationController.h:
     19        * Platform/ios/PaymentAuthorizationController.mm:
     20        (-[WKPaymentAuthorizationControllerDelegate presentationSceneIdentifierForPaymentAuthorizationController:]): Implements the new PassKit delegate call returning the scene ID for the UIProcess.
     21        (WebKit::PaymentAuthorizationController::dismiss): House keeping.
     22        (WebKit::PaymentAuthorizationController::presentInScene): Stores the scene ID from the caller for WKPaymentAuthorizationControllerDelegate to read from.
     23        * Shared/ApplePay/WebPaymentCoordinatorProxy.cpp:
     24        (WebKit::WebPaymentCoordinatorProxy::showPaymentUI): Relays webPageProxyID for use by UIProcess ultimately to look up the correct WebPageProxy.
     25        * Shared/ApplePay/WebPaymentCoordinatorProxy.h: Ditto.
     26        * Shared/ApplePay/WebPaymentCoordinatorProxy.messages.in: Ditto.
     27        * Shared/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm:
     28        (WebKit::WebPaymentCoordinatorProxy::platformShowPaymentUI): Presents payment sheet with scene ID if applicable.
     29        * Shared/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm:
     30        (WebKit::WebPaymentCoordinatorProxy::platformShowPaymentUI): Signature change.
     31        * UIProcess/Network/NetworkProcessProxy.cpp:
     32        (WebKit::NetworkProcessProxy::getWindowSceneIdentifierForPaymentPresentation): Looks up the correct WebPageProxy and retrieve the scene ID for the caller (NetworkProcess).
     33        * UIProcess/Network/NetworkProcessProxy.h: Ditto.
     34        * UIProcess/Network/NetworkProcessProxy.messages.in: Ditto.
     35        * UIProcess/PageClient.h: Adds ability to retrieve scene ID.
     36        * UIProcess/WebPageProxy.h:
     37        * UIProcess/ios/PageClientImplIOS.h: Ditto.
     38        * UIProcess/ios/PageClientImplIOS.mm:
     39        (WebKit::PageClientImpl::sceneID): Ditto.
     40        * UIProcess/ios/WebPageProxyIOS.mm:
     41        (WebKit::WebPageProxy::getWindowSceneIdentifierForPaymentPresentation): Dummy implementation for conformance to WebPageProxy. WebProcess does not talk to UIProcess directly for this function.
     42        * WebProcess/ApplePay/WebPaymentCoordinator.cpp:
     43        (WebKit::WebPaymentCoordinator::showPaymentUI): Passes the WebPageProxyIdentifier along.
     44
     45
    1462021-09-30  Jer Noble  <jer.noble@apple.com>
    247
  • trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.h

    r282712 r283320  
    356356    IPC::Connection* paymentCoordinatorConnection(const WebPaymentCoordinatorProxy&) final;
    357357    UIViewController *paymentCoordinatorPresentingViewController(const WebPaymentCoordinatorProxy&) final;
     358#if ENABLE(APPLE_PAY_REMOTE_UI_USES_SCENE)
     359    void getWindowSceneIdentifierForPaymentPresentation(WebPageProxyIdentifier, CompletionHandler<void(const String&)>&&) final;
     360#endif
    358361    const String& paymentCoordinatorBoundInterfaceIdentifier(const WebPaymentCoordinatorProxy&) final;
    359362    const String& paymentCoordinatorCTDataConnectionServiceType(const WebPaymentCoordinatorProxy&) final;
  • trunk/Source/WebKit/NetworkProcess/ios/NetworkConnectionToWebProcessIOS.mm

    r261617 r283320  
    2626#import "config.h"
    2727#import "NetworkConnectionToWebProcess.h"
     28#import "NetworkProcessProxyMessages.h"
    2829
    2930#if PLATFORM(IOS_FAMILY)
     
    5253    return nil;
    5354}
     55
     56#if ENABLE(APPLE_PAY_REMOTE_UI_USES_SCENE)
     57void NetworkConnectionToWebProcess::getWindowSceneIdentifierForPaymentPresentation(WebPageProxyIdentifier webPageProxyIdentifier, CompletionHandler<void(const String&)>&& completionHandler)
     58{
     59    networkProcess().parentProcessConnection()->sendWithAsyncReply(Messages::NetworkProcessProxy::GetWindowSceneIdentifierForPaymentPresentation(webPageProxyIdentifier), WTFMove(completionHandler));
     60}
     61#endif
    5462
    5563const String& NetworkConnectionToWebProcess::paymentCoordinatorBoundInterfaceIdentifier(const WebPaymentCoordinatorProxy&)
  • trunk/Source/WebKit/Platform/cocoa/PaymentAuthorizationPresenter.h

    r278630 r283320  
    8686#if PLATFORM(IOS_FAMILY)
    8787    virtual void present(UIViewController *, CompletionHandler<void(bool)>&&) = 0;
     88#if ENABLE(APPLE_PAY_REMOTE_UI_USES_SCENE)
     89    virtual void presentInScene(const String&, CompletionHandler<void(bool)>&&) = 0;
     90    const String& sceneIdentifier() const { return m_sceneIdentifier; }
     91#endif
    8892#endif
    8993
     
    96100    virtual WKPaymentAuthorizationDelegate *platformDelegate() = 0;
    97101
     102#if PLATFORM(IOS_FAMILY) && ENABLE(APPLE_PAY_REMOTE_UI_USES_SCENE)
     103    String m_sceneIdentifier;
     104#endif
     105
    98106private:
    99107    Client& m_client;
  • trunk/Source/WebKit/Platform/cocoa/PaymentAuthorizationViewController.h

    r250579 r283320  
    5050#if PLATFORM(IOS_FAMILY)
    5151    void present(UIViewController *, CompletionHandler<void(bool)>&&) final;
     52#if ENABLE(APPLE_PAY_REMOTE_UI_USES_SCENE)
     53    void presentInScene(const String&, CompletionHandler<void(bool)>&&) final;
     54#endif
    5255#endif
    5356
  • trunk/Source/WebKit/Platform/cocoa/PaymentAuthorizationViewController.mm

    r278630 r283320  
    154154}
    155155
     156#if ENABLE(APPLE_PAY_REMOTE_UI_USES_SCENE)
     157void PaymentAuthorizationViewController::presentInScene(const String&, CompletionHandler<void(bool)>&& completionHandler)
     158{
     159    ASSERT_NOT_REACHED();
     160    completionHandler(false);
     161}
     162#endif
     163
    156164#endif
    157165
  • trunk/Source/WebKit/Platform/cocoa/WKPaymentAuthorizationDelegate.h

    r278630 r283320  
    5252@interface WKPaymentAuthorizationDelegate : NSObject {
    5353    RetainPtr<PKPaymentRequest> _request;
     54    WeakPtr<WebKit::PaymentAuthorizationPresenter> _presenter;
    5455}
    5556
  • trunk/Source/WebKit/Platform/cocoa/WKPaymentAuthorizationDelegate.mm

    r278630 r283320  
    3838    RetainPtr<NSArray<PKShippingMethod *>> _shippingMethods;
    3939    RetainPtr<NSError> _sessionError;
    40     WeakPtr<WebKit::PaymentAuthorizationPresenter> _presenter;
    4140    WebKit::DidAuthorizePaymentCompletion _didAuthorizePaymentCompletion;
    4241    WebKit::DidRequestMerchantSessionCompletion _didRequestMerchantSessionCompletion;
  • trunk/Source/WebKit/Platform/ios/PaymentAuthorizationController.h

    r242748 r283320  
    4747    void dismiss() final;
    4848    void present(UIViewController *, CompletionHandler<void(bool)>&&) final;
     49#if ENABLE(APPLE_PAY_REMOTE_UI_USES_SCENE)
     50    void presentInScene(const String&, CompletionHandler<void(bool)>&&) final;
     51#endif
    4952
    5053    RetainPtr<PKPaymentAuthorizationController> m_controller;
  • trunk/Source/WebKit/Platform/ios/PaymentAuthorizationController.mm

    r278630 r283320  
    106106}
    107107
     108#if ENABLE(APPLE_PAY_REMOTE_UI_USES_SCENE)
     109- (NSString *)presentationSceneIdentifierForPaymentAuthorizationController:(PKPaymentAuthorizationController *)controller
     110{
     111    if (!_presenter)
     112        return nil;
     113    return nsStringNilIfEmpty(_presenter->sceneIdentifier());
     114}
     115#endif
     116
    108117@end
    109118
     
    132141    [m_delegate invalidate];
    133142    m_delegate = nil;
     143#if ENABLE(APPLE_PAY_REMOTE_UI_USES_SCENE)
     144    m_sceneIdentifier = nullString();
     145#endif
    134146}
    135147
     
    144156}
    145157
     158#if ENABLE(APPLE_PAY_REMOTE_UI_USES_SCENE)
     159void PaymentAuthorizationController::presentInScene(const String& sceneIdentifier, CompletionHandler<void(bool)>&& completionHandler)
     160{
     161    m_sceneIdentifier = sceneIdentifier;
     162    present(nil, WTFMove(completionHandler));
     163}
     164#endif
     165
    146166} // namespace WebKit
    147167
  • trunk/Source/WebKit/Platform/spi/ios/UIKitSPI.h

    r282877 r283320  
    12921292#endif
    12931293
     1294@interface UIScene ()
     1295@property (nonatomic, readonly) NSString *_sceneIdentifier;
     1296@end
     1297
    12941298#endif // USE(APPLE_INTERNAL_SDK)
    12951299
  • trunk/Source/WebKit/Shared/ApplePay/WebPaymentCoordinatorProxy.cpp

    r278630 r283320  
    7979}
    8080
    81 void WebPaymentCoordinatorProxy::showPaymentUI(WebCore::PageIdentifier destinationID, const String& originatingURLString, const Vector<String>& linkIconURLStrings, const WebCore::ApplePaySessionPaymentRequest& paymentRequest, CompletionHandler<void(bool)>&& completionHandler)
     81void WebPaymentCoordinatorProxy::showPaymentUI(WebCore::PageIdentifier destinationID, WebPageProxyIdentifier webPageProxyID, const String& originatingURLString, const Vector<String>& linkIconURLStrings, const WebCore::ApplePaySessionPaymentRequest& paymentRequest, CompletionHandler<void(bool)>&& completionHandler)
    8282{
    8383    if (auto& coordinator = activePaymentCoordinatorProxy())
     
    9898        linkIconURLs.append(URL(URL(), linkIconURLString));
    9999
    100     platformShowPaymentUI(originatingURL, linkIconURLs, paymentRequest, [this, weakThis = makeWeakPtr(*this)](bool result) {
     100    platformShowPaymentUI(webPageProxyID, originatingURL, linkIconURLs, paymentRequest, [this, weakThis = makeWeakPtr(*this)](bool result) {
    101101        if (!weakThis)
    102102            return;
  • trunk/Source/WebKit/Shared/ApplePay/WebPaymentCoordinatorProxy.h

    r278630 r283320  
    3131#include "MessageSender.h"
    3232#include "PaymentAuthorizationPresenter.h"
     33#include "WebPageProxyIdentifier.h"
    3334#include <WebCore/PageIdentifier.h>
    3435#include <WebCore/PaymentHeaders.h>
     
    9293#if PLATFORM(IOS_FAMILY)
    9394        virtual UIViewController *paymentCoordinatorPresentingViewController(const WebPaymentCoordinatorProxy&) = 0;
     95#if ENABLE(APPLE_PAY_REMOTE_UI_USES_SCENE)
     96        virtual void getWindowSceneIdentifierForPaymentPresentation(WebPageProxyIdentifier, CompletionHandler<void(const String&)>&&) = 0;
     97#endif
    9498        virtual const String& paymentCoordinatorCTDataConnectionServiceType(const WebPaymentCoordinatorProxy&) = 0;
    9599        virtual std::unique_ptr<PaymentAuthorizationPresenter> paymentCoordinatorAuthorizationPresenter(WebPaymentCoordinatorProxy&, PKPaymentRequest *) = 0;
     
    128132    void canMakePaymentsWithActiveCard(const String& merchantIdentifier, const String& domainName, CompletionHandler<void(bool)>&&);
    129133    void openPaymentSetup(const String& merchantIdentifier, const String& domainName, CompletionHandler<void(bool)>&&);
    130     void showPaymentUI(WebCore::PageIdentifier destinationID, const String& originatingURLString, const Vector<String>& linkIconURLStrings, const WebCore::ApplePaySessionPaymentRequest&, CompletionHandler<void(bool)>&&);
     134    void showPaymentUI(WebCore::PageIdentifier destinationID, WebPageProxyIdentifier, const String& originatingURLString, const Vector<String>& linkIconURLStrings, const WebCore::ApplePaySessionPaymentRequest&, CompletionHandler<void(bool)>&&);
    131135    void completeMerchantValidation(const WebCore::PaymentMerchantSession&);
    132136    void completeShippingMethodSelection(std::optional<WebCore::ApplePayShippingMethodUpdate>&&);
     
    156160    void platformCanMakePaymentsWithActiveCard(const String& merchantIdentifier, const String& domainName, WTF::Function<void(bool)>&& completionHandler);
    157161    void platformOpenPaymentSetup(const String& merchantIdentifier, const String& domainName, WTF::Function<void(bool)>&& completionHandler);
    158     void platformShowPaymentUI(const URL& originatingURL, const Vector<URL>& linkIconURLs, const WebCore::ApplePaySessionPaymentRequest&, CompletionHandler<void(bool)>&&);
     162    void platformShowPaymentUI(WebPageProxyIdentifier, const URL& originatingURL, const Vector<URL>& linkIconURLs, const WebCore::ApplePaySessionPaymentRequest&, CompletionHandler<void(bool)>&&);
    159163    void platformCompleteMerchantValidation(const WebCore::PaymentMerchantSession&);
    160164    void platformCompleteShippingMethodSelection(std::optional<WebCore::ApplePayShippingMethodUpdate>&&);
  • trunk/Source/WebKit/Shared/ApplePay/WebPaymentCoordinatorProxy.messages.in

    r278630 r283320  
    3131    OpenPaymentSetup(String merchantIdentifier, String domainName) -> (bool result) Async
    3232
    33     ShowPaymentUI(WebCore::PageIdentifier destinationID, String originatingURLString, Vector<String> linkIconURLStrings, WebCore::ApplePaySessionPaymentRequest paymentRequest) -> (bool result) Synchronous
     33    ShowPaymentUI(WebCore::PageIdentifier destinationID, WebKit::WebPageProxyIdentifier webPageProxyIdentifier, String originatingURLString, Vector<String> linkIconURLStrings, WebCore::ApplePaySessionPaymentRequest paymentRequest) -> (bool result) Synchronous
    3434    CompleteMerchantValidation(WebCore::PaymentMerchantSession paymentMerchantSession)
    3535    CompleteShippingMethodSelection(std::optional<WebCore::ApplePayShippingMethodUpdate> update)
  • trunk/Source/WebKit/Shared/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm

    r263426 r283320  
    4747}
    4848
    49 void WebPaymentCoordinatorProxy::platformShowPaymentUI(const URL& originatingURL, const Vector<URL>& linkIconURLStrings, const WebCore::ApplePaySessionPaymentRequest& request, CompletionHandler<void(bool)>&& completionHandler)
     49void WebPaymentCoordinatorProxy::platformShowPaymentUI(WebPageProxyIdentifier webPageProxyID, const URL& originatingURL, const Vector<URL>& linkIconURLStrings, const WebCore::ApplePaySessionPaymentRequest& request, CompletionHandler<void(bool)>&& completionHandler)
    5050{
    5151    auto paymentRequest = platformPaymentRequest(originatingURL, linkIconURLStrings, request);
     
    5656        return completionHandler(false);
    5757
     58#if ENABLE(APPLE_PAY_REMOTE_UI_USES_SCENE)
     59    m_client.getWindowSceneIdentifierForPaymentPresentation(webPageProxyID, [weakThis = makeWeakPtr(*this), completionHandler = WTFMove(completionHandler)](const String& sceneID) mutable {
     60        if (!weakThis) {
     61            completionHandler(false);
     62            return;
     63        }
     64
     65        if (!weakThis->m_authorizationPresenter) {
     66            completionHandler(false);
     67            return;
     68        }
     69
     70        weakThis->m_authorizationPresenter->presentInScene(sceneID, WTFMove(completionHandler));
     71    });
     72#else
     73    UNUSED_PARAM(webPageProxyID);
    5874    m_authorizationPresenter->present(m_client.paymentCoordinatorPresentingViewController(*this), WTFMove(completionHandler));
     75#endif
    5976}
    6077
  • trunk/Source/WebKit/Shared/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm

    r263426 r283320  
    4848}
    4949
    50 void WebPaymentCoordinatorProxy::platformShowPaymentUI(const URL& originatingURL, const Vector<URL>& linkIconURLStrings, const WebCore::ApplePaySessionPaymentRequest& request, CompletionHandler<void(bool)>&& completionHandler)
     50void WebPaymentCoordinatorProxy::platformShowPaymentUI(WebPageProxyIdentifier, const URL& originatingURL, const Vector<URL>& linkIconURLStrings, const WebCore::ApplePaySessionPaymentRequest& request, CompletionHandler<void(bool)>&& completionHandler)
    5151{
    5252    if (!PAL::isPassKitFrameworkAvailable())
  • trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp

    r283179 r283320  
    4545#include "NetworkProcessMessages.h"
    4646#include "NetworkProcessProxyMessages.h"
     47#include "PageClient.h"
    4748#include "SandboxExtension.h"
    4849#if HAVE(SEC_KEY_PROXY)
     
    11731174#endif
    11741175
     1176#if ENABLE(APPLE_PAY_REMOTE_UI_USES_SCENE)
     1177void NetworkProcessProxy::getWindowSceneIdentifierForPaymentPresentation(WebPageProxyIdentifier webPageProxyIdentifier, CompletionHandler<void(const String&)>&& completionHandler)
     1178{
     1179    auto* page = WebProcessProxy::webPage(webPageProxyIdentifier);
     1180    if (!page) {
     1181        completionHandler(nullString());
     1182        return;
     1183    }
     1184    completionHandler(page->pageClient().sceneID());
     1185}
     1186#endif
     1187
    11751188void NetworkProcessProxy::setShouldDowngradeReferrerForTesting(bool enabled, CompletionHandler<void()>&& completionHandler)
    11761189{
  • trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxy.h

    r283179 r283320  
    256256#endif
    257257
     258#if ENABLE(APPLE_PAY_REMOTE_UI_USES_SCENE)
     259    void getWindowSceneIdentifierForPaymentPresentation(WebPageProxyIdentifier, CompletionHandler<void(const String&)>&&);
     260#endif
    258261    // ProcessThrottlerClient
    259262    void sendPrepareToSuspend(IsSuspensionImminent, CompletionHandler<void()>&&) final;
  • trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxy.messages.in

    r283179 r283320  
    7979    DidExceedMemoryLimit()
    8080#endif
     81
     82#if ENABLE(APPLE_PAY_REMOTE_UI_USES_SCENE)
     83    GetWindowSceneIdentifierForPaymentPresentation(WebKit::WebPageProxyIdentifier webPageProxyIdentifier) -> (String sceneID) Async
     84#endif
    8185}
  • trunk/Source/WebKit/UIProcess/PageClient.h

    r282189 r283320  
    499499
    500500    virtual WebCore::Color contentViewBackgroundColor() = 0;
     501    virtual String sceneID() = 0;
    501502#endif
    502503
  • trunk/Source/WebKit/UIProcess/WebPageProxy.h

    r283316 r283320  
    24982498#if ENABLE(APPLE_PAY) && PLATFORM(IOS_FAMILY)
    24992499    UIViewController *paymentCoordinatorPresentingViewController(const WebPaymentCoordinatorProxy&) final;
     2500#if ENABLE(APPLE_PAY_REMOTE_UI_USES_SCENE)
     2501    void getWindowSceneIdentifierForPaymentPresentation(WebPageProxyIdentifier, CompletionHandler<void(const String&)>&&) final;
     2502#endif
    25002503    const String& paymentCoordinatorCTDataConnectionServiceType(const WebPaymentCoordinatorProxy&) final;
    25012504    std::unique_ptr<PaymentAuthorizationPresenter> paymentCoordinatorAuthorizationPresenter(WebPaymentCoordinatorProxy&, PKPaymentRequest *) final;
  • trunk/Source/WebKit/UIProcess/ios/PageClientImplIOS.h

    r281279 r283320  
    301301
    302302    WebCore::Color contentViewBackgroundColor() final;
     303    String sceneID() final;
    303304
    304305    WeakObjCPtr<WKContentView> m_contentView;
  • trunk/Source/WebKit/UIProcess/ios/PageClientImplIOS.mm

    r281470 r283320  
    10241024}
    10251025
     1026String PageClientImpl::sceneID()
     1027{
     1028    return [m_contentView window].windowScene._sceneIdentifier;
     1029}
     1030
    10261031} // namespace WebKit
    10271032
  • trunk/Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm

    r281955 r283320  
    12391239}
    12401240
     1241#if ENABLE(APPLE_PAY_REMOTE_UI_USES_SCENE)
     1242void WebPageProxy::getWindowSceneIdentifierForPaymentPresentation(WebPageProxyIdentifier, CompletionHandler<void(const String&)>&& completionHandler)
     1243{
     1244    ASSERT_NOT_REACHED();
     1245    completionHandler(nullString());
     1246}
     1247#endif
     1248
    12411249const String& WebPageProxy::paymentCoordinatorCTDataConnectionServiceType(const WebPaymentCoordinatorProxy&)
    12421250{
  • trunk/Source/WebKit/WebProcess/ApplePay/WebPaymentCoordinator.cpp

    r278712 r283320  
    103103
    104104    bool result;
    105     if (!sendSync(Messages::WebPaymentCoordinatorProxy::ShowPaymentUI(m_webPage.identifier(), originatingURL.string(), linkIconURLStrings, paymentRequest), Messages::WebPaymentCoordinatorProxy::ShowPaymentUI::Reply(result)))
     105    if (!sendSync(Messages::WebPaymentCoordinatorProxy::ShowPaymentUI(m_webPage.identifier(), m_webPage.webPageProxyIdentifier(), originatingURL.string(), linkIconURLStrings, paymentRequest), Messages::WebPaymentCoordinatorProxy::ShowPaymentUI::Reply(result)))
    106106        return false;
    107107
Note: See TracChangeset for help on using the changeset viewer.