Fix for issue N_SE-41952
authorhyun lee <hyunn.lee@samsung.com>
Fri, 28 Jun 2013 06:55:48 +0000 (15:55 +0900)
committerhyun lee <hyunn.lee@samsung.com>
Fri, 28 Jun 2013 08:49:53 +0000 (17:49 +0900)
Change-Id: Ib15c6fa9f2703c14045f3dad6cee06bb0f805b17
Signed-off-by: hyun lee <hyunn.lee@samsung.com>
src/controls/FWebCtrl_EflWebkit.cpp
src/controls/FWebCtrl_EflWebkit.h

index 7a8dabe..aa56acf 100755 (executable)
@@ -22,6 +22,7 @@
  * The file contains the definition of _EflWebkit class.
  */
 #include <unique_ptr.h>
+#include <vconf.h>
 #include <EWebKit2.h>
 #include <net_connection.h>
 #include <FAppApp.h>
@@ -174,6 +175,8 @@ _EflWebkit::SetWebConfiguration(void) const
        r = SetProxyAddress();
        SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
 
+       InitializeCustomHeader();
+
        return E_SUCCESS;
 }
 
@@ -312,6 +315,39 @@ _EflWebkit::SetProxyAddress(void) const
 }
 
 
+void
+_EflWebkit::InitializeCustomHeader(void) const
+{
+       std::unique_ptr<char[]> pLang(vconf_get_str(VCONFKEY_LANGSET));
+       std::unique_ptr<char[]> pRegion(vconf_get_str(VCONFKEY_LANGSET));
+       const char name[] = "Accept-Language";
+       String value(L"");
+
+       if (pLang.get())
+       {
+               if (pRegion.get())
+               {
+                       value.Append(pLang.get());
+                       value.Append(L"_");
+                       value.Append(pRegion.get());
+               }
+               else
+               {
+                       value.Append(pLang.get());
+               }
+       }
+       else
+       {
+               value = L"en";
+       }
+
+       std::unique_ptr<char[]> pValue(_StringConverter::CopyToCharArrayN(value));
+       SysTryReturnVoidResult(NID_WEB_CTRL, pValue.get(), E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
+
+       ewk_view_custom_header_add(__pWebFrame, name, pValue.get());
+}
+
+
 Evas_Object*
 _EflWebkit::GetWebEvasObject(void) const
 {
index 69cec83..e4cee87 100755 (executable)
@@ -77,7 +77,9 @@ private:
 
        result CreateResourceDirectory(void) const;
 
-       result InitializeCustomDb() const;
+       result InitializeCustomDb(void) const;
+
+       void InitializeCustomHeader(void) const;
 
        _EflWebkit& operator =(const _EflWebkit&);