Index: chrome/browser/android/vr_shell/vr_shell.cc |
diff --git a/chrome/browser/android/vr_shell/vr_shell.cc b/chrome/browser/android/vr_shell/vr_shell.cc |
index 48a19ba7428bd18e1c01cffffc3b08cfa2120c9f..71801447f03ddb7c58dd5fdb27b0d5d234450696 100644 |
--- a/chrome/browser/android/vr_shell/vr_shell.cc |
+++ b/chrome/browser/android/vr_shell/vr_shell.cc |
@@ -593,6 +593,19 @@ void VrShell::DrawFrame(JNIEnv* env, const JavaParamRef<jobject>& obj) { |
if (html_interface_->GetMode() == UiInterface::Mode::WEB_VR) { |
DrawWebVr(); |
+ // Process screen touch events for Cardboard button compatibility. |
+ if (touch_pending_) { |
bajones
2016/11/17 20:42:53
Shouldn't this go in UpdateController under the if
klausw
2016/11/17 21:00:00
Yes, that's a much better fit. Moved.
|
+ touch_pending_ = false; |
+ std::unique_ptr<WebGestureEvent> gesture(new WebGestureEvent()); |
+ gesture->sourceDevice = blink::WebGestureDeviceTouchpad; |
+ gesture->timeStampSeconds = |
+ (base::TimeTicks::Now() - base::TimeTicks()).InSecondsF(); |
+ gesture->type = WebInputEvent::GestureTapDown; |
+ gesture->data.tapDown.width = 0; |
+ gesture->data.tapDown.height = 0; |
+ content_input_manager_->ProcessUpdatedGesture(*gesture.get()); |
+ } |
+ |
// When using async reprojection, we need to know which pose was used in |
// the WebVR app for drawing this frame. Due to unknown amounts of |
// buffering in the compositor and SurfaceTexture, we read the pose number |