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

Unified Diff: components/test_runner/event_sender.cc

Issue 1800143002: Notify Blink about start of gesture scroll through a queued event. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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 31867c91d971bdffbee91640d9c82dac8d67b957..5ad17af1fbdc1c1cb09e7146d30f7ff5292d852c 100644
--- a/components/test_runner/event_sender.cc
+++ b/components/test_runner/event_sender.cc
@@ -20,6 +20,7 @@
#include "gin/handle.h"
#include "gin/object_template_builder.h"
#include "gin/wrappable.h"
+#include "third_party/WebKit/public/platform/WebPointerProperties.h"
#include "third_party/WebKit/public/platform/WebString.h"
#include "third_party/WebKit/public/platform/WebVector.h"
#include "third_party/WebKit/public/web/WebContextMenuData.h"
@@ -45,6 +46,7 @@ using blink::WebMouseEvent;
using blink::WebMouseWheelEvent;
using blink::WebPagePopup;
using blink::WebPoint;
+using blink::WebPointerProperties;
using blink::WebString;
using blink::WebTouchEvent;
using blink::WebTouchPoint;
@@ -494,6 +496,8 @@ class EventSenderBindings : public gin::Wrappable<EventSenderBindings> {
void TouchMoveCausingScrollIfUncanceled();
void TouchCancel();
void TouchEnd();
+ void NotifyStartOfImplScroll();
+ void NotifyEndOfImplScroll();
void LeapForward(int milliseconds);
double LastEventTimestamp();
void BeginDragWithFiles(const std::vector<std::string>& files);
@@ -620,10 +624,12 @@ EventSenderBindings::GetObjectTemplateBuilder(v8::Isolate* isolate) {
&EventSenderBindings::GestureScrollFirstPoint)
.SetMethod("touchStart", &EventSenderBindings::TouchStart)
.SetMethod("touchMove", &EventSenderBindings::TouchMove)
- .SetMethod("touchMoveCausingScrollIfUncanceled",
- &EventSenderBindings::TouchMoveCausingScrollIfUncanceled)
.SetMethod("touchCancel", &EventSenderBindings::TouchCancel)
.SetMethod("touchEnd", &EventSenderBindings::TouchEnd)
+ .SetMethod("notifyStartOfImplScroll",
+ &EventSenderBindings::NotifyStartOfImplScroll)
+ .SetMethod("notifyEndOfImplScroll",
+ &EventSenderBindings::NotifyEndOfImplScroll)
.SetMethod("leapForward", &EventSenderBindings::LeapForward)
.SetMethod("lastEventTimestamp", &EventSenderBindings::LastEventTimestamp)
.SetMethod("beginDragWithFiles", &EventSenderBindings::BeginDragWithFiles)
@@ -810,11 +816,6 @@ void EventSenderBindings::TouchMove() {
sender_->TouchMove();
}
-void EventSenderBindings::TouchMoveCausingScrollIfUncanceled() {
- if (sender_)
- sender_->TouchMoveCausingScrollIfUncanceled();
-}
-
void EventSenderBindings::TouchCancel() {
if (sender_)
sender_->TouchCancel();
@@ -825,6 +826,16 @@ void EventSenderBindings::TouchEnd() {
sender_->TouchEnd();
}
+void EventSenderBindings::NotifyStartOfImplScroll() {
+ if (sender_)
+ sender_->NotifyStartOfImplScroll();
+}
+
+void EventSenderBindings::NotifyEndOfImplScroll() {
+ if (sender_)
+ sender_->NotifyEndOfImplScroll();
+}
+
void EventSenderBindings::LeapForward(int milliseconds) {
if (sender_)
sender_->LeapForward(milliseconds);
@@ -1832,10 +1843,6 @@ void EventSender::TouchMove() {
SendCurrentTouchEvent(WebInputEvent::TouchMove, false);
}
-void EventSender::TouchMoveCausingScrollIfUncanceled() {
- SendCurrentTouchEvent(WebInputEvent::TouchMove, true);
-}
-
void EventSender::TouchCancel() {
SendCurrentTouchEvent(WebInputEvent::TouchCancel, false);
}
@@ -1844,6 +1851,20 @@ void EventSender::TouchEnd() {
SendCurrentTouchEvent(WebInputEvent::TouchEnd, false);
}
+void EventSender::NotifyStartOfImplScroll() {
+ WebGestureEvent gesture_event;
+ gesture_event.type = WebInputEvent::GestureScrollBegin;
+ HandleInputEventOnViewOrPopup(gesture_event,
+ WebInputEventDispatchType::NonBlocking);
+}
+
+void EventSender::NotifyEndOfImplScroll() {
+ WebGestureEvent gesture_event;
+ gesture_event.type = WebInputEvent::GestureScrollEnd;
+ HandleInputEventOnViewOrPopup(gesture_event,
+ WebInputEventDispatchType::NonBlocking);
+}
+
void EventSender::LeapForward(int milliseconds) {
if (is_drag_mode_ && pressed_button_ == WebMouseEvent::ButtonLeft &&
!replaying_saved_events_) {

Powered by Google App Engine
This is Rietveld 408576698