2009-07-03 Jan Michael Alonzo <jmalonzo@webkit.org>
authorjmalonzo@webkit.org <jmalonzo@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 3 Jul 2009 09:57:39 +0000 (09:57 +0000)
committerjmalonzo@webkit.org <jmalonzo@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 3 Jul 2009 09:57:39 +0000 (09:57 +0000)
        Reviewed by Xan Lopez and Gustavo Noronha.

        Set user-agent from application
        https://bugs.webkit.org/show_bug.cgi?id=17375

        Add 'user-agent' setter/getter API to WebSettings.

        * WebCoreSupport/FrameLoaderClientGtk.cpp:
        (WebKit::FrameLoaderClient::FrameLoaderClient):
        (WebKit::FrameLoaderClient::userAgent):
        * WebCoreSupport/FrameLoaderClientGtk.h:
        * webkit/webkitprivate.h:
        * webkit/webkitversion.h.in:
        * webkit/webkitwebsettings.cpp:
        (webkit_get_user_agent):
        (webkit_web_settings_class_init):
        (webkit_web_settings_finalize):
        (webkit_web_settings_set_property):
        (webkit_web_settings_get_property):
        (webkit_web_settings_copy):
        (webkit_web_settings_get_user_agent):
        * webkit/webkitwebsettings.h:
        * webkit/webkitwebview.cpp:
        (webkit_web_view_dispose):

        Define UA version macros to be used by the UA string.
        Add new WebSettings unit test for the User-Agent string API.

        * GNUmakefile.am:
        * configure.ac:

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

12 files changed:
ChangeLog
GNUmakefile.am
WebKit/gtk/ChangeLog
WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp
WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.h
WebKit/gtk/tests/testwebsettings.c [new file with mode: 0644]
WebKit/gtk/webkit/webkitprivate.h
WebKit/gtk/webkit/webkitversion.h.in
WebKit/gtk/webkit/webkitwebsettings.cpp
WebKit/gtk/webkit/webkitwebsettings.h
WebKit/gtk/webkit/webkitwebview.cpp
configure.ac

index f2cc9a2..e440123 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2009-07-03  Jan Michael Alonzo  <jmalonzo@webkit.org>
+
+        Reviewed by Xan Lopez and Gustavo Noronha.
+
+        Set user-agent from application
+        https://bugs.webkit.org/show_bug.cgi?id=17375
+
+        Define UA version macros to be used by the UA string.
+        Add new WebSettings unit test for the User-Agent string API.
+
+        * GNUmakefile.am:
+        * configure.ac:
+
 2009-06-20  Gustavo Noronha Silva  <gns@gnome.org>
 
         Reviewed by Jan Alonzo.
index d2b2c71..c80d649 100644 (file)
@@ -532,7 +532,8 @@ TEST_PROGS += Programs/unittests/testhttpbackend \
        Programs/unittests/testwebbackforwardlist \
        Programs/unittests/testwebhistoryitem \
        Programs/unittests/testdownload \
-       Programs/unittests/testatk
+       Programs/unittests/testatk \
+       Programs/unittests/testwebsettings
 
 # Add additional tests here
 Programs_unittests_testhttpbackend_SOURCES = WebKit/gtk/tests/testhttpbackend.c
@@ -575,6 +576,11 @@ Programs_unittests_testatk_CFLAGS = $(webkit_tests_cflags)
 Programs_unittests_testatk_LDADD = $(webkit_tests_ldadd)
 Programs_unittests_testatk_LDFLAGS = $(webkit_tests_ldflags)
 
+Programs_unittests_testwebsettings_SOURCES = WebKit/gtk/tests/testwebsettings.c
+Programs_unittests_testwebsettings_CFLAGS = $(webkit_tests_cflags)
+Programs_unittests_testwebsettings_LDADD = $(webkit_tests_ldadd)
+Programs_unittests_testwebsettings_LDFLAGS = $(webkit_tests_ldflags)
+
 # Autogenerated sources
 BUILT_SOURCES := \
        $(javascriptcore_built_sources) \
