Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(518)

Unified Diff: third_party/WebKit/Source/core/input/EventHandler.cpp

Issue 2785853002: Selection Action mode triggered like a context menu (Closed)
Patch Set: fix rebase Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/input/EventHandler.cpp
diff --git a/third_party/WebKit/Source/core/input/EventHandler.cpp b/third_party/WebKit/Source/core/input/EventHandler.cpp
index 0032b57a273b69a475af1cada64f0a39f33b984f..2160728e687efb22f47a1c8777cf9c46b621b99d 100644
--- a/third_party/WebKit/Source/core/input/EventHandler.cpp
+++ b/third_party/WebKit/Source/core/input/EventHandler.cpp
@@ -1892,20 +1892,29 @@ WebInputEventResult EventHandler::ShowNonLocatedContextMenu(
doc->UpdateHoverActiveState(request, result.InnerElement());
// The contextmenu event is a mouse event even when invoked using the
- // keyboard or other methods. This is required for web compatibility.
+ // keyboard. This is required for web compatibility.
WebInputEvent::Type event_type = WebInputEvent::kMouseDown;
if (frame_->GetSettings() &&
frame_->GetSettings()->GetShowContextMenuOnMouseUp())
event_type = WebInputEvent::kMouseUp;
+ WebInputEvent::Modifiers modifiers;
+ switch (source_type) {
+ case kMenuSourceTouch:
+ case kMenuSourceLongPress:
+ case kMenuSourceTouchHandle:
+ modifiers = WebInputEvent::kIsCompatibilityEventForTouch;
+ break;
+ default:
+ modifiers = WebInputEvent::kNoModifiers;
+ break;
+ }
+
WebMouseEvent mouse_event(
event_type,
WebFloatPoint(location_in_root_frame.X(), location_in_root_frame.Y()),
WebFloatPoint(global_position.X(), global_position.Y()),
- WebPointerProperties::Button::kNoButton, /* clickCount */ 0,
- ((source_type == kMenuSourceTouchHandle)
- ? WebInputEvent::kIsCompatibilityEventForTouch
- : WebInputEvent::kNoModifiers),
+ WebPointerProperties::Button::kNoButton, /* clickCount */ 0, modifiers,
TimeTicks::Now().InSeconds());
// TODO(dtapuska): Transition the mouseEvent to be created really in viewport

Powered by Google App Engine
This is Rietveld 408576698