Inline more of the Apple Pay source code
authorandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 24 Jun 2016 20:49:31 +0000 (20:49 +0000)
committerandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 24 Jun 2016 20:49:31 +0000 (20:49 +0000)
https://bugs.webkit.org/show_bug.cgi?id=159099

Reviewed by Andreas Kling.

Source/WebCore:

* page/Settings.h:
(WebCore::Settings::applePayEnabled):
(WebCore::Settings::setApplePayEnabled):
(WebCore::Settings::applePayCapabilityDisclosureAllowed):
(WebCore::Settings::setApplePayCapabilityDisclosureAllowed):

Source/WebKit2:

* Shared/Cocoa/WebCoreArgumentCodersCocoa.h: Removed.
* Shared/WebCoreArgumentCoders.h:
* Shared/WebPreferencesDefinitions.h:
* UIProcess/API/Cocoa/WKPreferences.mm:
(-[WKPreferences _applePayCapabilityDisclosureAllowed]):
(-[WKPreferences _setApplePayCapabilityDisclosureAllowed:]):
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _initializeWithConfiguration:]):
* UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
(-[WKWebViewConfiguration copyWithZone:]):
(-[WKWebViewConfiguration _applePayEnabled]):
(-[WKWebViewConfiguration _setApplePayEnabled:]):
(-[WKWebViewConfiguration _paymentsEnabled]):
(-[WKWebViewConfiguration _setPaymentsEnabled:]):
* UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::WebPageProxy):
(WebKit::WebPageProxy::reattachToWebProcess):
(WebKit::WebPageProxy::resetState):
* UIProcess/WebPageProxy.h:
* WebKit2.xcodeproj/project.pbxproj:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::m_userInterfaceLayoutDirection):
(WebKit::WebPage::updatePreferences):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@202444 268f45cc-cd09-0410-ab3c-d52691b4dbfc

14 files changed:
Source/WebCore/ChangeLog
Source/WebCore/page/Settings.h
Source/WebKit2/ChangeLog
Source/WebKit2/Shared/Cocoa/WebCoreArgumentCodersCocoa.h [deleted file]
Source/WebKit2/Shared/WebCoreArgumentCoders.h
Source/WebKit2/Shared/WebPreferencesDefinitions.h
Source/WebKit2/UIProcess/API/Cocoa/WKPreferences.mm
Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm
Source/WebKit2/UIProcess/API/Cocoa/WKWebViewConfiguration.mm
Source/WebKit2/UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h
Source/WebKit2/UIProcess/WebPageProxy.cpp
Source/WebKit2/UIProcess/WebPageProxy.h
Source/WebKit2/WebKit2.xcodeproj/project.pbxproj
Source/WebKit2/WebProcess/WebPage/WebPage.cpp

index 5c93c43..6def822 100644 (file)
@@ -1,5 +1,18 @@
 2016-06-24  Anders Carlsson  <andersca@apple.com>
 
+        Inline more of the Apple Pay source code
+        https://bugs.webkit.org/show_bug.cgi?id=159099
+
+        Reviewed by Andreas Kling.
+
+        * page/Settings.h:
+        (WebCore::Settings::applePayEnabled):
+        (WebCore::Settings::setApplePayEnabled):
+        (WebCore::Settings::applePayCapabilityDisclosureAllowed):
+        (WebCore::Settings::setApplePayCapabilityDisclosureAllowed):
+
+2016-06-24  Anders Carlsson  <andersca@apple.com>
+
         Windows build fix.
 
         * platform/GenericTaskQueue.h:
index 5021b5c..167349f 100644 (file)
@@ -289,16 +289,20 @@ public:
     WEBCORE_EXPORT static void setMockCaptureDevicesEnabled(bool);
 #endif
 