index 9ea4760..ca71db8 100644 (file)
@@ -1,3 +1,30 @@
+2009-07-03  Jan Michael Alonzo  <jmalonzo@webkit.org>
+
+        Reviewed by Xan Lopez and Gustavo Noronha.
+
+        Set user-agent from application
+        https://bugs.webkit.org/show_bug.cgi?id=17375
+
+        Add 'user-agent' setter/getter API to WebSettings.
+
+        * WebCoreSupport/FrameLoaderClientGtk.cpp:
+        (WebKit::FrameLoaderClient::FrameLoaderClient):
+        (WebKit::FrameLoaderClient::userAgent):
+        * WebCoreSupport/FrameLoaderClientGtk.h:
+        * webkit/webkitprivate.h:
+        * webkit/webkitversion.h.in:
+        * webkit/webkitwebsettings.cpp:
+        (webkit_get_user_agent):
+        (webkit_web_settings_class_init):
+        (webkit_web_settings_finalize):
+        (webkit_web_settings_set_property):
+        (webkit_web_settings_get_property):
+        (webkit_web_settings_copy):
+        (webkit_web_settings_get_user_agent):
+        * webkit/webkitwebsettings.h:
+        * webkit/webkitwebview.cpp:
+        (webkit_web_view_dispose):
+
 2009-07-02  Xan Lopez  <xlopez@igalia.com>
 
         Reviewed by Holger Freyther.
index f0776f9..ec15762 100644 (file)
@@ -64,9 +64,6 @@
 #include <glib.h>
 #include <glib/gi18n-lib.h>
 #include <stdio.h>
-#if PLATFORM(UNIX)
-#include <sys/utsname.h>
-#endif
 
 using namespace WebCore;
 
@@ -74,7 +71,6 @@ namespace WebKit {
 
 FrameLoaderClient::FrameLoaderClient(WebKitWebFrame* frame)
     : m_frame(frame)
-    , m_userAgent("")
     , m_policyDecision(0)
     , m_pluginView(0)
     , m_hasSentResponseToPlugin(false)
@@ -88,86 +84,10 @@ FrameLoaderClient::~FrameLoaderClient()
         g_object_unref(m_policyDecision);
 }
 
-static String agentPlatform()
-{
-#ifdef GDK_WINDOWING_X11
-    return "X11";
-#elif defined(GDK_WINDOWING_WIN32)
-    return "Windows";
-#elif defined(GDK_WINDOWING_QUARTZ)
-    return "Macintosh";
-#elif defined(GDK_WINDOWING_DIRECTFB)
-    return "DirectFB";
-#else
-    notImplemented();
-    return "Unknown";
-#endif
-}
-
-static String agentOS()
-{
-#if PLATFORM(DARWIN)
-#if PLATFORM(X86)
-    return "Intel Mac OS X";
-#else
-    return "PPC Mac OS X";
-#endif
-#elif PLATFORM(UNIX)
-    struct utsname name;
-    if (uname(&name) != -1)
-        return String::format("%s %s", name.sysname, name.machine);
-    else
-        return "Unknown";
-#elif PLATFORM(WIN_OS)
-    // FIXME: Compute the Windows version
-    return "Windows";
-#else
-    notImplemented();
-    return "Unknown";
-#endif
-}
-
-static String composeUserAgent()
-{
-    // This is a liberal interpretation of http://www.mozilla.org/build/revised-user-agent-strings.html
-    // See also http://developer.apple.com/internet/safari/faq.html#anchor2
-
-    String ua;
-
-    // Product
-    ua += "Mozilla/5.0";
-
-    // Comment
-    ua += " (";
-    ua += agentPlatform(); // Platform
-    ua += "; U; "; // Security
-    ua += agentOS(); // OS-or-CPU
-    ua += "; ";
-    ua += defaultLanguage(); // Localization information
-    ua += ") ";
-
-    // WebKit Product
-    // FIXME: The WebKit version is hardcoded
-    static const String webKitVersion = "528.5+";
-    ua += "AppleWebKit/" + webKitVersion;
-    ua += " (KHTML, like Gecko, ";
-    // We mention Safari since many broken sites check for it (OmniWeb does this too)
-    // We re-use the WebKit version, though it doesn't seem to matter much in practice
-    ua += "Safari/" + webKitVersion;
-    ua += ") ";
-
-    // Vendor Product
-    ua += g_get_prgname();
-
-    return ua;
-}
-
 String FrameLoaderClient::userAgent(const KURL&)
 {
-    if (m_userAgent.isEmpty())
-        m_userAgent = composeUserAgent();
-
-    return m_userAgent;
+    WebKitWebSettings* settings = webkit_web_view_get_settings(getViewFromFrame(m_frame));
+    return String::fromUTF8(webkit_web_settings_get_user_agent(settings));
 }
 
 static void notifyStatus(WebKitWebFrame* frame, WebKitLoadStatus loadStatus)
