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

Unified Diff: blimp/net/input_message_converter.cc

Issue 1975213003: Blimp Client: add support for tap gesture events (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 7 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 | « blimp/engine/session/blimp_engine_session.cc ('k') | blimp/net/input_message_generator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: blimp/net/input_message_converter.cc
diff --git a/blimp/net/input_message_converter.cc b/blimp/net/input_message_converter.cc
index 99427c6a155d87e2e22d5d2821bddb1842f6f56b..7badd7132ff4b29a6c736a501c4d44584c234322 100644
--- a/blimp/net/input_message_converter.cc
+++ b/blimp/net/input_message_converter.cc
@@ -126,6 +126,49 @@ std::unique_ptr<blink::WebGestureEvent> ProtoToGesturePinchUpdate(
return event;
}
+std::unique_ptr<blink::WebGestureEvent> ProtoToGestureTapDown(
+ const InputMessage& proto) {
+ std::unique_ptr<blink::WebGestureEvent> event(
+ BuildCommonWebGesture(proto, blink::WebInputEvent::Type::GestureTapDown));
+
+ const GestureTapDown& details = proto.gesture_tap_down();
+ event->data.tapDown.width = details.width();
+ event->data.tapDown.height = details.height();
+
+ return event;
+}
+
+std::unique_ptr<blink::WebGestureEvent> ProtoToGestureTapCancel(
+ const InputMessage& proto) {
+ return BuildCommonWebGesture(proto,
+ blink::WebInputEvent::Type::GestureTapCancel);
+}
+
+std::unique_ptr<blink::WebGestureEvent> ProtoToGestureTapUnconfirmed(
+ const InputMessage& proto) {
+ std::unique_ptr<blink::WebGestureEvent> event(BuildCommonWebGesture(
+ proto, blink::WebInputEvent::Type::GestureTapUnconfirmed));
+
+ const GestureTap& details = proto.gesture_tap();
+ event->data.tap.tapCount = details.tap_count();
+ event->data.tap.width = details.width();
+ event->data.tap.height = details.height();
+
+ return event;
+}
+
+std::unique_ptr<blink::WebGestureEvent> ProtoToGestureShowPress(
+ const InputMessage& proto) {
+ std::unique_ptr<blink::WebGestureEvent> event(BuildCommonWebGesture(
+ proto, blink::WebInputEvent::Type::GestureShowPress));
+
+ const GestureShowPress& details = proto.gesture_show_press();
+ event->data.showPress.width = details.width();
+ event->data.showPress.height = details.height();
+
+ return event;
+}
+
} // namespace
InputMessageConverter::InputMessageConverter() {}
@@ -164,6 +207,18 @@ std::unique_ptr<blink::WebGestureEvent> InputMessageConverter::ProcessMessage(
case InputMessage::Type_GesturePinchUpdate:
event = ProtoToGesturePinchUpdate(message);
break;
+ case InputMessage::Type_GestureTapDown:
+ event = ProtoToGestureTapDown(message);
+ break;
+ case InputMessage::Type_GestureTapCancel:
+ event = ProtoToGestureTapCancel(message);
+ break;
+ case InputMessage::Type_GestureTapUnconfirmed:
+ event = ProtoToGestureTapUnconfirmed(message);
+ break;
+ case InputMessage::Type_GestureShowPress:
+ event = ProtoToGestureShowPress(message);
+ break;
case InputMessage::UNKNOWN:
DLOG(FATAL) << "Received an InputMessage with an unknown type.";
return nullptr;
« no previous file with comments | « blimp/engine/session/blimp_engine_session.cc ('k') | blimp/net/input_message_generator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698