Bug 1021804 - Long press on news story links invoke context menu, r=kats, wesj

This commit is contained in:
Mark Capella
2014-08-29 17:32:40 -04:00
parent ef93903bcf
commit dfb228ca0c
8 changed files with 119 additions and 56 deletions

View File

@@ -108,7 +108,8 @@ public class GeckoEvent {
TELEMETRY_UI_SESSION_STOP(43),
TELEMETRY_UI_EVENT(44),
GAMEPAD_ADDREMOVE(45),
GAMEPAD_DATA(46);
GAMEPAD_DATA(46),
LONG_PRESS(47);
public final int value;
@@ -420,6 +421,16 @@ public class GeckoEvent {
return event;
}
/**
* Creates a GeckoEvent that contains the data from the LongPressEvent, to be
* dispatched in CSS pixels relative to gecko's scroll position.
*/
public static GeckoEvent createLongPressEvent(MotionEvent m) {
GeckoEvent event = GeckoEvent.get(NativeGeckoEvent.LONG_PRESS);
event.initMotionEvent(m, false);
return event;
}
private void initMotionEvent(MotionEvent m, boolean keepInViewCoordinates) {
mAction = m.getActionMasked();
mTime = (System.currentTimeMillis() - SystemClock.elapsedRealtime()) + m.getEventTime();