+#if ENABLE(APPLE_PAY)
+    bool applePayEnabled() const { return m_applePayEnabled; }
+    void setApplePayEnabled(bool applePayEnabled) { m_applePayEnabled = applePayEnabled; }
+
+    bool applePayCapabilityDisclosureAllowed() const { return m_applePayCapabilityDisclosureAllowed; }
+    void setApplePayCapabilityDisclosureAllowed(bool applePayCapabilityDisclosureAllowed) { m_applePayCapabilityDisclosureAllowed = applePayCapabilityDisclosureAllowed; }
+#endif
+
     WEBCORE_EXPORT void setForcePendingWebGLPolicy(bool);
     bool isForcePendingWebGLPolicy() const { return m_forcePendingWebGLPolicy; }
 
     WEBCORE_EXPORT static void setAllowsAnySSLCertificate(bool);
     static bool allowsAnySSLCertificate();
 
-#if USE(APPLE_INTERNAL_SDK)
-#import <WebKitAdditions/SettingsGettersAndSetters.h>
-#endif
-
 private:
     explicit Settings(Page*);
 
@@ -390,13 +394,14 @@ private:
     static bool gMockCaptureDevicesEnabled;
 #endif
 
+#if ENABLE(APPLE_PAY)
+    bool m_applePayEnabled { false };
+    bool m_applePayCapabilityDisclosureAllowed { true };
+#endif
+
     static bool gLowPowerVideoAudioBufferSizeEnabled;
     static bool gResourceLoadStatisticsEnabledEnabled;
     static bool gAllowsAnySSLCertificate;
-
-#if USE(APPLE_INTERNAL_SDK)
-#import <WebKitAdditions/SettingsMembers.h>
-#endif
 };
 
 } // namespace WebCore
index 8d33f85..7f03601 100644 (file)
@@ -1,3 +1,35 @@
+2016-06-24  Anders Carlsson  <andersca@apple.com>
+
+        Inline more of the Apple Pay source code
+        https://bugs.webkit.org/show_bug.cgi?id=159099
+
+        Reviewed by Andreas Kling.
+
+        * Shared/Cocoa/WebCoreArgumentCodersCocoa.h: Removed.
+        * Shared/WebCoreArgumentCoders.h:
+        * Shared/WebPreferencesDefinitions.h:
+        * UIProcess/API/Cocoa/WKPreferences.mm:
+        (-[WKPreferences _applePayCapabilityDisclosureAllowed]):
+        (-[WKPreferences _setApplePayCapabilityDisclosureAllowed:]):
+        * UIProcess/API/Cocoa/WKWebView.mm:
+        (-[WKWebView _initializeWithConfiguration:]):
+        * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
+        (-[WKWebViewConfiguration copyWithZone:]):
+        (-[WKWebViewConfiguration _applePayEnabled]):
+        (-[WKWebViewConfiguration _setApplePayEnabled:]):
+        (-[WKWebViewConfiguration _paymentsEnabled]):
+        (-[WKWebViewConfiguration _setPaymentsEnabled:]):
+        * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::WebPageProxy):
+        (WebKit::WebPageProxy::reattachToWebProcess):
+        (WebKit::WebPageProxy::resetState):
+        * UIProcess/WebPageProxy.h:
+        * WebKit2.xcodeproj/project.pbxproj:
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::m_userInterfaceLayoutDirection):
+        (WebKit::WebPage::updatePreferences):
+
 2016-06-21  Anders Carlsson  <andersca@apple.com>
 
         Rename NoncopyableFunction to Function
