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

Unified Diff: chrome/browser/android/vr_shell/android_ui_gesture_target.cc

Issue 2942623002: VR: Add support for mouse down/up events for Android NativePages. (Closed)
Patch Set: Created 3 years, 6 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/android/vr_shell/android_ui_gesture_target.cc
diff --git a/chrome/browser/android/vr_shell/android_ui_gesture_target.cc b/chrome/browser/android/vr_shell/android_ui_gesture_target.cc
index ede06eff704cafe718080ca17284816f71216aeb..d93fd301fd58ec572078f6bd525005c6a0b5ae35 100644
--- a/chrome/browser/android/vr_shell/android_ui_gesture_target.cc
+++ b/chrome/browser/android/vr_shell/android_ui_gesture_target.cc
@@ -71,8 +71,20 @@ void AndroidUiGestureTarget::DispatchWebInputEvent(
SetPointer(env, mouse->PositionInWidget().x, mouse->PositionInWidget().y);
Inject(env, Action::HoverExit, gesture->TimeStampSeconds());
break;
+ case blink::WebMouseEvent::kMouseDown:
+ // Mouse down events are translated into touch events on Android anyways,
+ // so we can just send touch events.
+ // We intentionally don't support long press or drags/swipes with mouse
+ // input as this could trigger long press and open 2D popups.
+ SetPointer(env, mouse->PositionInWidget().x, mouse->PositionInWidget().y);
+ Inject(env, Action::Start, gesture->TimeStampSeconds());
+ Inject(env, Action::End, gesture->TimeStampSeconds());
+ break;
+ case blink::WebMouseEvent::kMouseUp:
+ // No need to do anything for mouseUp as mouseDown already handled up.
+ break;
default:
- NOTREACHED();
+ NOTREACHED() << "Unsupported event type sent to Android UI.";
break;
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698