Replace WebRTCLegacyAPIDisabled by WebRTCLegacyAPIEnabled and switch off WebRTC legac...
[WebKit-https.git] / Source / WebKit / UIProcess / API / C / WKPreferences.cpp
index d303e49..b2f4f79 100644 (file)
 #include <WebCore/Settings.h>
 #include <wtf/RefPtr.h>
 
+#if ENABLE(APPLE_PAY)
+#include "WebPaymentCoordinatorProxy.h"
+#endif
+
 using namespace WebKit;
 
 WKTypeID WKPreferencesGetTypeID()
@@ -870,14 +874,14 @@ bool WKPreferencesGetModernMediaControlsEnabled(WKPreferencesRef preferencesRef)
     return toImpl(preferencesRef)->modernMediaControlsEnabled();
 }
 
-void WKPreferencesSetCredentialManagementEnabled(WKPreferencesRef preferencesRef, bool flag)
+void WKPreferencesSetWebAuthenticationEnabled(WKPreferencesRef preferencesRef, bool flag)
 {
-    toImpl(preferencesRef)->setCredentialManagementEnabled(flag);
+    toImpl(preferencesRef)->setWebAuthenticationEnabled(flag);
 }
 
-bool WKPreferencesGetCredentialManagementEnabled(WKPreferencesRef preferencesRef)
+bool WKPreferencesGetWebAuthenticationEnabled(WKPreferencesRef preferencesRef)
 {
-    return toImpl(preferencesRef)->credentialManagementEnabled();
+    return toImpl(preferencesRef)->webAuthenticationEnabled();
 }
 
 void WKPreferencesSetInvisibleMediaAutoplayPermitted(WKPreferencesRef preferencesRef, bool flag)
@@ -1412,12 +1416,12 @@ bool WKPreferencesGetPeerConnectionEnabled(WKPreferencesRef preferencesRef)
 
 void WKPreferencesSetWebRTCLegacyAPIEnabled(WKPreferencesRef preferencesRef, bool enabled)
 {
-    toImpl(preferencesRef)->setWebRTCLegacyAPIDisabled(!enabled);
+    toImpl(preferencesRef)->setWebRTCLegacyAPIEnabled(enabled);
 }
 
 bool WKPreferencesGetWebRTCLegacyAPIEnabled(WKPreferencesRef preferencesRef)
 {
-    return !toImpl(preferencesRef)->webRTCLegacyAPIDisabled();
+    return toImpl(preferencesRef)->webRTCLegacyAPIEnabled();
 }
 
 void WKPreferencesSetSpatialNavigationEnabled(WKPreferencesRef preferencesRef, bool enabled)
@@ -1777,6 +1781,10 @@ WK_EXPORT bool WKPreferencesGetApplePayEnabled(WKPreferencesRef preferencesRef)
 
 void WKPreferencesSetApplePayEnabled(WKPreferencesRef preferencesRef, bool enabled)
 {
+#if ENABLE(APPLE_PAY)
+    if (!WebPaymentCoordinatorProxy::platformSupportsPayments())
+        enabled = false;
+#endif
     WebKit::toImpl(preferencesRef)->setApplePayEnabled(enabled);
 }
 
@@ -1920,12 +1928,23 @@ bool WKPreferencesGetAccessibilityObjectModelEnabled(WKPreferencesRef preference
     return toImpl(preferencesRef)->accessibilityObjectModelEnabled();
 }
 
-void WKPreferencesSetShouldDisallowUserInstalledFonts(WKPreferencesRef preferencesRef, bool flag)
+void WKPreferencesSetShouldAllowUserInstalledFonts(WKPreferencesRef preferencesRef, bool flag)
+{
+    toImpl(preferencesRef)->setShouldAllowUserInstalledFonts(flag);
+}
+
+bool WKPreferencesGetShouldAllowUserInstalledFonts(WKPreferencesRef preferencesRef)
 {
-    toImpl(preferencesRef)->setShouldDisallowUserInstalledFonts(flag);
+    return toImpl(preferencesRef)->shouldAllowUserInstalledFonts();
 }
 
-bool WKPreferencesGetShouldDisallowUserInstalledFonts(WKPreferencesRef preferencesRef)
+void WKPreferencesSetMediaCapabilitiesEnabled(WKPreferencesRef preferencesRef, bool enabled)
 {
-    return toImpl(preferencesRef)->shouldDisallowUserInstalledFonts();
+    toImpl(preferencesRef)->setMediaCapabilitiesEnabled(enabled);
 }
+
+bool WKPreferencesGetMediaCapabilitiesEnabled(WKPreferencesRef preferencesRef)
+{
+    return toImpl(preferencesRef)->mediaCapabilitiesEnabled();
+}
+