index f85c63a..b0ceed6 100644 (file)
@@ -173,7 +173,6 @@ namespace WebKit {
     private:
         WebKitWebFrame* m_frame;
         WebCore::ResourceResponse m_response;
-        WebCore::String m_userAgent;
         WebKitWebPolicyDecision* m_policyDecision;
 
         // Plugin view to redirect data to
diff --git a/WebKit/gtk/tests/testwebsettings.c b/WebKit/gtk/tests/testwebsettings.c
new file mode 100644 (file)
index 0000000..457e57b
--- /dev/null
@@ -0,0 +1,81 @@
+/*
+ * Copyright (C) 2009 Jan Michael Alonzo
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include <glib.h>
+#include <gtk/gtk.h>
+#include <webkit/webkit.h>
+
+#if GLIB_CHECK_VERSION(2, 16, 0) && GTK_CHECK_VERSION(2, 14, 0)
+
+static void test_webkit_web_settings_user_agent(void)
+{
+    WebKitWebSettings* settings;
+    WebKitWebView* webView;
+    gchar* defaultUserAgent;
+    gchar* userAgent;
+    g_test_bug("17375");
+
+    webView = webkit_web_view_new();
+    g_object_ref_sink(webView);
+
+    settings = webkit_web_view_get_settings(webView);
+    defaultUserAgent = g_strdup(webkit_web_settings_get_user_agent(settings));
+
+    // test a custom UA string
+    userAgent = NULL;
+    g_object_set(G_OBJECT(settings), "user-agent", "testwebsettings/0.1", NULL);
+    g_object_get(G_OBJECT(settings),"user-agent", &userAgent, NULL);
+    g_assert_cmpstr(userAgent, ==, "testwebsettings/0.1");
+    g_free(userAgent);
+
+    // setting it to NULL or an empty value should give us the default UA string
+    userAgent = NULL;
+    g_object_set(G_OBJECT(settings), "user-agent", NULL, NULL);
+    g_object_get(G_OBJECT(settings),"user-agent", &userAgent, NULL);
+    g_assert_cmpstr(userAgent, ==, defaultUserAgent);
+    g_free(userAgent);
+
+    userAgent = NULL;
+    g_object_set(G_OBJECT(settings), "user-agent", "", NULL);
+    g_object_get(G_OBJECT(settings),"user-agent", &userAgent, NULL);
+    g_assert_cmpstr(userAgent, ==, defaultUserAgent);
+    g_free(userAgent);
+
+    g_free(defaultUserAgent);
+    g_object_unref(webView);
+}
+
+int main(int argc, char** argv)
+{
+    g_thread_init(NULL);
+    gtk_test_init(&argc, &argv, NULL);
+
+    g_test_bug_base("https://bugs.webkit.org/");
+    g_test_add_func("/webkit/websettings/user_agent", test_webkit_web_settings_user_agent);
+    return g_test_run ();
+}
+
+#else
+int main(int argc, char** argv)
+{
+    g_critical("You will need at least glib-2.16.0 and gtk-2.14.0 to run the unit tests. Doing nothing now.");
+    return 0;
+}
+
+#endif
index 13fcd16..1d18434 100644 (file)
@@ -98,9 +98,6 @@ extern "C" {
         WebKitWebWindowFeatures* webWindowFeatures;
 
         WebKitWebFrame* mainFrame;
-        WebCore::String applicationNameForUserAgent;
-        WebCore::String* userAgent;
-
         WebKitWebBackForwardList* backForwardList;
 
         gint lastPopupXPosition;
index f70800d..9f1b818 100644 (file)
@@ -28,6 +28,8 @@ G_BEGIN_DECLS
 #define WEBKIT_MAJOR_VERSION (@WEBKIT_MAJOR_VERSION@)
 #define WEBKIT_MINOR_VERSION (@WEBKIT_MINOR_VERSION@)
 #define WEBKIT_MICRO_VERSION (@WEBKIT_MICRO_VERSION@)
+#define WEBKIT_USER_AGENT_MAJOR_VERSION (@WEBKIT_USER_AGENT_MAJOR_VERSION@)
+#define WEBKIT_USER_AGENT_MINOR_VERSION (@WEBKIT_USER_AGENT_MINOR_VERSION@)
 
 #define WEBKIT_CHECK_VERSION(major, minor, micro) \
   (WEBKIT_MAJOR_VERSION > (major) || \
index 2f1886c..eb2b9d5 100644 (file)
@@ -3,6 +3,7 @@
  * Copyright (C) 2008 Nuanti Ltd.
  * Copyright (C) 2008 Collabora Ltd.
  * Copyright (C) 2008 Holger Hans Peter Freyther
+ * Copyright (C) 2009 Jan Michael Alonzo
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Library General Public
  */
 
 #include "config.h"
-
 #include "webkitwebsettings.h"
+
 #include "webkitprivate.h"
+#include "webkitversion.h"
 
-#include <glib/gi18n-lib.h>
+#include "CString.h"
 #include "FileSystem.h"
 #include "PluginDatabase.h"
+#include "Language.h"
+#include "PlatformString.h"
+
+#include <glib/gi18n-lib.h>
+#if PLATFORM(UNIX)
+#include <sys/utsname.h>
+#endif
 
 /**
  * SECTION:webkitwebsettings
@@ -81,6 +90,7 @@ struct _WebKitWebSettingsPrivate {
     gboolean enable_html5_database;
     gboolean enable_html5_local_storage;
     gboolean enable_xss_auditor;
+    gchar* user_agent;
 };
 
 #define WEBKIT_WEB_SETTINGS_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), WEBKIT_TYPE_WEB_SETTINGS, WebKitWebSettingsPrivate))
@@ -115,9 +125,67 @@ enum {
     PROP_ENABLE_CARET_BROWSING,
     PROP_ENABLE_HTML5_DATABASE,
     PROP_ENABLE_HTML5_LOCAL_STORAGE,
-    PROP_ENABLE_XSS_AUDITOR
+    PROP_ENABLE_XSS_AUDITOR,
+    PROP_USER_AGENT
 };
 
+// Create a default user agent string
+// This is a liberal interpretation of http://www.mozilla.org/build/revised-user-agent-strings.html
+// See also http://developer.apple.com/internet/safari/faq.html#anchor2
+static String webkit_get_user_agent()
+{
+    gchar* platform;
+    gchar* osVersion;
+
+#if PLATFORM(X11)
+    platform = g_strdup("X11");
+#elif PLATFORM(WIN_OS)
+    platform = g_strdup("Windows");
+#elif PLATFORM(MAC)
+    platform = g_strdup("Macintosh");
+#elif defined(GDK_WINDOWING_DIRECTFB)
+    platform = g_strdup("DirectFB");
+#else
+    platform = g_strdup("Unknown");
+#endif
+
+   // FIXME: platform/version detection can be shared.
+#if PLATFORM(DARWIN)
+
+#if PLATFORM(X86)
+    osVersion = g_strdup("Intel Mac OS X");
+#else
+    osVersion = g_strdup("PPC Mac OS X");
+#endif
+
+#elif PLATFORM(UNIX)
+    struct utsname name;
+    if (uname(&name) != -1)
+        osVersion = g_strdup_printf("%s %s", name.sysname, name.machine);
+    else
+        osVersion = g_strdup("Unknown");
+
+#elif PLATFORM(WIN_OS)
+    // FIXME: Compute the Windows version
+    osVersion = g_strdup("Windows");
+
+#else
+    osVersion = g_strdup("Unknown");
+#endif
+
+    // We mention Safari since many broken sites check for it (OmniWeb does this too)
+    // We re-use the WebKit version, though it doesn't seem to matter much in practice
+
+    DEFINE_STATIC_LOCAL(const String, uaVersion, (String::format("%d.%d+", WEBKIT_USER_AGENT_MAJOR_VERSION, WEBKIT_USER_AGENT_MINOR_VERSION)));
+    DEFINE_STATIC_LOCAL(const String, staticUA, (String::format("Mozilla/5.0 (%s; U; %s; %s) AppleWebKit/%s (KHTML, like Gecko) Safari/%s",
+                                                                platform, osVersion, defaultLanguage().utf8().data(), uaVersion.utf8().data(), uaVersion.utf8().data())));
+
+    g_free(osVersion);
+    g_free(platform);
+
+    return staticUA;
+}
+
 static void webkit_web_settings_finalize(GObject* object);
 
 static void webkit_web_settings_set_property(GObject* object, guint prop_id, const GValue* value, GParamSpec* pspec);
@@ -474,6 +542,25 @@ static void webkit_web_settings_class_init(WebKitWebSettingsClass* klass)
                                                          FALSE,
                                                          flags));
 
+    /**
+     * WebKitWebSettings:user-agent:
+     *
+     * The User-Agent string used by WebKitGtk.
+     *
+     * This will return a default User-Agent string if a custom string wasn't
+     * provided by the application. Setting this property to a NULL value or
+     * an empty string will result in the User-Agent string being reset to the
+     * default value.
+     *
+     * Since: 1.1.11
+     */
+    g_object_class_install_property(gobject_class, PROP_USER_AGENT,
+                                    g_param_spec_string("user-agent",
+                                                        _("User Agent"),
+                                                        _("The User-Agent string used by WebKitGtk"),
+                                                        webkit_get_user_agent().utf8().data(),
+                                                        flags));
+
     g_type_class_add_private(klass, sizeof(WebKitWebSettingsPrivate));
 }
 
