[SCM] WebKit Debian packaging branch, debian/experimental, updated. debian/1.3.8-1-142-g786665c

gyuyoung.kim at samsung.com gyuyoung.kim at samsung.com
Mon Dec 27 16:29:48 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit cedec12827c9691184fe83155f63051b79305008
Author: gyuyoung.kim at samsung.com <gyuyoung.kim at samsung.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Dec 22 08:50:51 2010 +0000

    2010-12-22  Gyuyoung Kim  <gyuyoung.kim at samsung.com>
    
            Reviewed by Antonio Gomes.
    
            [EFL] Sets default user agent
            https://bugs.webkit.org/show_bug.cgi?id=47903
    
            Add macros for WebKit EFL and User Agent.
    
            * cmake/OptionsEfl.cmake:
            * cmakeconfig.h.cmake:
    2010-12-22  Gyuyoung Kim  <gyuyoung.kim at samsung.com>
    
            Reviewed by Antonio Gomes.
    
            [EFL] Sets default user agent
            https://bugs.webkit.org/show_bug.cgi?id=47903
    
            If applcation(e.g EWebLauncher) doesn't set user agent, WebKit EFL doesn't
            set user agent. However, we need to set user agent by default. Because, some
            web sites send different pages according to user agent.
    
            * ewk/ewk_private.h:
            * ewk/ewk_settings.cpp:
            (_ewk_settings_webkit_platform):
            (_ewk_settings_webkit_os_version):
            (ewk_settings_default_user_agent_get):
            * ewk/ewk_view.cpp:
            (_ewk_view_priv_new):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@74467 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/ChangeLog b/ChangeLog
index a82f20a..0daa39c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2010-12-22  Gyuyoung Kim  <gyuyoung.kim at samsung.com>
+
+        Reviewed by Antonio Gomes.
+
+        [EFL] Sets default user agent
+        https://bugs.webkit.org/show_bug.cgi?id=47903
+
+        Add macros for WebKit EFL and User Agent.
+
+        * cmake/OptionsEfl.cmake:
+        * cmakeconfig.h.cmake:
+
 2010-12-20  Adam Barth  <abarth at webkit.org>
 
         Move web sites to Websites directory
diff --git a/WebKit/efl/ChangeLog b/WebKit/efl/ChangeLog
index c73e801..fde9fea 100644
--- a/WebKit/efl/ChangeLog
+++ b/WebKit/efl/ChangeLog
@@ -1,3 +1,22 @@
+2010-12-22  Gyuyoung Kim  <gyuyoung.kim at samsung.com>
+
+        Reviewed by Antonio Gomes.
+
+        [EFL] Sets default user agent
+        https://bugs.webkit.org/show_bug.cgi?id=47903
+
+        If applcation(e.g EWebLauncher) doesn't set user agent, WebKit EFL doesn't
+        set user agent. However, we need to set user agent by default. Because, some
+        web sites send different pages according to user agent.
+
+        * ewk/ewk_private.h:
+        * ewk/ewk_settings.cpp:
+        (_ewk_settings_webkit_platform):
+        (_ewk_settings_webkit_os_version):
+        (ewk_settings_default_user_agent_get):
+        * ewk/ewk_view.cpp:
+        (_ewk_view_priv_new):
+
 2010-12-16  Leandro Pereira  <leandro at profusion.mobi>
 
         [EFL] Unreviewed build fix.
diff --git a/WebKit/efl/ewk/ewk_private.h b/WebKit/efl/ewk/ewk_private.h
index c1599e3..7c81982 100644
--- a/WebKit/efl/ewk/ewk_private.h
+++ b/WebKit/efl/ewk/ewk_private.h
@@ -156,6 +156,8 @@ void ewk_view_contents_size_changed(Evas_Object *o, Evas_Coord w, Evas_Coord h);
 
 WebCore::FloatRect ewk_view_page_rect_get(Evas_Object *o);
 
+const char* ewk_settings_default_user_agent_get();
+
 #ifdef __cplusplus
 
 }
diff --git a/WebKit/efl/ewk/ewk_settings.cpp b/WebKit/efl/ewk/ewk_settings.cpp
index f2651a1..20051ea 100644
--- a/WebKit/efl/ewk/ewk_settings.cpp
+++ b/WebKit/efl/ewk/ewk_settings.cpp
@@ -29,15 +29,19 @@
 #include "Image.h"
 #include "IntSize.h"
 #include "KURL.h"
+#include "Language.h"
 #include "ewk_private.h"
-#include <wtf/text/CString.h>
 
+#include <Eina.h>
 #include <eina_safety_checks.h>
 #include <errno.h>
 #include <string.h>
 #include <sys/stat.h>
 #include <sys/types.h>
+#include <sys/utsname.h>
 #include <unistd.h>
