Chromium Code Reviews| 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 ed9134b1d6b1b853d2e24d8ab59bcb503d047f15..425c1574a9700516aa6ebb45488f6f81fb1acd68 100644 |
| --- a/content/browser/renderer_host/input/touch_emulator.cc |
| +++ b/content/browser/renderer_host/input/touch_emulator.cc |
| @@ -11,6 +11,7 @@ |
| #include "content/public/common/content_client.h" |
| #include "content/public/common/content_switches.h" |
| #include "third_party/WebKit/public/platform/WebCursorInfo.h" |
| +#include "ui/events/base_event_utils.h" |
| #include "ui/events/blink/blink_event_util.h" |
| #include "ui/events/gesture_detection/gesture_provider_config_helper.h" |
| #include "ui/gfx/image/image.h" |
| @@ -225,6 +226,7 @@ bool TouchEmulator::HandleTouchEvent(const blink::WebTouchEvent& event) { |
| void TouchEmulator::HandleEmulatedTouchEvent(blink::WebTouchEvent event) { |
| DCHECK(gesture_provider_); |
| + DCHECK_GT(event.uniqueTouchEventId, 0U); |
| auto result = gesture_provider_->OnTouchEvent(MotionEventWeb(event)); |
| if (!result.succeeded) |
| return; |
| @@ -344,6 +346,7 @@ void TouchEmulator::CancelTouch() { |
| WebInputEvent::TouchCancel, |
| (base::TimeTicks::Now() - base::TimeTicks()).InSecondsF(), |
| &touch_event_); |
| + touch_event_.uniqueTouchEventId = ui::GetNextTouchEventId(); |
|
jdduke (slow)
2015/04/21 22:40:16
Can we move this logic into |HandleEmulatedTouchEv
lanwei
2015/04/22 20:51:31
I put setting uniqueTouchEventId into these two fu
|
| DCHECK(gesture_provider_); |
| if (gesture_provider_->GetCurrentDownEvent()) |
| HandleEmulatedTouchEvent(touch_event_); |
| @@ -429,6 +432,7 @@ void TouchEmulator::FillTouchEventAndPoint(const WebMouseEvent& mouse_event) { |
| } |
| touch_event_.touchesLength = 1; |
| touch_event_.modifiers = mouse_event.modifiers; |
| + touch_event_.uniqueTouchEventId = ui::GetNextTouchEventId(); |
| WebTouchEventTraits::ResetTypeAndTouchStates( |
| eventType, mouse_event.timeStampSeconds, &touch_event_); |