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

Unified Diff: chrome/browser/android/vr_shell/vr_input_manager.cc

Issue 2378903005: Implement controller handling in vr_shell.cc (Closed)
Patch Set: Address comments Created 4 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
« no previous file with comments | « chrome/browser/android/vr_shell/vr_input_manager.h ('k') | chrome/browser/android/vr_shell/vr_shell.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/android/vr_shell/vr_input_manager.cc
diff --git a/chrome/browser/android/vr_shell/vr_input_manager.cc b/chrome/browser/android/vr_shell/vr_input_manager.cc
index e77d09a168e9eeb215a5600488be0706214c0841..a69e622f7cadff0f2923cd145258deccdfeba4b2 100644
--- a/chrome/browser/android/vr_shell/vr_input_manager.cc
+++ b/chrome/browser/android/vr_shell/vr_input_manager.cc
@@ -43,9 +43,11 @@ void VrInputManager::SendGesture(VrGesture gesture) {
} else if (gesture.type == WebInputEvent::GestureTap) {
SendClickEvent(event_time_milliseconds, gesture.details.buttons.pos.x,
gesture.details.buttons.pos.y);
- } else if (gesture.type == WebInputEvent::MouseMove) {
- SendMouseMoveEvent(event_time_milliseconds, gesture.details.move.delta.x,
- gesture.details.move.delta.y, gesture.details.move.type);
+ } else if (gesture.type == WebInputEvent::MouseMove ||
+ gesture.type == WebInputEvent::MouseEnter ||
+ gesture.type == WebInputEvent::MouseLeave) {
+ SendMouseEvent(event_time_milliseconds, gesture.details.move.delta.x,
+ gesture.details.move.delta.y, gesture.type);
}
}
@@ -119,13 +121,13 @@ void VrInputManager::SendScrollEvent(int64_t time_ms,
}
}
-void VrInputManager::SendMouseMoveEvent(int64_t time_ms,
+void VrInputManager::SendMouseEvent(int64_t time_ms,
float x,
float y,
- int type) {
+ WebInputEvent::Type type) {
WebMouseEvent result;
- result.type = WebInputEvent::MouseMove;
+ result.type = type;
result.pointerType = blink::WebPointerProperties::PointerType::Mouse;
result.x = x / dpi_scale_;
result.y = y / dpi_scale_;
@@ -134,12 +136,6 @@ void VrInputManager::SendMouseMoveEvent(int64_t time_ms,
result.timeStampSeconds = time_ms / 1000.0;
result.clickCount = 1;
result.modifiers = 0;
-
- if (type == 1) {
- result.type = WebInputEvent::MouseEnter;
- } else if (type == 2) {
- result.type = WebInputEvent::MouseLeave;
- }
result.button = WebMouseEvent::Button::NoButton;
ForwardMouseEvent(result);
« no previous file with comments | « chrome/browser/android/vr_shell/vr_input_manager.h ('k') | chrome/browser/android/vr_shell/vr_shell.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698