change ewk API and UA
authorSeongjun Yim <se201.yim@samsung.com>
Fri, 10 May 2013 07:55:41 +0000 (16:55 +0900)
committerSeongjun Yim <se201.yim@samsung.com>
Fri, 10 May 2013 07:55:41 +0000 (16:55 +0900)
Change-Id: Iac9f46e83b9f47c6f872068f04004378f26f5af9
Signed-off-by: Seongjun Yim <se201.yim@samsung.com>
src/controls/FWebCtrl_WebImpl.cpp
src/controls/FWebCtrl_WebImpl.h

index 45f2c54..ea8a801 100755 (executable)
@@ -2044,6 +2044,7 @@ _WebImpl::_WebImpl(Web* pWeb, Tizen::Ui::_Control* pCore)
        , __pColorPicker(null)
        , __pVibrator(null)
        , __policy(WEB_DECISION_CONTINUE)
+       , __defaultUserAgent(L"");
 {
        __textSearch.__searchAll = false;
        __textSearch.__searchForward = true;
@@ -2158,6 +2159,8 @@ _WebImpl::InitializeSetting(void)
        SetPrivateBrowsingEnabled(pWebSettingImpl->IsPrivateBrowsingEnabled());
        SetZoomLevel(pWebSettingImpl->GetZoomLevel());
 
+       __defaultUserAgent = pWebSettingImpl->GetUserAgent();
+
        r = SetSetting(*pWebSetting);
        SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
 
@@ -2784,10 +2787,13 @@ _WebImpl::SetSetting(const WebSetting& setting)
 
                ewk_settings_loads_images_automatically_set(pSettings, static_cast< Eina_Bool >(setting.IsAutoImageLoadEnabled()));
 
-               std::unique_ptr<char[]> pAgent(_StringConverter::CopyToCharArrayN(setting.GetUserAgent()));
-               SysTryReturn(NID_WEB_CTRL, pAgent.get(), GetLastResult(), GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
+               if (__defaultUserAgent != setting.GetUserAgent())
+               {
+                       std::unique_ptr<char[]> pAgent(_StringConverter::CopyToCharArrayN(setting.GetUserAgent()));
+                       SysTryReturn(NID_WEB_CTRL, pAgent.get(), GetLastResult(), GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
 
-               ewk_view_user_agent_set(__pWebCore->GetWebNativeNode(), pAgent.get());
+                       ewk_view_user_agent_set(__pWebCore->GetWebNativeNode(), pAgent.get());
+               }
 
                ewk_settings_auto_fitting_set(pSettings, static_cast< Eina_Bool >(setting.IsAutoFittingEnabled()));
 
@@ -3547,8 +3553,7 @@ _WebImpl::SetBlockSelectionPosition(const FloatPoint& startPoint)
 void
 _WebImpl::ReleaseBlock(void)
 {
-       ewk_view_command_execute(__pWebCore->GetWebNativeNode(), "Unselect", 0);
-//     ewk_view_text_selection_range_clear(__pWebCore->GetWebNativeNode());
+       ewk_view_text_selection_range_clear(__pWebCore->GetWebNativeNode());
 }
 
 
index a5e86b9..983e2c6 100755 (executable)
@@ -455,6 +455,8 @@ private:
        _TextSearch __textSearch;
 
        DecisionPolicy __policy;
+
+       Tizen::Base::String __defaultUserAgent;
 }; // _WebImpl
 
 }}} // Tizen::Web::Controls