[Apple Pay] Disable Apple Pay on platforms that don't have PassKit.framework
authoraestes@apple.com <aestes@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 5 Jan 2018 21:28:05 +0000 (21:28 +0000)
committeraestes@apple.com <aestes@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 5 Jan 2018 21:28:05 +0000 (21:28 +0000)
commit1c6897b79c59433d65918200b13d9ca5dd085c0b
tree8943428cb4d912e9c32f1d249b1e3fa1fc997fbe
parent5da416c86156f765896fdadc70940866228a1f57
[Apple Pay] Disable Apple Pay on platforms that don't have PassKit.framework
https://bugs.webkit.org/show_bug.cgi?id=181335
<rdar://problem/36311296>

Reviewed by Brady Eidson.

When Safari is running in the macOS Base System, PassKit.framework is not available.
If we fail to dlopen PassKit, we should disable Apple Pay.

* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetApplePayEnabled):
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _initializeWithConfiguration:]):
* UIProcess/ApplePay/WebPaymentCoordinatorProxy.h:
* UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
(WebKit::WebPaymentCoordinatorProxy::availablePaymentNetworks):
(WebKit::WebPaymentCoordinatorProxy::platformSupportsPayments):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@226458 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebKit/ChangeLog
Source/WebKit/UIProcess/API/C/WKPreferences.cpp
Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm
Source/WebKit/UIProcess/ApplePay/WebPaymentCoordinatorProxy.h
Source/WebKit/UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm