2012-03-23 Zan Dobersek <zandobersek@gmail.com>
+ [Gtk] Webkit fails to build with --disable-geolocation
+ https://bugs.webkit.org/show_bug.cgi?id=81451
+
+ Reviewed by Benjamin Poulain.
+
+ Wrap uses of WebCore::Geolocation in WebKitGeolocationPolicyDecision
+ and WebKitWebView in ifdefs, removing compilation errors when compiling
+ with geolocation support disabled. Affected public API methods are then
+ stubs, throwing a warning that feature was not enabled at compile-time.
+
+ * webkit/webkitgeolocationpolicydecision.cpp:
+ (_WebKitGeolocationPolicyDecisionPrivate):
+ (webkit_geolocation_policy_decision_new):
+ (webkit_geolocation_policy_allow):
+ (webkit_geolocation_policy_deny):
+ * webkit/webkitgeolocationpolicydecisionprivate.h:
+ * webkit/webkitwebview.cpp:
+ (webkit_web_view_init):
+
+2012-03-23 Zan Dobersek <zandobersek@gmail.com>
+
[GObject bindings] Supplemental interfaces are not disabled with the "Conditional" attribute
https://bugs.webkit.org/show_bug.cgi?id=80030
#include "Geolocation.h"
#include "webkitgeolocationpolicydecisionprivate.h"
-
-using namespace WebCore;
+#include "webkitglobalsprivate.h"
/**
* SECTION:webkitgeolocationpolicydecision
struct _WebKitGeolocationPolicyDecisionPrivate {
WebKitWebFrame* frame;
- Geolocation* geolocation;
+#if ENABLE(GEOLOCATION)
+ WebCore::Geolocation* geolocation;
+#endif
};
static void webkit_geolocation_policy_decision_class_init(WebKitGeolocationPolicyDecisionClass* decisionClass)
decision->priv = G_TYPE_INSTANCE_GET_PRIVATE(decision, WEBKIT_TYPE_GEOLOCATION_POLICY_DECISION, WebKitGeolocationPolicyDecisionPrivate);
}
-WebKitGeolocationPolicyDecision* webkit_geolocation_policy_decision_new(WebKitWebFrame* frame, Geolocation* geolocation)
+#if ENABLE(GEOLOCATION)
+WebKitGeolocationPolicyDecision* webkit_geolocation_policy_decision_new(WebKitWebFrame* frame, WebCore::Geolocation* geolocation)
{
g_return_val_if_fail(frame, NULL);
WebKitGeolocationPolicyDecision* decision = WEBKIT_GEOLOCATION_POLICY_DECISION(g_object_new(WEBKIT_TYPE_GEOLOCATION_POLICY_DECISION, NULL));
priv->geolocation = geolocation;
return decision;
}
+#endif
/**
* webkit_geolocation_policy_allow
*/
void webkit_geolocation_policy_allow(WebKitGeolocationPolicyDecision* decision)
{
+#if ENABLE(GEOLOCATION)
g_return_if_fail(WEBKIT_IS_GEOLOCATION_POLICY_DECISION(decision));
WebKitGeolocationPolicyDecisionPrivate* priv = decision->priv;
priv->geolocation->setIsAllowed(TRUE);
+#else
+ WEBKIT_WARN_FEATURE_NOT_PRESENT("Geolocation")
+#endif
}
/**
*/
void webkit_geolocation_policy_deny(WebKitGeolocationPolicyDecision* decision)
{
+#if ENABLE(GEOLOCATION)
g_return_if_fail(WEBKIT_IS_GEOLOCATION_POLICY_DECISION(decision));
WebKitGeolocationPolicyDecisionPrivate* priv = decision->priv;
priv->geolocation->setIsAllowed(FALSE);
+#else
+ WEBKIT_WARN_FEATURE_NOT_PRESENT("Geolocation")
+#endif
}
#endif
if (DumpRenderTreeSupportGtk::dumpRenderTreeModeEnabled()) {
+#if ENABLE(GEOLOCATION)
static_cast<GeolocationClientMock*>(pageClients.geolocationClient)->setController(priv->corePage->geolocationController());
+#endif
// Set some testing-specific settings
priv->corePage->settings()->setInteractiveFormValidationEnabled(true);
priv->corePage->settings()->setValidationMessageTimerMagnification(-1);