Changeset 243412 in webkit
- Timestamp:
- Mar 23, 2019, 9:39:01 AM (7 years ago)
- Location:
- trunk/Source
- Files:
-
- 10 edited
-
WebCore/PAL/ChangeLog (modified) (1 diff)
-
WebCore/PAL/pal/spi/cocoa/PassKitSPI.h (modified) (4 diffs)
-
WebKit/ChangeLog (modified) (1 diff)
-
WebKit/Platform/cocoa/PaymentAuthorizationViewController.mm (modified) (1 diff)
-
WebKit/Platform/cocoa/WKPaymentAuthorizationDelegate.h (modified) (3 diffs)
-
WebKit/Platform/cocoa/WKPaymentAuthorizationDelegate.mm (modified) (3 diffs)
-
WebKit/Platform/ios/PaymentAuthorizationController.mm (modified) (1 diff)
-
WebKit/Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm (modified) (1 diff)
-
WebKit/Shared/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm (modified) (1 diff)
-
WebKit/Shared/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/PAL/ChangeLog
r243396 r243412 1 2019-03-23 Andy Estes <aestes@apple.com> 2 3 [Apple Pay] Stop calling PKPaymentAuthorizationViewController class methods on iOS 4 https://bugs.webkit.org/show_bug.cgi?id=196163 5 <rdar://problem/48787564> 6 7 Reviewed by Anders Carlsson. 8 9 * pal/spi/cocoa/PassKitSPI.h: 10 1 11 2019-03-22 Keith Rollin <krollin@apple.com> 2 12 -
trunk/Source/WebCore/PAL/pal/spi/cocoa/PassKitSPI.h
r242748 r243412 50 50 #else 51 51 52 #import <Foundation/Foundation.h> 53 54 #if HAVE(PASSKIT_API_TYPE) 55 typedef NS_ENUM(NSUInteger, PKPaymentRequestAPIType) { 56 PKPaymentRequestAPITypeInApp = 0, 57 PKPaymentRequestAPITypeWebJS, 58 PKPaymentRequestAPITypeWebPaymentRequest, 59 }; 60 #endif 61 52 62 #if PLATFORM(IOS_FAMILY) 53 63 … … 59 69 60 70 @interface PKPaymentAuthorizationController () 71 + (void)paymentServicesMerchantURLForAPIType:(PKPaymentRequestAPIType)APIType completion:(void(^)(NSURL *merchantURL, NSError *error))completion; 61 72 @property (nonatomic, assign, nullable) id<PKPaymentAuthorizationControllerPrivateDelegate> privateDelegate; 62 73 @end … … 273 284 @interface PKPaymentAuthorizationViewController () 274 285 + (void)paymentServicesMerchantURL:(void(^)(NSURL *merchantURL, NSError *error))completion; 286 #if HAVE(PASSKIT_API_TYPE) 287 + (void)paymentServicesMerchantURLForAPIType:(PKPaymentRequestAPIType)APIType completion:(void(^)(NSURL *merchantURL, NSError *error))completion; 288 #endif 275 289 @property (nonatomic, assign, nullable) id<PKPaymentAuthorizationViewControllerPrivateDelegate> privateDelegate; 276 290 @end … … 283 297 @end 284 298 285 #if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MAX_ALLOWED >= 101304) || PLATFORM(IOS_FAMILY) 286 typedef NS_ENUM(NSUInteger, PKPaymentRequestAPIType) { 287 PKPaymentRequestAPITypeInApp = 0, 288 PKPaymentRequestAPITypeWebJS, 289 PKPaymentRequestAPITypeWebPaymentRequest, 290 }; 291 299 #if HAVE(PASSKIT_API_TYPE) 292 300 @interface PKPaymentRequest () 293 301 @property (nonatomic, assign) PKPaymentRequestAPIType APIType; -
trunk/Source/WebKit/ChangeLog
r243410 r243412 1 2019-03-23 Andy Estes <aestes@apple.com> 2 3 [Apple Pay] Stop calling PKPaymentAuthorizationViewController class methods on iOS 4 https://bugs.webkit.org/show_bug.cgi?id=196163 5 <rdar://problem/48787564> 6 7 Reviewed by Anders Carlsson. 8 9 Now that we've transitioned to PKPaymentAuthorizationController on iOS, we should stop 10 calling PKPaymentAuthorizationViewController class methods on iOS in favor of their 11 PKPaymentAuthorizationController alternatives. 12 13 While we're here, we should also transition to calling 14 +paymentServicesMerchantURLForAPIType:completion: on both 15 PKPaymentAuthorizationViewController and PKPaymentAuthorizationController. 16 17 * Platform/cocoa/PaymentAuthorizationViewController.mm: 18 (-[WKPaymentAuthorizationViewControllerDelegate _paymentServicesMerchantURLForAPIType:completion:]): 19 * Platform/cocoa/WKPaymentAuthorizationDelegate.h: 20 * Platform/cocoa/WKPaymentAuthorizationDelegate.mm: 21 (-[WKPaymentAuthorizationDelegate _initWithRequest:presenter:]): 22 (-[WKPaymentAuthorizationDelegate _paymentServicesMerchantURLForAPIType:completion:]): 23 * Platform/ios/PaymentAuthorizationController.mm: 24 (-[WKPaymentAuthorizationControllerDelegate _paymentServicesMerchantURLForAPIType:completion:]): 25 * Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm: 26 (WebKit::WebPaymentCoordinatorProxy::platformCanMakePayments): Deleted. 27 * Shared/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm: 28 (WebKit::WebPaymentCoordinatorProxy::platformCanMakePayments): 29 * Shared/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm: 30 (WebKit::WebPaymentCoordinatorProxy::platformCanMakePayments): 31 1 32 2019-03-23 Carlos Garcia Campos <cgarcia@igalia.com> 2 33 -
trunk/Source/WebKit/Platform/cocoa/PaymentAuthorizationViewController.mm
r242616 r243412 46 46 47 47 return self; 48 } 49 50 - (void)_getPaymentServicesMerchantURL:(void(^)(NSURL *, NSError *))completion 51 { 52 #if HAVE(PASSKIT_API_TYPE) 53 [PAL::getPKPaymentAuthorizationViewControllerClass() paymentServicesMerchantURLForAPIType:[_request APIType] completion:completion]; 54 #else 55 [PAL::getPKPaymentAuthorizationViewControllerClass() paymentServicesMerchantURL:completion]; 56 #endif 48 57 } 49 58 -
trunk/Source/WebKit/Platform/cocoa/WKPaymentAuthorizationDelegate.h
r242616 r243412 28 28 #import <pal/spi/cocoa/PassKitSPI.h> 29 29 #import <wtf/BlockPtr.h> 30 #import <wtf/RetainPtr.h> 30 31 31 32 OBJC_CLASS NSArray; … … 53 54 } 54 55 55 @interface WKPaymentAuthorizationDelegate : NSObject 56 @interface WKPaymentAuthorizationDelegate : NSObject { 57 RetainPtr<PKPaymentRequest> _request; 58 } 56 59 57 60 - (instancetype)init NS_UNAVAILABLE; … … 81 84 - (void)_didSelectShippingContact:(PKContact *)contact completion:(WebKit::DidSelectShippingContactCompletion::BlockType)completion; 82 85 - (void)_didSelectShippingMethod:(PKShippingMethod *)shippingMethod completion:(WebKit::DidSelectShippingMethodCompletion::BlockType)completion; 86 - (void)_getPaymentServicesMerchantURL:(void(^)(NSURL *, NSError *))completion; 83 87 - (void)_willFinishWithError:(NSError *)error; 84 88 -
trunk/Source/WebKit/Platform/cocoa/WKPaymentAuthorizationDelegate.mm
r242616 r243412 121 121 return nil; 122 122 123 _presenter = makeWeakPtr(presenter); 124 _request = request; 125 _shippingMethods = request.shippingMethods; 123 126 _summaryItems = request.paymentSummaryItems; 124 _shippingMethods = request.shippingMethods;125 _presenter = makeWeakPtr(presenter);126 127 return self; 127 128 } … … 150 151 _didRequestMerchantSessionCompletion = completion; 151 152 152 [ PAL::getPKPaymentAuthorizationViewControllerClass() paymentServicesMerchantURL:^(NSURL *merchantURL, NSError *error) {153 [self _getPaymentServicesMerchantURL:^(NSURL *merchantURL, NSError *error) { 153 154 if (error) 154 155 LOG_ERROR("PKCanMakePaymentsWithMerchantIdentifierAndDomain error %@", error); … … 217 218 } 218 219 220 - (void) NO_RETURN_DUE_TO_ASSERT _getPaymentServicesMerchantURL:(void(^)(NSURL *, NSError *))completion 221 { 222 ASSERT_NOT_REACHED(); 223 completion(nil, nil); 224 } 225 219 226 - (void)_willFinishWithError:(NSError *)error 220 227 { -
trunk/Source/WebKit/Platform/ios/PaymentAuthorizationController.mm
r242748 r243412 46 46 47 47 return self; 48 } 49 50 - (void)_getPaymentServicesMerchantURL:(void(^)(NSURL *, NSError *))completion 51 { 52 // FIXME: This -respondsToSelector: check can be removed once rdar://problem/48771320 is in an iOS SDK. 53 if ([PAL::getPKPaymentAuthorizationControllerClass() respondsToSelector:@selector(paymentServicesMerchantURLForAPIType:completion:)]) 54 [PAL::getPKPaymentAuthorizationControllerClass() paymentServicesMerchantURLForAPIType:[_request APIType] completion:completion]; 55 else 56 [PAL::getPKPaymentAuthorizationViewControllerClass() paymentServicesMerchantURLForAPIType:[_request APIType] completion:completion]; 48 57 } 49 58 -
trunk/Source/WebKit/Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm
r242904 r243412 53 53 namespace WebKit { 54 54 55 bool WebPaymentCoordinatorProxy::platformCanMakePayments()56 {57 #if PLATFORM(MAC)58 if (!PAL::isPassKitFrameworkAvailable())59 return false;60 #endif61 62 return [PAL::getPKPaymentAuthorizationViewControllerClass() canMakePayments];63 }64 65 55 void WebPaymentCoordinatorProxy::platformCanMakePaymentsWithActiveCard(const String& merchantIdentifier, const String& domainName, PAL::SessionID sessionID, WTF::Function<void(bool)>&& completionHandler) 66 56 { -
trunk/Source/WebKit/Shared/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm
r242748 r243412 39 39 namespace WebKit { 40 40 41 bool WebPaymentCoordinatorProxy::platformCanMakePayments() 42 { 43 return [PAL::getPKPaymentAuthorizationControllerClass() canMakePayments]; 44 } 45 41 46 void WebPaymentCoordinatorProxy::platformShowPaymentUI(const URL& originatingURL, const Vector<URL>& linkIconURLStrings, PAL::SessionID sessionID, const WebCore::ApplePaySessionPaymentRequest& request, CompletionHandler<void(bool)>&& completionHandler) 42 47 { -
trunk/Source/WebKit/Shared/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm
r242795 r243412 35 35 36 36 namespace WebKit { 37 38 bool WebPaymentCoordinatorProxy::platformCanMakePayments() 39 { 40 if (!PAL::isPassKitFrameworkAvailable()) 41 return false; 42 43 return [PAL::getPKPaymentAuthorizationViewControllerClass() canMakePayments]; 44 } 37 45 38 46 void WebPaymentCoordinatorProxy::platformShowPaymentUI(const URL& originatingURL, const Vector<URL>& linkIconURLStrings, PAL::SessionID sessionID, const WebCore::ApplePaySessionPaymentRequest& request, CompletionHandler<void(bool)>&& completionHandler)
Note:
See TracChangeset
for help on using the changeset viewer.