| Index: content/browser/renderer_host/input/touch_emulator.cc
|
| diff --git a/content/browser/renderer_host/input/touch_emulator.cc b/content/browser/renderer_host/input/touch_emulator.cc
|
| index cdbc77da53e43b4ef5d218b667589b96fe3d46b3..f09716a68c8e3ec8019d51afffcd99cd12dac98e 100644
|
| --- a/content/browser/renderer_host/input/touch_emulator.cc
|
| +++ b/content/browser/renderer_host/input/touch_emulator.cc
|
| @@ -39,6 +39,12 @@ ui::GestureProvider::Config GetEmulatorGestureProviderConfig(
|
| return config;
|
| }
|
|
|
| +int ModifiersWithoutMouseButtons(const WebInputEvent& event) {
|
| + const int all_buttons = WebInputEvent::LeftButtonDown |
|
| + WebInputEvent::MiddleButtonDown | WebInputEvent::RightButtonDown;
|
| + return event.modifiers & ~all_buttons;
|
| +}
|
| +
|
| // Time between two consecutive mouse moves, during which second mouse move
|
| // is not converted to touch.
|
| const double kMouseMoveDropIntervalSeconds = 5.f / 1000;
|
| @@ -398,7 +404,7 @@ void TouchEmulator::PinchEnd(const WebGestureEvent& event) {
|
|
|
| void TouchEmulator::FillPinchEvent(const WebInputEvent& event) {
|
| pinch_event_.timeStampSeconds = event.timeStampSeconds;
|
| - pinch_event_.modifiers = event.modifiers;
|
| + pinch_event_.modifiers = ModifiersWithoutMouseButtons(event);
|
| pinch_event_.sourceDevice = blink::WebGestureDeviceTouchscreen;
|
| pinch_event_.x = pinch_anchor_.x();
|
| pinch_event_.y = pinch_anchor_.y();
|
| @@ -407,7 +413,7 @@ void TouchEmulator::FillPinchEvent(const WebInputEvent& event) {
|
| void TouchEmulator::ScrollEnd(const WebGestureEvent& event) {
|
| WebGestureEvent scroll_event;
|
| scroll_event.timeStampSeconds = event.timeStampSeconds;
|
| - scroll_event.modifiers = event.modifiers;
|
| + scroll_event.modifiers = ModifiersWithoutMouseButtons(event);
|
| scroll_event.sourceDevice = blink::WebGestureDeviceTouchscreen;
|
| scroll_event.type = WebInputEvent::GestureScrollEnd;
|
| client_->ForwardEmulatedGestureEvent(scroll_event);
|
| @@ -430,7 +436,7 @@ void TouchEmulator::FillTouchEventAndPoint(const WebMouseEvent& mouse_event) {
|
| NOTREACHED() << "Invalid event for touch emulation: " << mouse_event.type;
|
| }
|
| touch_event_.touchesLength = 1;
|
| - touch_event_.modifiers = mouse_event.modifiers;
|
| + touch_event_.modifiers = ModifiersWithoutMouseButtons(mouse_event);
|
| WebTouchEventTraits::ResetTypeAndTouchStates(
|
| eventType, mouse_event.timeStampSeconds, &touch_event_);
|
|
|
|
|