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

Unified Diff: third_party/WebKit/Source/web/WebInputEventConversion.cpp

Issue 1403893003: Plumb gesture source value through Blink. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Convert more tests (related to CL) to use Touchscreen. Created 5 years, 2 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: third_party/WebKit/Source/web/WebInputEventConversion.cpp
diff --git a/third_party/WebKit/Source/web/WebInputEventConversion.cpp b/third_party/WebKit/Source/web/WebInputEventConversion.cpp
index c6393b11828791cbde9f131df686effc738a73dd..434da38b72f557f9334d45f3379018cea43523f2 100644
--- a/third_party/WebKit/Source/web/WebInputEventConversion.cpp
+++ b/third_party/WebKit/Source/web/WebInputEventConversion.cpp
@@ -254,6 +254,16 @@ PlatformGestureEventBuilder::PlatformGestureEventBuilder(Widget* widget, const W
m_globalPosition = IntPoint(e.globalX, e.globalY);
m_timestamp = e.timeStampSeconds;
m_modifiers = e.modifiers;
+ switch (e.sourceDevice) {
+ case WebGestureDeviceTouchpad:
+ m_source = PlatformGestureSourceTouchpad;
+ break;
+ case WebGestureDeviceTouchscreen:
+ m_source = PlatformGestureSourceTouchscreen;
+ break;
+ case WebGestureDeviceUninitialized:
+ ASSERT_NOT_REACHED();
+ }
}
// MakePlatformKeyboardEvent --------------------------------------------------
@@ -701,6 +711,17 @@ WebGestureEventBuilder::WebGestureEventBuilder(const LayoutObject* layoutObject,
IntPoint localPoint = convertAbsoluteLocationForLayoutObject(event.absoluteLocation(), *layoutObject);
x = localPoint.x();
y = localPoint.y();
+
+ switch (event.source()) {
+ case GestureSourceTouchpad:
+ sourceDevice = WebGestureDeviceTouchpad;
+ break;
+ case GestureSourceTouchscreen:
+ sourceDevice = WebGestureDeviceTouchscreen;
+ break;
+ case GestureSourceUninitialized:
+ ASSERT_NOT_REACHED();
+ }
}
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/web/LinkHighlightImplTest.cpp ('k') | third_party/WebKit/Source/web/WebViewImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698