@@ -512,6 +599,8 @@ static void webkit_web_settings_finalize(GObject* object)
     g_slist_foreach(priv->spell_checking_languages_list, free_spell_checking_language, NULL);
     g_slist_free(priv->spell_checking_languages_list);
 
+    g_free(priv->user_agent);
+
     G_OBJECT_CLASS(webkit_web_settings_parent_class)->finalize(object);
 }
 
@@ -639,6 +728,13 @@ static void webkit_web_settings_set_property(GObject* object, guint prop_id, con
     case PROP_ENABLE_XSS_AUDITOR:
         priv->enable_xss_auditor = g_value_get_boolean(value);
         break;
+    case PROP_USER_AGENT:
+        g_free(priv->user_agent);
+        if (!g_value_get_string(value) || !strlen(g_value_get_string(value)))
+            priv->user_agent = g_strdup(webkit_get_user_agent().utf8().data());
+        else
+            priv->user_agent = g_strdup(g_value_get_string(value));
+        break;
     default:
         G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
         break;
@@ -735,6 +831,9 @@ static void webkit_web_settings_get_property(GObject* object, guint prop_id, GVa
     case PROP_ENABLE_XSS_AUDITOR:
         g_value_set_boolean(value, priv->enable_xss_auditor);
         break;
+    case PROP_USER_AGENT:
+        g_value_set_string(value, priv->user_agent);
+        break;
     default:
         G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
         break;
@@ -794,6 +893,7 @@ WebKitWebSettings* webkit_web_settings_copy(WebKitWebSettings* web_settings)
                  "enable-html5-database", priv->enable_html5_database,
                  "enable-html5-local-storage", priv->enable_html5_local_storage,
                  "enable-xss-auditor", priv->enable_xss_auditor,
+                 "user-agent", webkit_web_settings_get_user_agent(web_settings),
                  NULL));
 
     return copy;
