#include <dpl/foreach.h>
#include <Elementary.h>
+#include <efl_assist.h>
#include <pcrecpp.h>
#include <sysman.h>
#include <widget_model.h>
#include <wrt-commons/custom-handler-dao-ro/CustomHandlerDatabase.h>
#include <wrt-commons/custom-handler-dao-rw/custom_handler_dao.h>
#include <popup-runner/PopupInvoker.h>
+#include <plugins-ipc-message/ipc_message_support.h>
#include <appsvc/appsvc.h>
#include <utilX.h>
}
ewk_cookie_manager_cookies_clear(cookieManager);
}
+ else if (!strcmp(name, IPCMessageSupport::TIZEN_CHANGE_USERAGENT))
+ {
+ std::string msgBody = (body) ? (body) : "";
+
+ std::string strId = msgBody.substr(0, msgBody.find_first_of('_'));
+ std::string strBody = msgBody.substr(msgBody.find_first_of('_')+1);
+
+ LogDebug("Id: " << strId << ", Body:" << strBody);
+
+ ewk_view_user_agent_set(m_currentEwkView, strBody.c_str());
+
+ LogDebug("get UA: " << ewk_view_user_agent_get(m_currentEwkView));
+
+ IPCMessageSupport::replyAsyncMessageToWebProcess(m_ewkContext, atoi(strId.c_str()), "success");
+
+ return;
+ }
+ else if (!strcmp(name, IPCMessageSupport::TIZEN_DELETE_ALL_COOKIES))
+ {
+ std::string msgBody = (body) ? (body) : "";
+
+ std::string strId = msgBody.substr(0, msgBody.find_first_of('_'));
+ std::string strBody = msgBody.substr(msgBody.find_first_of('_')+1);
+
+ Ewk_Cookie_Manager* cookieManager = ewk_context_cookie_manager_get(m_ewkContext);
+
+ if (!cookieManager)
+ {
+ LogError("Fail to get cookieManager");
+ IPCMessageSupport::replyAsyncMessageToWebProcess(m_ewkContext, atoi(strId.c_str()), "error");
+
+ return;
+ }
+ ewk_cookie_manager_cookies_clear(cookieManager);
+
+ IPCMessageSupport::replyAsyncMessageToWebProcess(m_ewkContext, atoi(strId.c_str()), "success");
+
+ return;
+ }
}
void ViewLogic::downloadData(const char* url)
wkView,
exceededLocalFileSystemQuotaCallback,
this);
- evas_object_event_callback_add(
- wkView,
- EVAS_CALLBACK_KEY_UP,
- keyupCallback,
- this);
+ ea_object_event_callback_add(wkView,
+ EA_CALLBACK_BACK,
+ eaKeyCallback,
+ this);
+ ea_object_event_callback_add(wkView,
+ EA_CALLBACK_MORE,
+ eaKeyCallback,
+ this);
}
void ViewLogic::ewkClientDeinit(Evas_Object *wkView)
ewk_view_exceeded_database_quota_callback_set(wkView, NULL, NULL);
ewk_view_exceeded_indexed_database_quota_callback_set(wkView, NULL, NULL);
ewk_view_exceeded_local_file_system_quota_callback_set(wkView, NULL, NULL);
- evas_object_event_callback_del(wkView,
- EVAS_CALLBACK_KEY_UP,
- keyupCallback);
+ ea_object_event_callback_del(wkView,
+ EA_CALLBACK_BACK,
+ eaKeyCallback);
+ ea_object_event_callback_del(wkView,
+ EA_CALLBACK_MORE,
+ eaKeyCallback);
if (m_orientationThresholdTimer) {
ecore_timer_del(m_orientationThresholdTimer);
m_orientationThresholdTimer = NULL;
LogInfo("result = " << result);
}
-void ViewLogic::keyupCallback(void* data,
- Evas* /*e*/,
- Evas_Object* obj,
- void* eventInfo)
+void ViewLogic::eaKeyCallback(void* data, Evas_Object* obj, void* eventInfo)
{
Assert(data);
ViewLogic* This = static_cast<ViewLogic*>(data);
- Assert(eventInfo);
- Evas_Event_Key_Up* keyEvent =
- static_cast<Evas_Event_Key_Up*>(eventInfo);
+ Ea_Callback_Type keyType =
+ static_cast<Ea_Callback_Type>(reinterpret_cast<int>(eventInfo));
- LogInfo("Key = [" << keyEvent->keyname << "]");
- if (!strcmp(keyEvent->keyname, KEY_BACK)) {
- if (This->m_model->SettingList.Get().getHWkeyEvent() ==
- HWkeyEvent_Enable)
- {
- DispatchEventSupport::dispatchHwKeyEvent(obj, "back");
- }
- This->m_cbs->hwkey("back");
- } else if (!strcmp(keyEvent->keyname, KEY_MENU)) {
- if (This->m_model->SettingList.Get().getHWkeyEvent() ==
- HWkeyEvent_Enable)
- {
- DispatchEventSupport::dispatchHwKeyEvent(obj, "menu");
- }
- This->m_cbs->hwkey("menu");
+ LogInfo("Key = [" << keyType << "]");
+
+ std::string keyName;
+ if (keyType == EA_CALLBACK_BACK) {
+ keyName = KeyName::BACK;
+ } else if (keyType == EA_CALLBACK_MORE) {
+ keyName = KeyName::MENU;
+ } else {
+ return;
}
- return;
+ if (This->m_model->SettingList.Get().getHWkeyEvent() == HWkeyEvent_Enable)
+ {
+ DispatchEventSupport::dispatchHwKeyEvent(obj, keyName);
+ }
+ This->m_cbs->hwkey(keyName);
+
+ return;
}
Eina_Bool ViewLogic::windowCloseIdlerCallback(void* data)