diff --git a/Source/WebKit2/Shared/Cocoa/WebCoreArgumentCodersCocoa.h b/Source/WebKit2/Shared/Cocoa/WebCoreArgumentCodersCocoa.h
deleted file mode 100644 (file)
index b94af4c..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Copyright (C) 2016 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#pragma once
-
-#if ENABLE(APPLE_PAY)
-
-#include <WebCore/PaymentHeaders.h>
-
-namespace IPC {
-
-template<> struct ArgumentCoder<WebCore::Payment> {
-    static void encode(ArgumentEncoder&, const WebCore::Payment&);
-    static bool decode(ArgumentDecoder&, WebCore::Payment&);
-};
-
-template<> struct ArgumentCoder<WebCore::PaymentContact> {
-    static void encode(ArgumentEncoder&, const WebCore::PaymentContact&);
-    static bool decode(ArgumentDecoder&, WebCore::PaymentContact&);
-};
-
-template<> struct ArgumentCoder<WebCore::PaymentMerchantSession> {
-    static void encode(ArgumentEncoder&, const WebCore::PaymentMerchantSession&);
-    static bool decode(ArgumentDecoder&, WebCore::PaymentMerchantSession&);
-};
-
-template<> struct ArgumentCoder<WebCore::PaymentMethod> {
-    static void encode(ArgumentEncoder&, const WebCore::PaymentMethod&);
-    static bool decode(ArgumentDecoder&, WebCore::PaymentMethod&);
-};
-
-template<> struct ArgumentCoder<WebCore::PaymentRequest> {
-    static void encode(ArgumentEncoder&, const WebCore::PaymentRequest&);
-    static bool decode(ArgumentDecoder&, WebCore::PaymentRequest&);
-};
-
-template<> struct ArgumentCoder<WebCore::PaymentRequest::AddressFields> {
-    static void encode(ArgumentEncoder&, const WebCore::PaymentRequest::AddressFields&);
-    static bool decode(ArgumentDecoder&, WebCore::PaymentRequest::AddressFields&);
-};
-
-template<> struct ArgumentCoder<WebCore::PaymentRequest::LineItem> {
-    static void encode(ArgumentEncoder&, const WebCore::PaymentRequest::LineItem&);
-    static bool decode(ArgumentDecoder&, WebCore::PaymentRequest::LineItem&);
-};
-
-template<> struct ArgumentCoder<WebCore::PaymentRequest::MerchantCapabilities> {
-    static void encode(ArgumentEncoder&, const WebCore::PaymentRequest::MerchantCapabilities&);
-    static bool decode(ArgumentDecoder&, WebCore::PaymentRequest::MerchantCapabilities&);
-};
-
-template<> struct ArgumentCoder<WebCore::PaymentRequest::ShippingMethod> {
-    static void encode(ArgumentEncoder&, const WebCore::PaymentRequest::ShippingMethod&);
-    static bool decode(ArgumentDecoder&, WebCore::PaymentRequest::ShippingMethod&);
-};
-
-template<> struct ArgumentCoder<WebCore::PaymentRequest::SupportedNetworks> {
-    static void encode(ArgumentEncoder&, const WebCore::PaymentRequest::SupportedNetworks&);
-    static bool decode(ArgumentDecoder&, WebCore::PaymentRequest::SupportedNetworks&);
-};
-
-template<> struct ArgumentCoder<WebCore::PaymentRequest::TotalAndLineItems> {
-    static void encode(ArgumentEncoder&, const WebCore::PaymentRequest::TotalAndLineItems&);
-    static bool decode(ArgumentDecoder&, WebCore::PaymentRequest::TotalAndLineItems&);
-};
-
-}
-
-#endif
index 47ab193..7af7444 100644 (file)
@@ -27,6 +27,7 @@
 #define WebCoreArgumentCoders_h
 
 #include "ArgumentCoders.h"
