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

Unified Diff: content/browser/renderer_host/input/synthetic_touch_driver.cc

Issue 2634183002: Support multi-button press for synthetic mouse events (Closed)
Patch Set: Test modifiers and button Created 3 years, 11 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: content/browser/renderer_host/input/synthetic_touch_driver.cc
diff --git a/content/browser/renderer_host/input/synthetic_touch_driver.cc b/content/browser/renderer_host/input/synthetic_touch_driver.cc
index 3adb753c6162b1c65e3a2d338e5aaad29ff77849..5d3a8769b68e7136cbe05a79221283beaa81a9d3 100644
--- a/content/browser/renderer_host/input/synthetic_touch_driver.cc
+++ b/content/browser/renderer_host/input/synthetic_touch_driver.cc
@@ -22,11 +22,12 @@ SyntheticTouchDriver::~SyntheticTouchDriver() {}
void SyntheticTouchDriver::DispatchEvent(SyntheticGestureTarget* target,
const base::TimeTicks& timestamp) {
touch_event_.setTimeStampSeconds(ConvertTimestampToSeconds(timestamp));
- target->DispatchInputEventToPlatform(touch_event_);
+ if (touch_event_.type() != blink::WebInputEvent::Undefined)
+ target->DispatchInputEventToPlatform(touch_event_);
touch_event_.ResetPoints();
}
-void SyntheticTouchDriver::Press(float x, float y, int index) {
+void SyntheticTouchDriver::Press(float x, float y, int index, int button) {
DCHECK_GE(index, 0);
DCHECK_LT(index, blink::WebTouchEvent::kTouchesLengthCap);
int touch_index = touch_event_.PressPoint(x, y);
@@ -39,7 +40,7 @@ void SyntheticTouchDriver::Move(float x, float y, int index) {
touch_event_.MovePoint(index_map_[index], x, y);
}
-void SyntheticTouchDriver::Release(int index) {
+void SyntheticTouchDriver::Release(int index, int button) {
DCHECK_GE(index, 0);
DCHECK_LT(index, blink::WebTouchEvent::kTouchesLengthCap);
touch_event_.ReleasePoint(index_map_[index]);

Powered by Google App Engine
This is Rietveld 408576698