, m_webView(webView)
, m_items()
#endif
+#if ENABLE(TIZEN_WEBKIT2_TEXT_SELECTION)
+ , m_contextShowTimer(0)
+#endif
#if ENABLE(TIZEN_WEBKIT2_CONTEXT_MENU_TEXT_SELECTION_MODE)
, m_positionForSelection()
#endif
}
}
-static void contextMenuPopupDismissedCallback(void* data, Evas_Object* obj, void* eventInfo)
+#if ENABLE(TIZEN_CONTEXT_MENU_WEBKIT_2)
+void WebContextMenuProxyTizen::contextMenuPopupDismissedCallback(void* data, Evas_Object* obj, void* eventInfo)
{
+ WebContextMenuProxyTizen* menuProxy = static_cast<WebContextMenuProxyTizen*>(data);
+ if (menuProxy) {
#if ENABLE(TIZEN_WEBKIT2_FOCUS_RING)
- static_cast<PageClientImpl*>(data)->hideFocusRing();
+ menuProxy->m_pageClientImpl->hideFocusRing();
+#endif
+ menuProxy->m_pageClientImpl->setIsContextMenuVisible(false);
+
+#if ENABLE(TIZEN_WEBKIT2_TEXT_SELECTION)
+ if (menuProxy->m_contextShowTimer) {
+ ecore_timer_del(menuProxy->m_contextShowTimer);
+ menuProxy->m_contextShowTimer = 0;
+ }
#endif
- static_cast<PageClientImpl*>(data)->setIsContextMenuVisible(false);
+ }
}
+#endif
+
#else
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);
+#if ENABLE(TIZEN_WEBKIT2_FOCUS_RING)
+ contextMenuProxy->m_pageClientImpl->hideFocusRing();
+#endif
+ }
+ return ECORE_CALLBACK_CANCEL;
+}
+
+void WebContextMenuProxyTizen::startContextMenuTimer()
+{
+ double contextMenuDispTime = 3.0;
+ if (m_contextShowTimer) {
+ ecore_timer_del(m_contextShowTimer);
+ m_contextShowTimer = 0;
+ }
+ m_contextShowTimer = ecore_timer_add(contextMenuDispTime, contextMenuTimerCallback, this);
+}
+#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)
evas_object_move(m_popup, popupPosition.x(), popupPosition.y());
evas_object_show(m_popup);
- evas_object_smart_callback_add(m_popup, "dismissed", contextMenuPopupDismissedCallback, m_pageClientImpl);
+ evas_object_smart_callback_add(m_popup, "dismissed", contextMenuPopupDismissedCallback, 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();
if (m_popup)
evas_object_hide(m_popup);
m_pageClientImpl->setIsContextMenuVisible(false);
+#if ENABLE(TIZEN_WEBKIT2_TEXT_SELECTION)
+ if (m_contextShowTimer) {
+ ecore_timer_del(m_contextShowTimer);
+ m_contextShowTimer = 0;
+ }
+#endif
#else
notImplemented();
#endif
WebContextMenuProxyTizen(Evas_Object*, WebPageProxy*, PageClientImpl*);
#if ENABLE(TIZEN_CONTEXT_MENU_WEBKIT_2)
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();
+#endif
void createEflMenu(const Vector<WebContextMenuItemData>&);
#else
void createEflMenu();
#if ENABLE(TIZEN_WEBKIT2_TEXT_SELECTION)
bool m_isContextMenuForTextSelection;
+ Ecore_Timer* m_contextShowTimer;
#endif
};