+#include <WebCore/PaymentHeaders.h>
 
 namespace WebCore {
 class AffineTransform;
@@ -473,10 +474,65 @@ template<> struct ArgumentCoder<WebCore::ResourceLoadStatistics> {
     static bool decode(ArgumentDecoder&, WebCore::ResourceLoadStatistics&);
 };
 
-} // namespace IPC
+#if ENABLE(APPLE_PAY)
+
+template<> struct ArgumentCoder<WebCore::Payment> {
+    static void encode(ArgumentEncoder&, const WebCore::Payment&);
+    static bool decode(ArgumentDecoder&, WebCore::Payment&);
+};
+
+template<> struct ArgumentCoder<WebCore::PaymentContact> {
+    static void encode(ArgumentEncoder&, const WebCore::PaymentContact&);
+    static bool decode(ArgumentDecoder&, WebCore::PaymentContact&);
+};
+
+template<> struct ArgumentCoder<WebCore::PaymentMerchantSession> {
+    static void encode(ArgumentEncoder&, const WebCore::PaymentMerchantSession&);
+    static bool decode(ArgumentDecoder&, WebCore::PaymentMerchantSession&);
+};
+
+template<> struct ArgumentCoder<WebCore::PaymentMethod> {
+    static void encode(ArgumentEncoder&, const WebCore::PaymentMethod&);
+    static bool decode(ArgumentDecoder&, WebCore::PaymentMethod&);
+};
+
+template<> struct ArgumentCoder<WebCore::PaymentRequest> {
+    static void encode(ArgumentEncoder&, const WebCore::PaymentRequest&);
+    static bool decode(ArgumentDecoder&, WebCore::PaymentRequest&);
+};
+
+template<> struct ArgumentCoder<WebCore::PaymentRequest::AddressFields> {
+    static void encode(ArgumentEncoder&, const WebCore::PaymentRequest::AddressFields&);
+    static bool decode(ArgumentDecoder&, WebCore::PaymentRequest::AddressFields&);
+};
+
+template<> struct ArgumentCoder<WebCore::PaymentRequest::LineItem> {
+    static void encode(ArgumentEncoder&, const WebCore::PaymentRequest::LineItem&);
+    static bool decode(ArgumentDecoder&, WebCore::PaymentRequest::LineItem&);
+};
+
+template<> struct ArgumentCoder<WebCore::PaymentRequest::MerchantCapabilities> {
+    static void encode(ArgumentEncoder&, const WebCore::PaymentRequest::MerchantCapabilities&);
+    static bool decode(ArgumentDecoder&, WebCore::PaymentRequest::MerchantCapabilities&);
+};
+
+template<> struct ArgumentCoder<WebCore::PaymentRequest::ShippingMethod> {
+    static void encode(ArgumentEncoder&, const WebCore::PaymentRequest::ShippingMethod&);
+    static bool decode(ArgumentDecoder&, WebCore::PaymentRequest::ShippingMethod&);
+};
+
+template<> struct ArgumentCoder<WebCore::PaymentRequest::SupportedNetworks> {
+    static void encode(ArgumentEncoder&, const WebCore::PaymentRequest::SupportedNetworks&);
+    static bool decode(ArgumentDecoder&, WebCore::PaymentRequest::SupportedNetworks&);
+};
+
+template<> struct ArgumentCoder<WebCore::PaymentRequest::TotalAndLineItems> {
+    static void encode(ArgumentEncoder&, const WebCore::PaymentRequest::TotalAndLineItems&);
+    static bool decode(ArgumentDecoder&, WebCore::PaymentRequest::TotalAndLineItems&);
+};
 
-#if USE(APPLE_INTERNAL_SDK)
-#include <WebKitAdditions/WebCoreArgumentCodersAdditions.h>
 #endif
 
+} // namespace IPC
+
 #endif // WebCoreArgumentCoders_h
index 10abd59..7d9e0f0 100644 (file)
 #ifndef WebPreferencesDefinitions_h
 #define WebPreferencesDefinitions_h
 
-#if USE(APPLE_INTERNAL_SDK)
-#import <WebKitAdditions/WebPreferencesDefinitionsAdditions.h>
-#endif
-
-#if !defined(FOR_EACH_ADDITIONAL_WEBKIT_BOOL_PREFERENCE)
-#define FOR_EACH_ADDITIONAL_WEBKIT_BOOL_PREFERENCE(macro)
-#endif
-
 #if PLATFORM(GTK)
 #define DEFAULT_WEBKIT_TABSTOLINKS_ENABLED true
 #else
     macro(FetchAPIEnabled, fetchAPIEnabled, Bool, bool, false, "", "") \
     macro(DownloadAttributeEnabled, downloadAttributeEnabled, Bool, bool, false, "", "") \
     macro(SelectionPaintingWithoutSelectionGapsEnabled, selectionPaintingWithoutSelectionGapsEnabled, Bool, bool, DEFAULT_SELECTION_PAINTING_WITHOUT_SELECTION_GAPS_ENABLED, "", "") \
