WebContextMenuItemData itemData = *(static_cast<WebContextMenuItemData*>(data));
WebContextMenuProxyTizen* menuProxy = static_cast<WebContextMenuProxyTizen*>(evas_object_data_get(obj, "WebContextMenuProxyTizen"));
+#if ENABLE(TIZEN_WEBKIT2_FOCUS_RING)
+ menuProxy->m_pageClientImpl->hideFocusRing();
+#endif
+
+#if ENABLE(TIZEN_WEBKIT2_TEXT_SELECTION)
+ menuProxy->m_pageClientImpl->initTextSelectionHandlesMouseDownedStatus();
+#endif
+
menuProxy->m_page->contextMenuItemSelected(itemData);
menuProxy->hideContextMenu();
elm_object_tree_focus_allow_set(m_popup, false);
size_t size = m_items.size();
+#if ENABLE(TIZEN_WEBKIT2_CLIPBOARD_HELPER)
+ int clipboardItemSize = ClipboardHelper::numberOfItems();
+ TIZEN_LOGI("clipboardItemSize : %d", clipboardItemSize);
+#endif
for (size_t i = 0; i < size; i++) {
#if ENABLE(TIZEN_WEBKIT2_CLIPBOARD_HELPER)
- if (m_items.at(i).action() == ContextMenuItemTagPaste && !ClipboardHelper::numberOfItems())
+ if ((m_items.at(i).action() == ContextMenuItemTagPaste || m_items.at(i).action() == ContextMenuItemTagClipboard) && !clipboardItemSize)
continue;
#endif
Evas_Object* icon = 0;
if (!m_items.at(i).iconFile().isEmpty()) {
icon = elm_icon_add(m_popup);
- if (!elm_icon_file_set(icon, m_items.at(i).iconFile().utf8().data(), NULL))
+ TIZEN_LOGI("icon file path : %s", m_items.at(i).iconFile().utf8().data());
+ if (!elm_image_file_set(icon, m_items.at(i).iconFile().utf8().data(), NULL)) {
+ TIZEN_LOGE("elm_image_file_set is failed");
icon = 0;
+ }
}
if (!m_items.at(i).title().isEmpty())
static void contextMenuPopupDismissedCallback(void* data, Evas_Object* obj, void* eventInfo)
{
+#if ENABLE(TIZEN_WEBKIT2_FOCUS_RING)
+ static_cast<PageClientImpl*>(data)->hideFocusRing();
+#endif
static_cast<PageClientImpl*>(data)->setIsContextMenuVisible(false);
}
#else
popupPosition.move(-scrollPosition.x(), -scrollPosition.y());
}
#endif
+ popupPosition.setX(popupPosition.x() + webViewX);
+ popupPosition.setY(popupPosition.y() + webViewY);
#if ENABLE(TIZEN_WEBKIT2_TEXT_SELECTION)
- if ( m_pageClientImpl->isTextSelectionMode()) {
+ if (m_pageClientImpl->isTextSelectionMode()) {
+ elm_object_style_set(m_popup,"copypaste");
elm_ctxpopup_horizontal_set(m_popup, EINA_TRUE);
elm_ctxpopup_direction_priority_set(m_popup, ELM_CTXPOPUP_DIRECTION_UP, ELM_CTXPOPUP_DIRECTION_UP, ELM_CTXPOPUP_DIRECTION_UP, ELM_CTXPOPUP_DIRECTION_UP);
+
+ m_pageClientImpl->changeContextMenuPosition(popupPosition);
}
#endif
- evas_object_move(m_popup, popupPosition.x() + webViewX, popupPosition.y() + webViewY);
+ 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);
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
}
#else
createEflMenu();