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

Unified Diff: content/shell/renderer/test_runner/event_sender.cc

Issue 755403006: Added experimental Touch.tilt, Touch.tiltDirection support for Android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove unused code (event_sender.cc) Created 5 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
« no previous file with comments | « content/shell/renderer/test_runner/event_sender.h ('k') | ui/events/cocoa/events_mac.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/shell/renderer/test_runner/event_sender.cc
diff --git a/content/shell/renderer/test_runner/event_sender.cc b/content/shell/renderer/test_runner/event_sender.cc
index e54a95872fe3f239c7419605f20afb26038ba3c8..a8ae52231c5f1fc97b78e2edbaac0f75de911c96 100644
--- a/content/shell/renderer/test_runner/event_sender.cc
+++ b/content/shell/renderer/test_runner/event_sender.cc
@@ -381,8 +381,12 @@ class EventSenderBindings : public gin::Wrappable<EventSenderBindings> {
void SetPageScaleFactorLimits(gin::Arguments* args);
void ClearTouchPoints();
void ReleaseTouchPoint(unsigned index);
- void UpdateTouchPoint(unsigned index, double x, double y);
+ void UpdateTouchPoint(unsigned index, float x, float y);
void CancelTouchPoint(unsigned index);
+ void SetTouchPointTilt(unsigned index,
+ float tils,
+ float tiltDirection,
+ bool set_state_moved);
void SetTouchModifier(const std::string& key_name, bool set_mask);
void SetTouchCancelable(bool cancelable);
void DumpFilenameBeingDragged();
@@ -518,6 +522,7 @@ EventSenderBindings::GetObjectTemplateBuilder(v8::Isolate* isolate) {
.SetMethod("releaseTouchPoint", &EventSenderBindings::ReleaseTouchPoint)
.SetMethod("updateTouchPoint", &EventSenderBindings::UpdateTouchPoint)
.SetMethod("cancelTouchPoint", &EventSenderBindings::CancelTouchPoint)
+ .SetMethod("setTouchPointTilt", &EventSenderBindings::SetTouchPointTilt)
.SetMethod("setTouchModifier", &EventSenderBindings::SetTouchModifier)
.SetMethod("setTouchCancelable", &EventSenderBindings::SetTouchCancelable)
.SetMethod("dumpFilenameBeingDragged",
@@ -697,9 +702,9 @@ void EventSenderBindings::ReleaseTouchPoint(unsigned index) {
sender_->ReleaseTouchPoint(index);
}
-void EventSenderBindings::UpdateTouchPoint(unsigned index, double x, double y) {
+void EventSenderBindings::UpdateTouchPoint(unsigned index, float x, float y) {
if (sender_)
- sender_->UpdateTouchPoint(index, static_cast<float>(x), static_cast<float>(y));
+ sender_->UpdateTouchPoint(index, x, y);
}
void EventSenderBindings::CancelTouchPoint(unsigned index) {
@@ -707,6 +712,14 @@ void EventSenderBindings::CancelTouchPoint(unsigned index) {
sender_->CancelTouchPoint(index);
}
+void EventSenderBindings::SetTouchPointTilt(unsigned index,
+ float tilt,
+ float tiltDirection,
+ bool set_state_moved) {
+ if (sender_)
+ sender_->SetTouchPointTilt(index, tilt, tiltDirection, set_state_moved);
+}
+
void EventSenderBindings::SetTouchModifier(const std::string& key_name,
bool set_mask) {
if (sender_)
@@ -1617,6 +1630,22 @@ void EventSender::CancelTouchPoint(unsigned index) {
touch_point->state = WebTouchPoint::StateCancelled;
}
+void EventSender::SetTouchPointTilt(unsigned index,
+ float tilt,
+ float tiltDirection,
+ bool set_state_moved) {
+ if (index >= touch_points_.size()) {
+ ThrowTouchPointError();
+ return;
+ }
+
+ WebTouchPoint* touch_point = &touch_points_[index];
+ touch_point->tilt = tilt;
+ touch_point->tiltDirection = tiltDirection;
+ if (set_state_moved)
+ touch_point->state = WebTouchPoint::StateMoved;
+}
+
void EventSender::SetTouchModifier(const std::string& key_name,
bool set_mask) {
int mask = 0;
« no previous file with comments | « content/shell/renderer/test_runner/event_sender.h ('k') | ui/events/cocoa/events_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698