From d7df79f1077497c9bce74ebb4290b575eb63aa97 Mon Sep 17 00:00:00 2001 From: Taeyun An Date: Wed, 25 Sep 2013 16:51:55 +0900 Subject: [PATCH] Remove timer action of context menu [Title] Remove timer action of context menu [Issue#] N_SE-51467 [Problem] Context menu is disappear automatically before user didn't have any action [Cause] There is applied about dismiss timer in context menu [Solution] Remove timer action of context menu Change-Id: I9f6b4ddfa64626943b2353a776386cef116e045d --- .../UIProcess/tizen/WebContextMenuProxyTizen.cpp | 69 ---------------------- .../UIProcess/tizen/WebContextMenuProxyTizen.h | 9 --- 2 files changed, 78 deletions(-) diff --git a/Source/WebKit2/UIProcess/tizen/WebContextMenuProxyTizen.cpp b/Source/WebKit2/UIProcess/tizen/WebContextMenuProxyTizen.cpp index 9aa9905..c956f83 100755 --- a/Source/WebKit2/UIProcess/tizen/WebContextMenuProxyTizen.cpp +++ b/Source/WebKit2/UIProcess/tizen/WebContextMenuProxyTizen.cpp @@ -192,10 +192,6 @@ void WebContextMenuProxyTizen::contextMenuPopupDismissedCallback(void* data, Eva menuProxy->m_pageClientImpl->viewImpl()->focusRing()->hide(); #endif menuProxy->m_pageClientImpl->setIsContextMenuVisible(false); - -#if ENABLE(TIZEN_WEBKIT2_TEXT_SELECTION) - menuProxy->endContextMenuTimer(); -#endif } } #endif @@ -207,56 +203,6 @@ void WebContextMenuProxyTizen::createEflMenu() } #endif -#if ENABLE(TIZEN_WEBKIT2_TEXT_SELECTION) -Eina_Bool WebContextMenuProxyTizen::contextMenuTimerCallback(void* data) -{ - WebContextMenuProxyTizen *contextMenuProxy = static_cast(data); - if (contextMenuProxy) { - if (contextMenuProxy->m_popup) - evas_object_hide(contextMenuProxy->m_popup); - - contextMenuProxy->m_pageClientImpl->setIsContextMenuVisible(false); - EditorState editorState = contextMenuProxy->m_page->editorState(); - if (!editorState.selectionIsRange && editorState.isContentEditable) - contextMenuProxy->m_pageClientImpl->setIsTextSelectionMode(false); -#if ENABLE(TIZEN_WEBKIT2_FOCUS_RING) - contextMenuProxy->m_pageClientImpl->viewImpl()->focusRing()->hide(); -#endif - } - return ECORE_CALLBACK_CANCEL; -} - -void WebContextMenuProxyTizen::startContextMenuTimer() -{ - double contextMenuDispTime = 6.0; - endContextMenuTimer(); - - m_contextShowTimer = ecore_timer_add(contextMenuDispTime, contextMenuTimerCallback, this); -} - -void WebContextMenuProxyTizen::endContextMenuTimer() -{ - if (m_contextShowTimer) { - ecore_timer_del(m_contextShowTimer); - m_contextShowTimer = 0; - } -} - -void WebContextMenuProxyTizen::onMouseDown(void* data, Evas*, Evas_Object*, void* eventInfo) -{ - WebContextMenuProxyTizen* contextMenuProxy = static_cast(data); - - contextMenuProxy->endContextMenuTimer(); -} - -void WebContextMenuProxyTizen::onMouseUp(void* data, Evas*, Evas_Object*, void* eventInfo) -{ - WebContextMenuProxyTizen* contextMenuProxy = static_cast(data); - - contextMenuProxy->startContextMenuTimer(); -} -#endif // TIZEN_WEBKIT2_TEXT_SELECTION - void WebContextMenuProxyTizen::showContextMenu(const WebCore::IntPoint& position, const Vector& items) { #if ENABLE(TIZEN_WEBKIT2_CONTEXT_MENU_TEXT_SELECTION_MODE) @@ -311,20 +257,11 @@ void WebContextMenuProxyTizen::showContextMenu(const WebCore::IntPoint& position evas_object_smart_callback_add(m_popup, "dismissed", contextMenuPopupDismissedCallback, this); - evas_object_event_callback_add(m_popup, EVAS_CALLBACK_MOUSE_DOWN, onMouseDown, this); - evas_object_event_callback_add(m_popup, EVAS_CALLBACK_MOUSE_UP, onMouseUp, this); - m_pageClientImpl->setIsContextMenuVisible(true); #if ENABLE(TOUCH_EVENTS) && ENABLE(TIZEN_GESTURE) // Cancel touch event when ContextMenu is shown. EwkViewImpl::fromEvasObject(m_webView)->feedTouchEventsByType(EWK_TOUCH_CANCEL); #endif - -#if ENABLE(TIZEN_WEBKIT2_TEXT_SELECTION) - // Start the timer at the end - if (m_isContextMenuForTextSelection) - startContextMenuTimer(); -#endif } #else createEflMenu(); @@ -338,12 +275,6 @@ void WebContextMenuProxyTizen::hideContextMenu() if (m_popup) evas_object_hide(m_popup); m_pageClientImpl->setIsContextMenuVisible(false); -#if ENABLE(TIZEN_WEBKIT2_TEXT_SELECTION) - endContextMenuTimer(); - - evas_object_event_callback_del(m_popup, EVAS_CALLBACK_MOUSE_DOWN, onMouseDown); - evas_object_event_callback_del(m_popup, EVAS_CALLBACK_MOUSE_UP, onMouseUp); -#endif #else notImplemented(); #endif diff --git a/Source/WebKit2/UIProcess/tizen/WebContextMenuProxyTizen.h b/Source/WebKit2/UIProcess/tizen/WebContextMenuProxyTizen.h index e7da966..360873b 100755 --- a/Source/WebKit2/UIProcess/tizen/WebContextMenuProxyTizen.h +++ b/Source/WebKit2/UIProcess/tizen/WebContextMenuProxyTizen.h @@ -56,15 +56,6 @@ private: static void contextMenuItemSelectedCallback(void* data, Evas_Object* obj, void* eventInfo); static void contextMenuPopupDismissedCallback(void* data, Evas_Object* obj, void* eventInfo); -#if ENABLE(TIZEN_WEBKIT2_TEXT_SELECTION) - static Eina_Bool contextMenuTimerCallback(void *data); - void startContextMenuTimer(); - void endContextMenuTimer(); - - // callbacks - static void onMouseDown(void*, Evas*, Evas_Object*, void*); - static void onMouseUp(void*, Evas*, Evas_Object*, void*); -#endif void createEflMenu(const Vector&); #else void createEflMenu(); -- 2.7.4