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

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

Issue 2054193002: Android mouse events shouldn't appear as TouchEvents (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed a test, etc. Created 4 years, 1 month 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/web_input_event_builders_android.cc
diff --git a/content/browser/renderer_host/input/web_input_event_builders_android.cc b/content/browser/renderer_host/input/web_input_event_builders_android.cc
index 016665399a487bceb948b457ef39652e539189a8..9e893110611bd8c163e015505bec316321f225ef 100644
--- a/content/browser/renderer_host/input/web_input_event_builders_android.cc
+++ b/content/browser/renderer_host/input/web_input_event_builders_android.cc
@@ -112,32 +112,39 @@ WebKeyboardEvent WebKeyboardEventBuilder::Build(
}
WebMouseEvent WebMouseEventBuilder::Build(
- WebInputEvent::Type type,
- WebMouseEvent::Button button,
- double time_sec,
- int window_x,
- int window_y,
- int modifiers,
- int click_count,
- WebPointerProperties::PointerType pointer_type) {
+ WebInputEvent::Type type,
+ double time_sec,
+ int window_x,
+ int window_y,
+ int modifiers,
+ int click_count,
+ int pointer_id,
+ float pressure,
+ float orientation_rad,
+ float tilt_rad,
+ int changed_button,
+ int tool_type) {
DCHECK(WebInputEvent::isMouseEventType(type));
WebMouseEvent result;
result.type = type;
- result.pointerType = pointer_type;
result.x = window_x;
result.y = window_y;
result.windowX = window_x;
result.windowY = window_y;
result.timeStampSeconds = time_sec;
result.clickCount = click_count;
- result.modifiers = modifiers;
-
- if (type == WebInputEvent::MouseDown || type == WebInputEvent::MouseUp)
- result.button = button;
- else
- result.button = WebMouseEvent::Button::NoButton;
+ result.modifiers = ui::EventFlagsToWebEventModifiers(modifiers);
+
+ ui::SetWebPointerPropertiesFromMotionEventData(
+ result,
+ pointer_id,
+ pressure,
+ orientation_rad,
+ tilt_rad,
+ changed_button,
+ tool_type);
return result;
}

Powered by Google App Engine
This is Rietveld 408576698