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

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

Issue 2378903005: Implement controller handling in vr_shell.cc (Closed)
Patch Set: Rebase 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
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..8d275a742fa0094a9877f5516cbb33a0328fbd71 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) {
+ } else if (gesture.type == WebInputEvent::MouseMove ||
+ gesture.type == WebInputEvent::MouseEnter ||
+ gesture.type == WebInputEvent::MouseLeave) {
SendMouseMoveEvent(event_time_milliseconds, gesture.details.move.delta.x,
- gesture.details.move.delta.y, gesture.details.move.type);
+ gesture.details.move.delta.y, gesture.type);
}
}
@@ -122,10 +124,10 @@ void VrInputManager::SendScrollEvent(int64_t time_ms,
void VrInputManager::SendMouseMoveEvent(int64_t time_ms,
bshe 2016/10/04 13:50:42 Nit: perhap rename to SendMouseEvent since this is
mthiesse 2016/10/04 14:05:26 Done.
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);

Powered by Google App Engine
This is Rietveld 408576698