-    FOR_EACH_ADDITIONAL_WEBKIT_BOOL_PREFERENCE(macro) \
+    macro(ApplePayEnabled, applePayEnabled, Bool, bool, false, "", "") \
+    macro(ApplePayCapabilityDisclosureAllowed, applePayCapabilityDisclosureAllowed, Bool, bool, true, "", "") \
     \
 
 #define FOR_EACH_WEBKIT_DOUBLE_PREFERENCE(macro) \
index 1cbfa23..a78e058 100644 (file)
@@ -449,9 +449,21 @@ static _WKStorageBlockingPolicy toAPI(WebCore::SecurityOrigin::StorageBlockingPo
     _preferences->setEnabledForFeature(value, *feature->_experimentalFeature);
 }
 
-#if USE(APPLE_INTERNAL_SDK)
-#import <WebKitAdditions/WKPreferencesPrivateMethods.mm>
+- (BOOL)_applePayCapabilityDisclosureAllowed
+{
+#if ENABLE(APPLE_PAY)
+    return _preferences->applePayCapabilityDisclosureAllowed();
+#else
+    return NO;
+#endif
+}
+
+- (void)_setApplePayCapabilityDisclosureAllowed:(BOOL)applePayCapabilityDisclosureAllowed
+{
+#if ENABLE(APPLE_PAY)
+    _preferences->setApplePayCapabilityDisclosureAllowed(applePayCapabilityDisclosureAllowed);
 #endif
+}
 
 @end
 
index 92963ee..a4522c4 100644 (file)
@@ -480,8 +480,8 @@ static uint32_t convertSystemLayoutDirection(NSUserInterfaceLayoutDirection dire
     pageConfiguration->preferenceValues().set(WebKit::WebPreferencesKey::allowsAirPlayForMediaPlaybackKey(), WebKit::WebPreferencesStore::Value(!![_configuration allowsAirPlayForMediaPlayback]));
 #endif
 
-#if USE(APPLE_INTERNAL_SDK)
-#import <WebKitAdditions/WKWebViewInitialization.mm>
+#if ENABLE(APPLE_PAY)
+    pageConfiguration->preferenceValues().set(WebKit::WebPreferencesKey::applePayEnabledKey(), WebKit::WebPreferencesStore::Value(!![_configuration _applePayEnabled]));
 #endif
 
 #if PLATFORM(IOS)
index 5053fe3..aa51ad0 100644 (file)
@@ -124,8 +124,8 @@ private:
 #endif
     BOOL _initialCapitalizationEnabled;
 
-#if USE(APPLE_INTERNAL_SDK)
-#import <WebKitAdditions/WKWebViewConfigurationIvars.mm>
+#if ENABLE(APPLE_PAY)
+    BOOL _applePayEnabled;
 #endif
 }
 
@@ -303,9 +303,8 @@ private:
 #if ENABLE(WIRELESS_TARGET_PLAYBACK)
     configuration->_allowsAirPlayForMediaPlayback = self->_allowsAirPlayForMediaPlayback;
 #endif
-
-#if USE(APPLE_INTERNAL_SDK)
-#import <WebKitAdditions/WKWebViewConfigurationCopy.mm>
+#if ENABLE(APPLE_PAY)
+    configuration->_applePayEnabled = self->_applePayEnabled;
 #endif
 
     return configuration;
@@ -705,9 +704,31 @@ static NSString *defaultApplicationNameForUserAgent()
 
 #endif // PLATFORM(MAC)
 
-#if USE(APPLE_INTERNAL_SDK)
-#import <WebKitAdditions/WKWebViewConfigurationPrivateMethods.mm>
+- (BOOL)_applePayEnabled
+{
+#if ENABLE(APPLE_PAY)
+    return _applePayEnabled;
+#else
+    return NO;
+#endif
+}
+
+- (void)_setApplePayEnabled:(BOOL)applePayEnabled
+{
+#if ENABLE(APPLE_PAY)
+    _applePayEnabled = applePayEnabled;
 #endif
+}
+
+- (BOOL)_paymentsEnabled
+{
+    return self._applePayEnabled;
+}
+
+- (void)_setPaymentsEnabled:(BOOL)paymentsEnabled
+{
+    [self _setApplePayEnabled:paymentsEnabled];
+}
 
 @end
 
