Skip to content
Permalink
Browse files
Inline more of the Apple Pay source code
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):

Canonical link: https://commits.webkit.org/177203@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@202444 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
Anders Carlsson committed Jun 24, 2016
1 parent 882035d commit 92dc9bb51e4ee4a06d773cf0edd5c279e5e1586c
@@ -1,3 +1,16 @@
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.
@@ -289,16 +289,20 @@ class Settings : public RefCounted<Settings> {
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 @@ class Settings : public RefCounted<Settings> {
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
@@ -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

This file was deleted.

@@ -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
@@ -26,14 +26,6 @@
#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
@@ -236,7 +228,8 @@
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) \
@@ -449,9 +449,21 @@ - (void)_setEnabled:(BOOL)value forFeature:(_WKExperimentalFeature *)feature
_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

@@ -480,8 +480,8 @@ - (void)_initializeWithConfiguration:(WKWebViewConfiguration *)configuration
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)
@@ -124,8 +124,8 @@ @implementation WKWebViewConfiguration {
#endif
BOOL _initialCapitalizationEnabled;

#if USE(APPLE_INTERNAL_SDK)
#import <WebKitAdditions/WKWebViewConfigurationIvars.mm>
#if ENABLE(APPLE_PAY)
BOOL _applePayEnabled;
#endif
}

@@ -303,9 +303,8 @@ - (id)copyWithZone:(NSZone *)zone
#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 @@ - (void)_setRequiresUserActionForEditingControlsManager:(BOOL)requiresUserAction

#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

@@ -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);

0 comments on commit 92dc9bb

Please sign in to comment.