Chromium Code Reviews| Index: chrome/browser/android/vr_shell/vr_controller.cc |
| diff --git a/chrome/browser/android/vr_shell/vr_controller.cc b/chrome/browser/android/vr_shell/vr_controller.cc |
| index a3ddfb61e38a9e3a9bd5062414dd0f2201f7fb1e..617e9a2b8bc28791ebd4d62866c65c617f525543 100644 |
| --- a/chrome/browser/android/vr_shell/vr_controller.cc |
| +++ b/chrome/browser/android/vr_shell/vr_controller.cc |
| @@ -202,10 +202,23 @@ std::vector<std::unique_ptr<WebGestureEvent>> VrController::DetectGestures() { |
| gesture->data.tapDown.width = 0; |
| gesture->data.tapDown.height = 0; |
| } |
| + |
| + if (state_ == SCROLLING && IsButtonDown(gvr::kControllerButtonClick)) |
|
mthiesse
2016/11/28 16:06:57
nit: extract "state_ == SCROLLING && IsButtonDown(
bshe
2016/11/28 16:33:57
can this logic move to HandleScrollingState ? It p
asimjour1
2016/11/28 21:38:04
Done.
asimjour1
2016/11/28 21:38:04
This part is moved and there is no duplication any
|
| + gesture->type = WebInputEvent::GestureScrollEnd; |
| + |
| gesture->sourceDevice = blink::WebGestureDeviceTouchpad; |
| gesture_list.push_back(std::move(gesture)); |
| - if (gesture_list.back()->type == WebInputEvent::GestureScrollEnd) { |
| + if (state_ == SCROLLING && IsButtonDown(gvr::kControllerButtonClick)) { |
| + std::unique_ptr<WebGestureEvent> tap_down(new WebGestureEvent()); |
| + tap_down->type = WebInputEvent::GestureTapDown; |
| + tap_down->timeStampSeconds = gesture_list.back()->timeStampSeconds; |
| + tap_down->sourceDevice = blink::WebGestureDeviceTouchpad; |
| + tap_down->data.tapDown.width = 0; |
| + tap_down->data.tapDown.height = 0; |
| + gesture_list.push_back(std::move(tap_down)); |
| + Reset(); |
| + } else if (gesture_list.back()->type == WebInputEvent::GestureScrollEnd) { |
| std::unique_ptr<WebGestureEvent> fling(new WebGestureEvent()); |
| fling->timeStampSeconds = gesture_list.back()->timeStampSeconds; |
| fling->sourceDevice = blink::WebGestureDeviceTouchpad; |
| @@ -270,7 +283,8 @@ void VrController::HandleDetectingState(WebGestureEvent* gesture) { |
| // Touch position is changed and the touch point moves outside of slop. |
|
bshe
2016/11/28 16:33:57
update the comment here to include buttondown dete
asimjour1
2016/11/28 21:38:04
Done.
|
| if (UpdateCurrentTouchpoint() && touch_info_->is_touching && |
| - !InSlop(touch_info_->touch_point.position)) { |
| + !InSlop(touch_info_->touch_point.position) && |
| + !IsButtonDown(gvr::kControllerButtonClick)) { |
| state_ = SCROLLING; |
| gesture->type = WebInputEvent::GestureScrollBegin; |
| UpdateGesture(gesture); |