@@ -834,3 +934,21 @@ GSList* webkit_web_settings_get_spell_languages(WebKitWebView *web_view)
 
     return list;
 }
+
+/**
+ * webkit_web_settings_get_user_agent:
+ * @web_settings: a #WebKitWebSettings
+ *
+ * Returns the User-Agent string currently used by the web view(s) associated
+ * with the @web_settings.
+ *
+ * Since: 1.1.11
+ */
+G_CONST_RETURN gchar* webkit_web_settings_get_user_agent(WebKitWebSettings* webSettings)
+{
+    g_return_val_if_fail(WEBKIT_IS_WEB_SETTINGS(webSettings), NULL);
+
+    WebKitWebSettingsPrivate* priv = webSettings->priv;
+
+    return priv->user_agent;
+}
index 5d25fee..9eac321 100644 (file)
@@ -1,5 +1,6 @@
 /*
  * Copyright (C) 2008 Christian Dywan <christian@imendio.com>
+ * Copyright (C) 2009 Jan Michael Alonzo <jmalonzo@gmail.com
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Library General Public
@@ -53,13 +54,16 @@ struct _WebKitWebSettingsClass {
 };
 
 WEBKIT_API GType
-webkit_web_settings_get_type (void);
+webkit_web_settings_get_type          (void);
 
 WEBKIT_API WebKitWebSettings *
-webkit_web_settings_new      (void);
+webkit_web_settings_new               (void);
 
 WEBKIT_API WebKitWebSettings *
-webkit_web_settings_copy     (WebKitWebSettings *web_settings);
+webkit_web_settings_copy              (WebKitWebSettings *web_settings);
+
+WEBKIT_API G_CONST_RETURN gchar *
+webkit_web_settings_get_user_agent    (WebKitWebSettings *web_settings);
 
 G_END_DECLS
 
index 22492e6..c50757f 100644 (file)
@@ -934,9 +934,6 @@ static void webkit_web_view_dispose(GObject* object)
 
         gtk_target_list_unref(priv->paste_target_list);
         priv->paste_target_list = NULL;
-
-        delete priv->userAgent;
-        priv->userAgent = NULL;
     }
 
     G_OBJECT_CLASS(webkit_web_view_parent_class)->dispose(object);
index b720a43..3b2ed87 100644 (file)
@@ -4,6 +4,13 @@ m4_define([webkit_major_version], [1])
 m4_define([webkit_minor_version], [1])
 m4_define([webkit_micro_version], [10])
 
+# This is the version we'll be using as part of our User-Agent string
+# e.g., AppleWebKit/$(webkit_user_agent_version) ...
+#
+# Sourced from WebCore/Configurations/Version.xcconfig
+m4_define([webkit_user_agent_major_version], [531])
+m4_define([webkit_user_agent_minor_version], [2])
+
 AC_INIT([WebKit],[webkit_major_version.webkit_minor_version.webkit_micro_version],[http://bugs.webkit.org/])
 
 AC_CONFIG_MACRO_DIR([autotools])
@@ -16,9 +23,13 @@ AC_CANONICAL_HOST
 WEBKIT_MAJOR_VERSION=webkit_major_version
 WEBKIT_MINOR_VERSION=webkit_minor_version
 WEBKIT_MICRO_VERSION=webkit_micro_version
+WEBKIT_USER_AGENT_MAJOR_VERSION=webkit_user_agent_major_version
+WEBKIT_USER_AGENT_MINOR_VERSION=webkit_user_agent_minor_version
 AC_SUBST(WEBKIT_MAJOR_VERSION)
 AC_SUBST(WEBKIT_MINOR_VERSION)
 AC_SUBST(WEBKIT_MICRO_VERSION)
+AC_SUBST(WEBKIT_USER_AGENT_MAJOR_VERSION)
+AC_SUBST(WEBKIT_USER_AGENT_MINOR_VERSION)
 
 AC_CONFIG_SRCDIR([WebCore/config.h])