int clipboardItemSize = ClipboardHelper::numberOfItems();
TIZEN_LOGI("clipboardItemSize : %d", clipboardItemSize);
#endif
+ bool isContextMenuForTextSelection = false;
for (size_t i = 0; i < size; i++) {
#if ENABLE(TIZEN_WEBKIT2_CLIPBOARD_HELPER)
if ((m_items.at(i).action() == ContextMenuItemTagPaste || m_items.at(i).action() == ContextMenuItemTagClipboard) && !clipboardItemSize)
continue;
#endif
+#if ENABLE(TIZEN_WEBKIT2_TEXT_SELECTION)
+ if (m_items.at(i).action() == ContextMenuItemTagCopy || m_items.at(i).action() == ContextMenuItemTagSelectAll
+ || m_items.at(i).action() == ContextMenuItemTagSelectWord || m_items.at(i).action() == ContextMenuItemTagPaste)
+ isContextMenuForTextSelection = true;
+#endif
+
#if ENABLE(TIZEN_WEBKIT2_CONTEXT_MENU_ICON_TYPE_SUPPORT)
if (!m_items.at(i).title().isEmpty() || !m_items.at(i).iconFile().isEmpty()) {
Evas_Object* icon = 0;
contextMenuItemSelectedCallback, &(m_items.at(i)));
#endif
}
+
+#if ENABLE(TIZEN_WEBKIT2_TEXT_SELECTION)
+ if (isContextMenuForTextSelection) {
+ if (!m_pageClientImpl->isTextSelectionMode())
+ m_pageClientImpl->setIsTextSelectionMode(true);
+ 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);
+ }
+#endif
}
static void contextMenuPopupDismissedCallback(void* data, Evas_Object* obj, void* eventInfo)
popupPosition.setX(popupPosition.x() + webViewX);
popupPosition.setY(popupPosition.y() + webViewY);
-#if ENABLE(TIZEN_WEBKIT2_TEXT_SELECTION)
- 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(), popupPosition.y());
evas_object_show(m_popup);