Changeset 207362 in webkit


Ignore:
Timestamp:
Oct 14, 2016 4:56:00 PM (8 years ago)
Author:
andersca@apple.com
Message:

Pass on networking settings to the PKPaymentRequest
https://bugs.webkit.org/show_bug.cgi?id=163462
rdar://problem/28567629

Reviewed by Dan Bernstein.

Source/WebCore:

Add new SPI.

  • platform/spi/cocoa/PassKitSPI.h:

Source/WebKit2:

  • UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.h:
  • UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:

(WebKit::toPKPaymentRequest):

  • UIProcess/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm:

(WebKit::WebPaymentCoordinatorProxy::platformShowPaymentUI):

Location:
trunk/Source
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r207361 r207362  
     12016-10-14  Anders Carlsson  <andersca@apple.com>
     2
     3        Pass on networking settings to the PKPaymentRequest
     4        https://bugs.webkit.org/show_bug.cgi?id=163462
     5        rdar://problem/28567629
     6
     7        Reviewed by Dan Bernstein.
     8
     9        Add new SPI.
     10
     11        * platform/spi/cocoa/PassKitSPI.h:
     12
    1132016-10-14  Dean Jackson  <dino@apple.com>
    214
  • trunk/Source/WebCore/platform/spi/cocoa/PassKitSPI.h

    r206258 r207362  
    243243@end
    244244
     245@interface PKPaymentRequest ()
     246@property (nonatomic, strong) NSString *sourceApplicationBundleIdentifier;
     247@property (nonatomic, strong) NSString *sourceApplicationSecondaryIdentifier;
     248@property (nonatomic, strong) NSString *CTDataConnectionServiceType;
     249@end
     250
    245251NS_ASSUME_NONNULL_END
  • trunk/Source/WebKit2/ChangeLog

    r207352 r207362  
     12016-10-14  Anders Carlsson  <andersca@apple.com>
     2
     3        Pass on networking settings to the PKPaymentRequest
     4        https://bugs.webkit.org/show_bug.cgi?id=163462
     5        rdar://problem/28567629
     6
     7        Reviewed by Dan Bernstein.
     8
     9        * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.h:
     10        * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
     11        (WebKit::toPKPaymentRequest):
     12        * UIProcess/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm:
     13        (WebKit::WebPaymentCoordinatorProxy::platformShowPaymentUI):
     14
    1152016-10-14  Anders Carlsson  <andersca@apple.com>
    216
  • trunk/Source/WebKit2/UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.h

    r203414 r207362  
    3737
    3838namespace WebKit {
     39class WebPageProxy;
    3940class WebPaymentCoordinatorProxy;
    4041
    41 RetainPtr<PKPaymentRequest> toPKPaymentRequest(const WebCore::URL& originatingURL, const Vector<WebCore::URL>& linkIconURLs, const WebCore::PaymentRequest&);
     42RetainPtr<PKPaymentRequest> toPKPaymentRequest(WebPageProxy&, const WebCore::URL& originatingURL, const Vector<WebCore::URL>& linkIconURLs, const WebCore::PaymentRequest&);
    4243
    4344}
  • trunk/Source/WebKit2/UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm

    r206238 r207362  
    3030
    3131#import "WebPaymentCoordinatorProxy.h"
     32#import "WebProcessPool.h"
    3233#import <WebCore/PassKitSPI.h>
    3334#import <WebCore/PaymentAuthorizationStatus.h>
     
    360361}
    361362
    362 RetainPtr<PKPaymentRequest> toPKPaymentRequest(const WebCore::URL& originatingURL, const Vector<WebCore::URL>& linkIconURLs, const WebCore::PaymentRequest& paymentRequest)
     363RetainPtr<PKPaymentRequest> toPKPaymentRequest(WebPageProxy& webPageProxy, const WebCore::URL& originatingURL, const Vector<WebCore::URL>& linkIconURLs, const WebCore::PaymentRequest& paymentRequest)
    363364{
    364365    auto result = adoptNS([allocPKPaymentRequestInstance() init]);
     
    409410        [result setApplicationData:applicationData.get()];
    410411    }
     412
     413    // FIXME: Instead of using respondsToSelector, this should use a proper #if version check.
     414    auto& configuration = webPageProxy.process().processPool().configuration();
     415
     416    if (!configuration.sourceApplicationBundleIdentifier().isEmpty() && [result respondsToSelector:@selector(setSourceApplicationBundleIdentifier:)])
     417        [result setSourceApplicationBundleIdentifier:configuration.sourceApplicationBundleIdentifier()];
     418
     419    if (!configuration.sourceApplicationSecondaryIdentifier().isEmpty() && [result respondsToSelector:@selector(setSourceApplicationSecondaryIdentifier:)])
     420        [result setSourceApplicationSecondaryIdentifier:configuration.sourceApplicationSecondaryIdentifier()];
     421
     422#if PLATFORM(IOS)
     423    if (!configuration.ctDataConnectionServiceType().isEmpty() && [result respondsToSelector:@selector(setCTDataConnectionServiceType:)])
     424        [result setCTDataConnectionServiceType:configuration.ctDataConnectionServiceType()];
     425#endif
    411426
    412427    return result;
  • trunk/Source/WebKit2/UIProcess/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm

    r204466 r207362  
    5353    ASSERT(!m_paymentAuthorizationViewController);
    5454
    55     auto paymentRequest = toPKPaymentRequest(originatingURL, linkIconURLStrings, request);
     55    auto paymentRequest = toPKPaymentRequest(m_webPageProxy, originatingURL, linkIconURLStrings, request);
    5656
    5757    m_paymentAuthorizationViewController = adoptNS([allocPKPaymentAuthorizationViewControllerInstance() initWithPaymentRequest:paymentRequest.get()]);
Note: See TracChangeset for help on using the changeset viewer.