void SelectionControllerEfl::ShowContextMenu() {
WebContentsImpl* wci = static_cast<WebContentsImpl*>(&web_contents_);
- WebContentsViewEfl* wcve = static_cast<WebContentsViewEfl*>(wci->GetView());
RenderWidgetHostViewEfl* rwhv =
static_cast<RenderWidgetHostViewEfl*>(web_contents_.GetRenderWidgetHostView());
RenderViewHost* rvh = static_cast<RenderViewHost*>(wci->GetRenderViewHost());
rwhv->EvasToBlinkCords(convertedParams.x, convertedParams.y, &blinkX, &blinkY);
convertedParams.x = blinkX;
convertedParams.y = blinkY;
+
+ // TODO(a1.gomes): In case of EWK apps, the call below end up calling
+ // EWebView::ShowContextMenu. We have to make sure parameters
+ // are correct.
+ WebContentsViewEfl* wcve = static_cast<WebContentsViewEfl*>(wci->GetView());
wcve->ShowContextMenu(rvh->GetMainFrame(), convertedParams);
}
restore_showing_large_handle_on_gesture_end_.reset();
HandlePostponedGesture(
event.x, event.y, ui::ET_GESTURE_LONG_PRESS);
+ long_mouse_press_ = true;
} else if (event.type == blink::WebInputEvent::GestureTapDown) {
single_tap_performed_ = true;
} else if (event.type == blink::WebInputEvent::GestureTapCancel ||
case ui::ET_GESTURE_LONG_PRESS: {
ClearSelectionViaEWebView();
HideHandleAndContextMenu();
- RwhvAsyncRequestHitTestDataInternalCallback* cb =
- new RwhvAsyncRequestHitTestDataInternalCallback(point,
- &SelectionControllerEfl::HandleLongPressEvent);
- // below call takes full ownership of cb.
- AsyncRequestHitTestDataAtBlinkCords(x, y, cb);
+ // Long press data will call to WebContentsViewDelegateEwk.
+ // It is called by the chain that handles FrameHostMsg_ContextMenu.
break;
}
case ui::ET_GESTURE_TAP: {
void SelectionControllerEfl::HandleLongPressEvent(
const gfx::Point& touch_point,
- const ViewHostMsg_HitTestAsyncReply_Params& params) {
+ const content::ContextMenuParams& params) {
- if (params.isEditable) {
+ if (params.is_editable) {
SetSelectionStatus(true);
SetSelectionEditable(true);
HandleLongPressEventPrivate(touch_point);
- } else if (params.linkURI.empty()
- && params.imageURI.empty()
- && params.mediaURI.empty()
- && params.isTextNode) {
+ } else if (params.link_url.is_empty()
+ && params.src_url.is_empty()
+ && params.is_text_node) {
SetSelectionStatus(true);
HandleLongPressEventPrivate(touch_point);
DVLOG(1) << __PRETTY_FUNCTION__ << ":: link, !image, !media, text";
- } else if (!params.imageURI.empty()) {
+ } else if (!params.src_url.is_empty() && params.has_image_contents) {
DVLOG(1) << __PRETTY_FUNCTION__ << ":: IMAGE";
- } else if (!params.linkURI.empty()) {
+ } else if (!params.link_url.is_empty()) {
ClearSelectionViaEWebView();
DVLOG(1) << __PRETTY_FUNCTION__ << ":: LINK";
}
-
}
void SelectionControllerEfl::HandleLongPressEventPrivate(const gfx::Point& touch_point) {
show_only_large_handle_ = false;
- long_mouse_press_ = true;
Clear();
if (selection_data_->IsInEditField())
SetCaretSelectionStatus(true);