Disambiguate ShowContextMenu implementation.
authorAntonio Gomes <a1.gomes@samsung.com>
Thu, 29 Oct 2015 20:10:24 +0000 (16:10 -0400)
committerYoungsoo Choi <kenshin.choi@samsung.com>
Tue, 10 Jul 2018 07:55:23 +0000 (07:55 +0000)
commit2d0fc79bbb27b840eb8eddf5c50c503726c73ec7
treeaa8f3c8a76e0c15c320f36b76013b70c20cc266c
parent8573d442cec87199cc06c8841896ca632ca30588
Disambiguate ShowContextMenu implementation.

In the regular chromium flow, there is a hook invoked when
a long press gesture happens. The terminology used in the
messages and methods involved is "show context menu".

However, upon a long press gesture, chromium-efl does not
necessarily show a context menu right way. It might, for instance,
enter selection mode if the long press gesture happens on a
text (non anchor) content, and only tries to show an actual
context menu when user lifts up his finger.
Alternatively, it might show a context menu right away
in case the gesture happens on an <image> or a link.

For both cases, the same chromium hook is called by chromium,
whereas the former performs a second pass on the chromium hook,
which is confusing. Our current implementation ends up like:

EWebView::ShowContextMenu() {
if (called by chromium)
do this;
else // called by EWK on a second pass
do that;
}

Problem is that this is a constant source of issues because
it requires control of state variables to handle each passes
on the method.

Patch makes that separation clear by disambiguate this logic:
- EWebView::HandleLongPressEvent calls SelectionController
- SelectionController calls out to EWebView::ShowContextMenu.

Bug: http://107.108.218.239/bugzilla/show_bug.cgi?id=14304

Reviewed by: a.renevier, djmix.kim, j.majnert, sns.park

Change-Id: I2bf2a1b24e20d7f0f50e6881144cb3cf8cc62925
Signed-off-by: Antonio Gomes <a1.gomes@samsung.com>
tizen_src/chromium_impl/content/browser/selection/selection_controller_efl.cc
tizen_src/chromium_impl/content/browser/web_contents/web_contents_view_efl.cc
tizen_src/chromium_impl/content/browser/web_contents/web_contents_view_efl.h
tizen_src/chromium_impl/content/public/browser/web_contents_view_efl_delegate.h
tizen_src/ewk/efl_integration/eweb_view.cc
tizen_src/ewk/efl_integration/eweb_view.h
tizen_src/ewk/efl_integration/web_contents_view_delegate_ewk.cc
tizen_src/ewk/efl_integration/web_contents_view_efl_delegate_ewk.cc
tizen_src/ewk/efl_integration/web_contents_view_efl_delegate_ewk.h