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

Unified Diff: blimp/common/proto/input.proto

Issue 1426993008: Serialize a subset of WebInputEvents to protobufs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 5 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: blimp/common/proto/input.proto
diff --git a/blimp/common/proto/input.proto b/blimp/common/proto/input.proto
index 8e793e787c051d33977f39ff6cc796b64cafb9f3..8a94011cd471b4e598f258818e6885f342d1eb9c 100644
--- a/blimp/common/proto/input.proto
+++ b/blimp/common/proto/input.proto
@@ -4,8 +4,8 @@
//
// Message definitions for the input subprotocol.
//
-// Current definitions are just placeholders and are NOT final.
-// Feel free to modify this interface as necessary during feature work.
+// The InputMessage protobuf is a serialized representation of the
+// blink::WebInputEvent POD struct.
syntax = "proto2";
@@ -15,24 +15,118 @@ import "common.proto";
package blimp;
-message ClickArgs {
- optional CoordinatePair target = 1;
+enum WebGestureDevice {
+ WebGestureDevice_Uninitialized = 0;
+ WebGestureDevice_Touchpad = 1;
+ WebGestureDevice_Touchscreen = 2;
}
Kevin M 2015/11/12 00:53:50 It would be nice to reference the Blink analogues
David Trainor- moved to gerrit 2015/11/12 16:34:28 Done.
-message DragArgs {
- optional CoordinatePair origin = 1;
- optional CoordinatePair destination = 2;
- optional CoordinatePair elastic_overscroll = 3;
+message GestureArgs {
+ message Tap {
+ optional int32 tap_count = 1;
+ optional float width = 2;
+ optional float height = 3;
+ }
+
+ message TapDown {
+ optional float width = 1;
+ optional float height = 2;
+ }
+
+ message ShowPress {
+ optional float width = 1;
+ optional float height = 2;
+ }
+
+ message LongPress {
+ optional float width = 1;
+ optional float height = 2;
+ }
+
+ message TwoFingerTap {
+ optional float first_finger_width = 1;
+ optional float first_finger_height = 2;
+ }
+
+ message ScrollBegin {
+ optional float delta_x_hint = 1;
+ optional float delta_y_hint = 2;
+ optional bool target_viewport = 3;
+ }
+
+ message ScrollUpdate {
+ optional float delta_x = 1;
+ optional float delta_y = 2;
+ optional float velocity_x = 3;
+ optional float velocity_y = 4;
+ optional bool previous_update_in_sequence_prevented = 5;
+ optional bool prevent_propagation = 6;
+ optional bool inertial = 7;
+ }
+
+ message FlingStart {
+ optional float velocity_x = 1;
+ optional float velocity_y = 2;
+ optional bool target_viewport = 3;
+ }
+
+ message FlingCancel {
+ optional bool prevent_boosting = 1;
+ }
+
+ message PinchUpdate {
+ optional bool zoom_disabled = 1;
+ optional float scale = 2;
+ }
+
+ optional int64 x = 1;
+ optional int64 y = 2;
+ optional int64 global_x = 3;
+ optional int64 global_y = 4;
+ optional WebGestureDevice source_device = 5;
+
+ // Purposely omitting WebGestureEvent::resendingPluginId.
+
+ // Tap represents GestureTap, GestureTapUnconfirmed, and GestureDoubleTap.
+ optional Tap tap = 1000;
+ optional TapDown tap_down = 1001;
+ optional ShowPress show_press = 1002;
+ optional LongPress long_press = 1003;
+ optional TwoFingerTap two_finger_tap = 1004;
+ optional ScrollBegin scroll_begin = 1005;
+ optional ScrollUpdate scroll_update = 1006;
+ optional FlingStart fling_start = 1007;
+ optional FlingCancel fling_cancel = 1008;
+ optional PinchUpdate pinch_update = 1009;
}
message InputMessage {
enum Type {
- CLICK = 1;
- DRAG = 2;
+ Type_Undefined = -1;
+
+ // TODO(dtrainor): Support other types of WebInputEvents in the future?
+ Type_GestureScrollBegin = 1;
+ Type_GestureScrollEnd = 2;
+ Type_GestureScrollUpdate = 3;
+ Type_GestureFlingStart = 4;
+ Type_GestureFlingCancel = 5;
+ Type_GestureShowPress = 6;
+ Type_GestureTap = 7;
+ Type_GestureTapUnconfirmed = 8;
+ Type_GestureTapDown = 9;
+ Type_GestureTapCancel = 10;
+ Type_GestureDoubleTap = 11;
+ Type_GestureTwoFingerTap = 12;
+ Type_GestureLongPress = 13;
+ Type_GestureLongTap = 14;
+ Type_GesturePinchBegin = 15;
+ Type_GesturePinchEnd = 16;
+ Type_GesturePinchUpdate = 17;
}
+
optional Type type = 1;
+ optional double timestamp_seconds = 2;
- optional ClickArgs click = 1000;
- optional DragArgs drag = 1001;
+ optional GestureArgs gesture = 1000;
}

Powered by Google App Engine
This is Rietveld 408576698