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

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

Issue 2573073003: Collapse the API surface on WebInputEvent via accessor functions. (Closed)
Patch Set: Fix nits Created 3 years, 11 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_controller.cc ('k') | chrome/browser/android/vr_shell/vr_shell_gl.cc » ('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 62b3aafb9d67392eafa745edd87d523449f908e6..e8ceb40ca4f51631706b59e5cb61ae8a5b82ae9d 100644
--- a/chrome/browser/android/vr_shell/vr_input_manager.cc
+++ b/chrome/browser/android/vr_shell/vr_input_manager.cc
@@ -21,11 +21,9 @@ WebGestureEvent MakeGestureEvent(WebInputEvent::Type type,
double time,
float x,
float y) {
- WebGestureEvent result;
- result.type = type;
+ WebGestureEvent result(type, WebInputEvent::NoModifiers, time);
result.x = x;
result.y = y;
- result.timeStampSeconds = time;
result.sourceDevice = blink::WebGestureDeviceTouchpad;
return result;
}
@@ -44,7 +42,7 @@ base::WeakPtr<VrInputManager> VrInputManager::GetWeakPtr() {
void VrInputManager::ProcessUpdatedGesture(
std::unique_ptr<blink::WebInputEvent> event) {
- if (WebInputEvent::isMouseEventType(event->type)) {
+ if (WebInputEvent::isMouseEventType(event->type())) {
ForwardMouseEvent(static_cast<const blink::WebMouseEvent&>(*event));
} else {
SendGesture(static_cast<const blink::WebGestureEvent&>(*event));
@@ -52,12 +50,12 @@ void VrInputManager::ProcessUpdatedGesture(
}
void VrInputManager::SendGesture(const WebGestureEvent& gesture) {
- if (gesture.type == WebGestureEvent::GestureTapDown) {
+ if (gesture.type() == WebGestureEvent::GestureTapDown) {
ForwardGestureEvent(gesture);
// Generate and forward Tap
WebGestureEvent tap_event =
- MakeGestureEvent(WebInputEvent::GestureTap, gesture.timeStampSeconds,
+ MakeGestureEvent(WebInputEvent::GestureTap, gesture.timeStampSeconds(),
gesture.x, gesture.y);
tap_event.data.tap.tapCount = 1;
ForwardGestureEvent(tap_event);
« no previous file with comments | « chrome/browser/android/vr_shell/vr_controller.cc ('k') | chrome/browser/android/vr_shell/vr_shell_gl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698