DescriptionThe context menu on the web page on Windows should be displayed when the long press gesture is released rather than while it is pressed.
This is inconsistent with the way the long press context menu gesture works on Windows. Additionally the long press gesture in Chrome displays the
context menu on the tabstrip and the caption when the touch is released which makes it super confusing.
Changes in this patch are as below:-
1. The RenderWidgetHostViewAura::OnShowContextMenu function now returns a bool indicating whether the context menu should be displayed or not. It currently
returns false on Windows if the menu is being displayed in response to a touch gesture. If yes then it sets a state indicating that the context menu
needs to display when the long press gesture is released via a touch up.
On other platforms it returns true.
2, The WebContentsViewAura::ShowContextMenu function which gets invoked when the context menu is requested by the web page calls the
RenderWidgetHostViewAura::OnShowContextMenu function and if it returns false does not display the context menu.
3. The RenderWidgetHostViewAura::HandleGesutureForTouchSelection handles the ET_GESTURE_LONG_TAP on Windows and if we have a pending context menu request, it
calls the WebContentsViewAura::ShowContextMenu function to display the context menu with the menu source now set to mouse.
BUG=562739
.
TEST=RenderWidgetHostViewAuraWithViewHarnessTest.ContextMenuTest
Committed: https://crrev.com/4376e70737ba5dccedcfc07c48d0bad5edc00e58
Cr-Commit-Position: refs/heads/master@{#371078}
Patch Set 1 #Patch Set 2 : Rebased to tip #Patch Set 3 : Remove space #
Total comments: 6
Patch Set 4 : Address review comments and add unittest #Patch Set 5 : Update comment and disable the test for android #Patch Set 6 : Fix build error #Patch Set 7 : Fix build error #Patch Set 8 : Fix build error #
Total comments: 6
Patch Set 9 : Address review comments and fix ASAN build redness #
Total comments: 6
Patch Set 10 : Address review comments #
Depends on Patchset: Messages
Total messages: 21 (8 generated)
|