index 507bb8f..58dbc98 100644 (file)
@@ -55,6 +55,7 @@
 @property (nonatomic, setter=_setMediaDataLoadsAutomatically:) BOOL _mediaDataLoadsAutomatically WK_AVAILABLE(WK_MAC_TBA, WK_IOS_TBA);
 @property (nonatomic, setter=_setAttachmentElementEnabled:) BOOL _attachmentElementEnabled WK_AVAILABLE(WK_MAC_TBA, WK_IOS_TBA);
 @property (nonatomic, setter=_setInitialCapitalizationEnabled:) BOOL _initialCapitalizationEnabled WK_AVAILABLE(WK_MAC_TBA, WK_IOS_TBA);
+@property (nonatomic, setter=_setApplePayEnabled:) BOOL _applePayEnabled WK_AVAILABLE(WK_MAC_TBA, WK_IOS_TBA);
 
 #if TARGET_OS_IPHONE
 @property (nonatomic, setter=_setAlwaysRunsAtForegroundPriority:) BOOL _alwaysRunsAtForegroundPriority WK_AVAILABLE(NA, 9_0);
index f303b5c..526c716 100644 (file)
@@ -480,8 +480,8 @@ WebPageProxy::WebPageProxy(PageClient& pageClient, WebProcessProxy& process, uin
     m_vibration = WebVibrationProxy::create(this);
 #endif
 
-#if USE(APPLE_INTERNAL_SDK)
-#include <WebKitAdditions/WebPageProxyInitialization.cpp>
+#if ENABLE(APPLE_PAY)
+    m_paymentCoordinator = std::make_unique<WebPaymentCoordinatorProxy>(*this);
 #endif
 
     m_process->addMessageReceiver(Messages::WebPageProxy::messageReceiverName(), m_pageID, *this);
@@ -715,8 +715,8 @@ void WebPageProxy::reattachToWebProcess()
     m_videoFullscreenManager = WebVideoFullscreenManagerProxy::create(*this, *m_playbackSessionManager);
 #endif
 
-#if USE(APPLE_INTERNAL_SDK)
-#include <WebKitAdditions/WebPageProxyInitialization.cpp>
+#if ENABLE(APPLE_PAY)
+    m_paymentCoordinator = std::make_unique<WebPaymentCoordinatorProxy>(*this);
 #endif
 
     initializeWebPage();
@@ -5202,8 +5202,8 @@ void WebPageProxy::resetState(ResetStateReason resetStateReason)
     m_pageClient.mediaSessionManager().removeAllPlaybackTargetPickerClients(*this);
 #endif
 
-#if USE(APPLE_INTERNAL_SDK)
-#include <WebKitAdditions/WebPageProxyInvalidation.cpp>
+#if ENABLE(APPLE_PAY)
+    m_paymentCoordinator = nullptr;
 #endif
 
     CallbackBase::Error error;
index 22dc7f9..87726e2 100644 (file)
@@ -1584,8 +1584,8 @@ private:
     RefPtr<WebVibrationProxy> m_vibration;
 #endif
 
-#if USE(APPLE_INTERNAL_SDK)
-#include <WebKitAdditions/WebPageProxyMembers.h>
+#if ENABLE(APPLE_PAY)
+    std::unique_ptr<WebPaymentCoordinatorProxy> m_paymentCoordinator;
 #endif
 
     CallbackMap m_callbacks;
index 1c1a856..084c646 100644 (file)
                1AB1F78B1D1B3355007C9BD1 /* WebPaymentCoordinatorProxy.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AB1F7881D1B3355007C9BD1 /* WebPaymentCoordinatorProxy.cpp */; };
                1AB1F78C1D1B3355007C9BD1 /* WebPaymentCoordinatorProxy.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AB1F7891D1B3355007C9BD1 /* WebPaymentCoordinatorProxy.h */; };
                1AB1F7901D1B34A6007C9BD1 /* WebCoreArgumentCodersCocoa.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1AB1F78E1D1B34A6007C9BD1 /* WebCoreArgumentCodersCocoa.mm */; };
