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

Side by Side 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: Addressed comments. 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 // 4 //
5 // Message definitions for the input subprotocol. 5 // Message definitions for the input subprotocol.
6 // 6 //
7 // Current definitions are just placeholders and are NOT final. 7 // The InputMessage protobuf is a serialized representation of the
8 // Feel free to modify this interface as necessary during feature work. 8 // blink::WebInputEvent POD struct.
9 9
10 syntax = "proto2"; 10 syntax = "proto2";
11 11
12 option optimize_for = LITE_RUNTIME; 12 option optimize_for = LITE_RUNTIME;
13 13
14 import "common.proto"; 14 import "common.proto";
15 15
16 package blimp; 16 package blimp;
17 17
18 message ClickArgs { 18 // See blink::WebGestureDevice at
19 optional CoordinatePair target = 1; 19 // third_party/WebKit/public/platform/WebGestureDevice.h.
20 enum WebGestureDevice {
21 WebGestureDevice_Uninitialized = 0;
22 WebGestureDevice_Touchpad = 1;
23 WebGestureDevice_Touchscreen = 2;
20 } 24 }
21 25
22 message DragArgs { 26 // See blink::WebGestureEvent at third_party/WebKit/public/web/WebInputEvent.h.
23 optional CoordinatePair origin = 1; 27 // The inner messages represent the |data| union structs in WebGestureEvent.
24 optional CoordinatePair destination = 2; 28 message GestureArgs {
25 optional CoordinatePair elastic_overscroll = 3; 29 message Tap {
30 optional int32 tap_count = 1;
31 optional float width = 2;
32 optional float height = 3;
33 }
34
35 message TapDown {
36 optional float width = 1;
37 optional float height = 2;
38 }
39
40 message ShowPress {
41 optional float width = 1;
42 optional float height = 2;
43 }
44
45 message LongPress {
46 optional float width = 1;
47 optional float height = 2;
48 }
49
50 message TwoFingerTap {
51 optional float first_finger_width = 1;
52 optional float first_finger_height = 2;
53 }
54
55 message ScrollBegin {
56 optional float delta_x_hint = 1;
57 optional float delta_y_hint = 2;
58 optional bool target_viewport = 3;
59 }
60
61 message ScrollUpdate {
62 optional float delta_x = 1;
63 optional float delta_y = 2;
64 optional float velocity_x = 3;
65 optional float velocity_y = 4;
66 optional bool previous_update_in_sequence_prevented = 5;
67 optional bool prevent_propagation = 6;
68 optional bool inertial = 7;
69 }
70
71 message FlingStart {
72 optional float velocity_x = 1;
73 optional float velocity_y = 2;
74 optional bool target_viewport = 3;
75 }
76
77 message FlingCancel {
78 optional bool prevent_boosting = 1;
79 }
80
81 message PinchUpdate {
82 optional bool zoom_disabled = 1;
83 optional float scale = 2;
84 }
85
86 optional int64 x = 1;
87 optional int64 y = 2;
88 optional int64 global_x = 3;
89 optional int64 global_y = 4;
90 optional WebGestureDevice source_device = 5;
91
92 // Purposely omitting WebGestureEvent::resendingPluginId.
93
94 // Tap represents GestureTap, GestureTapUnconfirmed, and GestureDoubleTap.
95 optional Tap tap = 1000;
96 optional TapDown tap_down = 1001;
97 optional ShowPress show_press = 1002;
98 optional LongPress long_press = 1003;
99 optional TwoFingerTap two_finger_tap = 1004;
100 optional ScrollBegin scroll_begin = 1005;
101 optional ScrollUpdate scroll_update = 1006;
102 optional FlingStart fling_start = 1007;
103 optional FlingCancel fling_cancel = 1008;
104 optional PinchUpdate pinch_update = 1009;
26 } 105 }
27 106
107 // See blink::WebInputEvent at third_party/WebKit/public/web/WebInputEvent.h.
28 message InputMessage { 108 message InputMessage {
29 enum Type { 109 enum Type {
30 CLICK = 1; 110 Type_Undefined = -1;
31 DRAG = 2; 111
112 // TODO(dtrainor): Support other types of WebInputEvents in the future?
113 Type_GestureScrollBegin = 1;
114 Type_GestureScrollEnd = 2;
115 Type_GestureScrollUpdate = 3;
116 Type_GestureFlingStart = 4;
117 Type_GestureFlingCancel = 5;
118 Type_GestureShowPress = 6;
119 Type_GestureTap = 7;
120 Type_GestureTapUnconfirmed = 8;
121 Type_GestureTapDown = 9;
122 Type_GestureTapCancel = 10;
123 Type_GestureDoubleTap = 11;
124 Type_GestureTwoFingerTap = 12;
125 Type_GestureLongPress = 13;
126 Type_GestureLongTap = 14;
127 Type_GesturePinchBegin = 15;
128 Type_GesturePinchEnd = 16;
129 Type_GesturePinchUpdate = 17;
32 } 130 }
131
33 optional Type type = 1; 132 optional Type type = 1;
133 optional double timestamp_seconds = 2;
34 134
35 optional ClickArgs click = 1000; 135 optional GestureArgs gesture = 1000;
36 optional DragArgs drag = 1001;
37 } 136 }
38 137
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698