Remove timer action of context menu
authorTaeyun An <ty.an@samsung.com>
Wed, 25 Sep 2013 07:51:55 +0000 (16:51 +0900)
committerGerrit Code Review <gerrit@gerrit.vlan144.tizendev.org>
Wed, 25 Sep 2013 08:10:41 +0000 (08:10 +0000)
[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

Source/WebKit2/UIProcess/tizen/WebContextMenuProxyTizen.cpp
Source/WebKit2/UIProcess/tizen/WebContextMenuProxyTizen.h

index 9aa9905..c956f83 100755 (executable)
@@ -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<WebContextMenuProxyTizen*>(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<WebContextMenuProxyTizen*>(data);
-
-    contextMenuProxy->endContextMenuTimer();
-}
-
-void WebContextMenuProxyTizen::onMouseUp(void* data, Evas*, Evas_Object*, void* eventInfo)
-{
-    WebContextMenuProxyTizen* contextMenuProxy = static_cast<WebContextMenuProxyTizen*>(data);
-
-    contextMenuProxy->startContextMenuTimer();
-}
-#endif // TIZEN_WEBKIT2_TEXT_SELECTION
-
 void WebContextMenuProxyTizen::showContextMenu(const WebCore::IntPoint& position, const Vector<WebContextMenuItemData>& 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
index e7da966..360873b 100755 (executable)
@@ -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<WebContextMenuItemData>&);
 #else
     void createEflMenu();