-               1AB1F7911D1B34A6007C9BD1 /* WebCoreArgumentCodersCocoa.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AB1F78F1D1B34A6007C9BD1 /* WebCoreArgumentCodersCocoa.h */; };
                1AB1F7961D1B3613007C9BD1 /* WebPaymentCoordinatorMessageReceiver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AB1F7921D1B3613007C9BD1 /* WebPaymentCoordinatorMessageReceiver.cpp */; };
                1AB1F7971D1B3613007C9BD1 /* WebPaymentCoordinatorMessages.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AB1F7931D1B3613007C9BD1 /* WebPaymentCoordinatorMessages.h */; };
                1AB1F7981D1B3613007C9BD1 /* WebPaymentCoordinatorProxyMessageReceiver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AB1F7941D1B3613007C9BD1 /* WebPaymentCoordinatorProxyMessageReceiver.cpp */; };
                1AB1F7891D1B3355007C9BD1 /* WebPaymentCoordinatorProxy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebPaymentCoordinatorProxy.h; sourceTree = "<group>"; };
                1AB1F78A1D1B3355007C9BD1 /* WebPaymentCoordinatorProxy.messages.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = WebPaymentCoordinatorProxy.messages.in; sourceTree = "<group>"; };
                1AB1F78E1D1B34A6007C9BD1 /* WebCoreArgumentCodersCocoa.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebCoreArgumentCodersCocoa.mm; sourceTree = "<group>"; };
-               1AB1F78F1D1B34A6007C9BD1 /* WebCoreArgumentCodersCocoa.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebCoreArgumentCodersCocoa.h; sourceTree = "<group>"; };
-               1AB1F7921D1B3613007C9BD1 /* WebPaymentCoordinatorMessageReceiver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = WebPaymentCoordinatorMessageReceiver.cpp; path = WebPaymentCoordinatorMessageReceiver.cpp; sourceTree = "<group>"; };
-               1AB1F7931D1B3613007C9BD1 /* WebPaymentCoordinatorMessages.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebPaymentCoordinatorMessages.h; path = WebPaymentCoordinatorMessages.h; sourceTree = "<group>"; };
-               1AB1F7941D1B3613007C9BD1 /* WebPaymentCoordinatorProxyMessageReceiver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = WebPaymentCoordinatorProxyMessageReceiver.cpp; path = WebPaymentCoordinatorProxyMessageReceiver.cpp; sourceTree = "<group>"; };
-               1AB1F7951D1B3613007C9BD1 /* WebPaymentCoordinatorProxyMessages.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebPaymentCoordinatorProxyMessages.h; path = WebPaymentCoordinatorProxyMessages.h; sourceTree = "<group>"; };
+               1AB1F7921D1B3613007C9BD1 /* WebPaymentCoordinatorMessageReceiver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebPaymentCoordinatorMessageReceiver.cpp; sourceTree = "<group>"; };
+               1AB1F7931D1B3613007C9BD1 /* WebPaymentCoordinatorMessages.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebPaymentCoordinatorMessages.h; sourceTree = "<group>"; };
+               1AB1F7941D1B3613007C9BD1 /* WebPaymentCoordinatorProxyMessageReceiver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebPaymentCoordinatorProxyMessageReceiver.cpp; sourceTree = "<group>"; };
+               1AB1F7951D1B3613007C9BD1 /* WebPaymentCoordinatorProxyMessages.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebPaymentCoordinatorProxyMessages.h; sourceTree = "<group>"; };
                1AB31A9316BC65AB00F6DBC9 /* StorageManager.messages.in */ = {isa = PBXFileReference; lastKnownFileType = text; path = StorageManager.messages.in; sourceTree = "<group>"; };
                1AB31A9416BC688100F6DBC9 /* StorageManagerMessageReceiver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StorageManagerMessageReceiver.cpp; sourceTree = "<group>"; };
                1AB31A9516BC688100F6DBC9 /* StorageManagerMessages.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StorageManagerMessages.h; sourceTree = "<group>"; };
                37C4C0901814B37B003688B9 /* cocoa */ = {
                        isa = PBXGroup;
                        children = (
-                               1AB1F78E1D1B34A6007C9BD1 /* WebCoreArgumentCodersCocoa.mm */,
-                               1AB1F78F1D1B34A6007C9BD1 /* WebCoreArgumentCodersCocoa.h */,
                                1A1EF1971A1D5B420023200A /* APIDataCocoa.mm */,
                                378E1A3B181ED6FF0031007A /* APIObject.mm */,
                                37BEC4DF19491486008B4286 /* CompletionHandlerCallChecker.h */,
                                37BEC4DE19491486008B4286 /* CompletionHandlerCallChecker.mm */,
                                C55F916C1C595E440029E92D /* DataDetectionResult.h */,
                                C55F916D1C595E440029E92D /* DataDetectionResult.mm */,
+                               1AB1F78E1D1B34A6007C9BD1 /* WebCoreArgumentCodersCocoa.mm */,
                                37C4C0921814B3AF003688B9 /* WKNSArray.h */,
                                37C4C0911814B3AF003688B9 /* WKNSArray.mm */,
                                373CEAD4185417AE008C363D /* WKNSData.h */,
                                1AD01BCD1905D54900C9C45F /* WKReloadFrameErrorRecoveryAttempter.h in Headers */,
                                1A9E329B1822E1CC00F5D04C /* WKRemoteObject.h in Headers */,
                                1A9E329F1822FEDD00F5D04C /* WKRemoteObjectCoder.h in Headers */,
-                               1AB1F7911D1B34A6007C9BD1 /* WebCoreArgumentCodersCocoa.h in Headers */,
                                37948409150C4B9700E52CE9 /* WKRenderLayer.h in Headers */,
                                37608823150414F700FC82C7 /* WKRenderObject.h in Headers */,
                                3336763B130C99DC006C9DE2 /* WKResourceCacheManager.h in Headers */,
index fffd3d0..f5f5a12 100644 (file)
@@ -92,6 +92,7 @@
 #include "WebPageMessages.h"
 #include "WebPageOverlay.h"
 #include "WebPageProxyMessages.h"
+#include "WebPaymentCoordinator.h"
 #include "WebPlugInClient.h"
 #include "WebPopupMenu.h"
 #include "WebPreferencesDefinitions.h"
 #include <WebCore/MediaPlayerRequestInstallMissingPluginsCallback.h>
 #endif
 
-#if USE(APPLE_INTERNAL_SDK)
-#include <WebKitAdditions/WebPageIncludes.h>
-#endif
-
 using namespace JSC;
 using namespace WebCore;
 
@@ -412,8 +409,8 @@ WebPage::WebPage(uint64_t pageID, const WebPageCreationParameters& parameters)
     pageConfiguration.userContentProvider = m_userContentController.ptr();
     pageConfiguration.visitedLinkStore = VisitedLinkTableController::getOrCreate(parameters.visitedLinkTableID);
 
-#if USE(APPLE_INTERNAL_SDK)
-#include <WebKitAdditions/WebPageInitialization.h>
+#if ENABLE(APPLE_PAY)
+    pageConfiguration.paymentCoordinatorClient = new WebPaymentCoordinator(*this);
 #endif
 
     m_page = std::make_unique<Page>(WTFMove(pageConfiguration));
@@ -3108,8 +3105,9 @@ void WebPage::updatePreferences(const WebPreferencesStore& store)
     if (systemLayoutDirectionCandidate == WebCore::LTR || systemLayoutDirectionCandidate == WebCore::RTL)
         settings.setSystemLayoutDirection(systemLayoutDirectionCandidate);
 
-#if USE(APPLE_INTERNAL_SDK)
-#include <WebKitAdditions/WebPagePreferences.cpp>
+#if ENABLE(APPLE_PAY)
+    settings.setApplePayEnabled(store.getBoolValueForKey(WebPreferencesKey::applePayEnabledKey()));
+    settings.setApplePayCapabilityDisclosureAllowed(store.getBoolValueForKey(WebPreferencesKey::applePayCapabilityDisclosureAllowedKey()));
 #endif
 
 #if PLATFORM(IOS)