* 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>
r = SetProxyAddress();
SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+ InitializeCustomHeader();
+
return E_SUCCESS;
}
}
+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
{
result CreateResourceDirectory(void) const;
- result InitializeCustomDb() const;
+ result InitializeCustomDb(void) const;
+
+ void InitializeCustomHeader(void) const;
_EflWebkit& operator =(const _EflWebkit&);