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

Unified Diff: components/test_runner/event_sender.cc

Issue 2669663002: Move touch slop suppression to TouchEventManager (Closed)
Patch Set: slop regesion Created 3 years, 10 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
Index: components/test_runner/event_sender.cc
diff --git a/components/test_runner/event_sender.cc b/components/test_runner/event_sender.cc
index 7f38826f9b52e91b910257135d2fa7d2086bdb54..74b95d25e38f5327bc33095aae5e275dcaa67267 100644
--- a/components/test_runner/event_sender.cc
+++ b/components/test_runner/event_sender.cc
@@ -2236,22 +2236,6 @@ void EventSender::DoLeapForward(int milliseconds) {
time_offset_ms_ += milliseconds;
}
-void EventSender::GetOptionalTouchArgs(gin::Arguments* args,
- bool& moved_beyond_slop_region,
- uint32_t& unique_touch_event_id) {
- moved_beyond_slop_region = false;
- if(!args->PeekNext().IsEmpty() && args->PeekNext()->IsString()) {
- std::string arg;
- if (args->GetNext(&arg) && arg == "movedBeyondSlopRegion")
- moved_beyond_slop_region = true;
- else
- args->ThrowError();
- }
-
- unique_touch_event_id = GetUniqueTouchEventId(args);
- return;
-}
-
uint32_t EventSender::GetUniqueTouchEventId(gin::Arguments* args) {
uint32_t unique_touch_event_id;
if(!args->PeekNext().IsEmpty() && args->GetNext(&unique_touch_event_id))
@@ -2262,9 +2246,7 @@ uint32_t EventSender::GetUniqueTouchEventId(gin::Arguments* args) {
void EventSender::SendCurrentTouchEvent(WebInputEvent::Type type,
gin::Arguments* args) {
- bool moved_beyond_slop_region;
- uint32_t unique_touch_event_id;
- GetOptionalTouchArgs(args, moved_beyond_slop_region, unique_touch_event_id);
+ uint32_t unique_touch_event_id = GetUniqueTouchEventId(args);
DCHECK_GT(static_cast<unsigned>(WebTouchEvent::kTouchesLengthCap),
touch_points_.size());
@@ -2275,7 +2257,7 @@ void EventSender::SendCurrentTouchEvent(WebInputEvent::Type type,
touch_event.dispatchType = touch_cancelable_
? WebInputEvent::Blocking
: WebInputEvent::EventNonBlocking;
- touch_event.movedBeyondSlopRegion = moved_beyond_slop_region;
+ touch_event.movedBeyondSlopRegion = true;
touch_event.uniqueTouchEventId = unique_touch_event_id;
touch_event.touchesLength = touch_points_.size();
for (size_t i = 0; i < touch_points_.size(); ++i)
« no previous file with comments | « components/test_runner/event_sender.h ('k') | content/browser/renderer_host/input/legacy_touch_event_queue.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698