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

Unified Diff: content/browser/renderer_host/web_input_event_aura.cc

Issue 8907005: Add support for new scroll valuators coming from CMT (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Review nits Created 9 years 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/web_input_event_aura.cc
diff --git a/content/browser/renderer_host/web_input_event_aura.cc b/content/browser/renderer_host/web_input_event_aura.cc
index e57c74f71ba2749d0b7f9913bc0c376c7588764b..6405303dfb5608bb725da36cba32224427363ed0 100644
--- a/content/browser/renderer_host/web_input_event_aura.cc
+++ b/content/browser/renderer_host/web_input_event_aura.cc
@@ -22,6 +22,8 @@ WebKit::WebTouchPoint* UpdateWebTouchEventFromNativeEvent(
WebKit::WebMouseEvent MakeWebMouseEventFromAuraEvent(aura::MouseEvent* event);
WebKit::WebMouseWheelEvent MakeWebMouseWheelEventFromAuraEvent(
aura::MouseEvent* event);
+WebKit::WebMouseWheelEvent MakeWebMouseWheelEventFromAuraEvent(
+ aura::ScrollEvent* event);
WebKit::WebKeyboardEvent MakeWebKeyboardEventFromAuraEvent(
aura::KeyEvent* event);
WebKit::WebTouchPoint* UpdateWebTouchEventFromAuraEvent(
@@ -96,6 +98,29 @@ WebKit::WebMouseWheelEvent MakeWebMouseWheelEvent(aura::MouseEvent* event) {
return webkit_event;
}
+WebKit::WebMouseWheelEvent MakeWebMouseWheelEvent(aura::ScrollEvent* event) {
+#if defined(OS_WIN)
+ // Construct an untranslated event from the platform event data.
+ WebKit::WebMouseWheelEvent webkit_event =
+ MakeUntranslatedWebMouseWheelEventFromNativeEvent(event->native_event());
+#else
+ WebKit::WebMouseWheelEvent webkit_event =
+ MakeWebMouseWheelEventFromAuraEvent(event);
+#endif
+
+ // Replace the event's coordinate fields with translated position data from
+ // |event|.
+ webkit_event.windowX = webkit_event.x = event->x();
+ webkit_event.windowY = webkit_event.y = event->y();
+
+ const gfx::Point host_point =
+ ui::EventLocationFromNative(event->native_event());
+ webkit_event.globalX = host_point.x();
+ webkit_event.globalY = host_point.y();
+
+ return webkit_event;
+}
+
WebKit::WebKeyboardEvent MakeWebKeyboardEvent(aura::KeyEvent* event) {
// Windows can figure out whether or not to construct a RawKeyDown or a Char
// WebInputEvent based on the type of message carried in
« no previous file with comments | « content/browser/renderer_host/web_input_event_aura.h ('k') | content/browser/renderer_host/web_input_event_aurax11.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698