+#include <wtf/text/CString.h>
+#include <wtf/text/StringConcatenate.h>
 
 #if USE(SOUP)
 #include "ResourceHandle.h"
@@ -48,6 +52,30 @@ static const char* _ewk_default_web_database_path = 0;
 static const char* _ewk_icon_database_path = 0;
 static uint64_t _ewk_default_web_database_quota = 1 * 1024 * 1024;
 
+static WTF::String _ewk_settings_webkit_platform_get()
+{
+    WTF::String ua_platform;
+#if PLATFORM(X11)
+    ua_platform = "X11";
+#else
+    ua_platform = "Unknown";
+#endif
+    return ua_platform;
+}
+
+static WTF::String _ewk_settings_webkit_os_version_get()
+{
+    WTF::String ua_os_version;
+    struct utsname name;
+
+    if (uname(&name) != -1)
+        ua_os_version = WTF::String(name.sysname) + " " + WTF::String(name.machine);
+    else
+        ua_os_version = "Unknown";
+
+    return ua_os_version;
+}
+
 /**
  * Returns the default quota for Web Database databases. By default
  * this value is 1MB.
@@ -261,3 +289,17 @@ void ewk_settings_proxy_uri_set(const char* proxy)
     EINA_SAFETY_ON_TRUE_RETURN(1);
 #endif
 }
+
+/**
+* @internal
+* Gets the default user agent string.
+*
+* @return A pointer to an eina_stringshare containing the user agent string.
+*/
+const char* ewk_settings_default_user_agent_get()
+{
+    WTF::String ua_version = makeString(String::number(WEBKIT_USER_AGENT_MAJOR_VERSION), '.', String::number(WEBKIT_USER_AGENT_MINOR_VERSION), '+');
+    WTF::String static_ua = makeString("Mozilla/5.0 (", _ewk_settings_webkit_platform_get(), "; U; ", _ewk_settings_webkit_os_version_get(), "; ", WebCore::defaultLanguage(), ") AppleWebKit/", ua_version) + makeString(" (KHTML, like Gecko) Version/5.0 Safari/", ua_version);
+
+    return eina_stringshare_add(static_ua.utf8().data());
+} 
diff --git a/WebKit/efl/ewk/ewk_view.cpp b/WebKit/efl/ewk/ewk_view.cpp
index 12ab00e..9eee9cb 100644
--- a/WebKit/efl/ewk/ewk_view.cpp
+++ b/WebKit/efl/ewk/ewk_view.cpp
@@ -622,6 +622,8 @@ static Ewk_View_Private_Data* _ewk_view_priv_new(Ewk_View_Smart_Data* sd)
     priv->settings.page_cache = priv->page_settings->usesPageCache();
     priv->settings.encoding_detector = priv->page_settings->usesEncodingDetector();
 
+    priv->settings.user_agent = ewk_settings_default_user_agent_get();
+
     // Since there's no scale separated from zooming in webkit-efl, this functionality of
     // viewport meta tag is implemented using zoom. When scale zoom is supported by webkit-efl,
     // this functionality will be modified by the scale zoom patch.
diff --git a/cmake/OptionsEfl.cmake b/cmake/OptionsEfl.cmake
index 8c022ec..872b652 100644
--- a/cmake/OptionsEfl.cmake
+++ b/cmake/OptionsEfl.cmake
@@ -3,6 +3,14 @@ SET(PROJECT_VERSION_MINOR 1)
 SET(PROJECT_VERSION_PATCH 0)
 SET(PROJECT_VERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH})
 
+# -----------------------------------------------------------------------------
+# We mention Safari version because many sites check for it.
+# Sync with WebCore/Configurations/Version.xcconfig whenever Safari is version 
+# up.
+# -----------------------------------------------------------------------------
+SET(USER_AGENT_VERSION_MAJOR 534)
+SET(USER_AGENT_VERSION_MINOR 16)
+
 ADD_DEFINITIONS(-DWTF_PLATFORM_EFL=1)
 SET(WTF_PLATFORM_EFL 1)
 
diff --git a/cmakeconfig.h.cmake b/cmakeconfig.h.cmake
index b16b985..5a3d69c 100644
--- a/cmakeconfig.h.cmake
+++ b/cmakeconfig.h.cmake
@@ -1,6 +1,9 @@
 #ifndef CMAKECONFIG_H
 #define CMAKECONFIG_H
 
+#define WEBKIT_USER_AGENT_MAJOR_VERSION @USER_AGENT_VERSION_MAJOR@
+#define WEBKIT_USER_AGENT_MINOR_VERSION @USER_AGENT_VERSION_MINOR@
+
 #define ENABLE_AS_IMAGE @ENABLE_AS_IMAGE_VALUE@
 #define ENABLE_BLOB @ENABLE_BLOB_VALUE@
 #define ENABLE_CHANNEL_MESSAGING @ENABLE_CHANNEL_MESSAGING_VALUE@

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list