Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 generally carries web input events. Currently we |
| 8 // Feel free to modify this interface as necessary during feature work. | 8 // just serialize the 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 message GestureCommon { |
| 19 optional CoordinatePair target = 1; | 19 optional int64 x = 1; |
| 20 optional int64 y = 2; | |
| 21 optional int64 global_x = 3; | |
| 22 optional int64 global_y = 4; | |
| 20 } | 23 } |
| 21 | 24 |
| 22 message DragArgs { | 25 message GestureScrollBegin { |
| 23 optional CoordinatePair origin = 1; | 26 optional float delta_x_hint = 1; |
| 24 optional CoordinatePair destination = 2; | 27 optional float delta_y_hint = 2; |
| 25 optional CoordinatePair elastic_overscroll = 3; | 28 optional bool target_viewport = 3; |
| 29 } | |
| 30 | |
| 31 message GestureScrollUpdate { | |
| 32 optional float delta_x = 1; | |
| 33 optional float delta_y = 2; | |
| 34 optional float velocity_x = 3; | |
| 35 optional float velocity_y = 4; | |
| 36 optional bool previous_update_in_sequence_prevented = 5; | |
| 37 optional bool prevent_propagation = 6; | |
| 38 optional bool inertial = 7; | |
| 39 } | |
| 40 | |
| 41 message GestureFlingStart { | |
| 42 optional float velocity_x = 1; | |
| 43 optional float velocity_y = 2; | |
| 44 optional bool target_viewport = 3; | |
| 45 } | |
| 46 | |
| 47 message GestureFlingCancel { | |
| 48 optional bool prevent_boosting = 1; | |
| 49 } | |
| 50 | |
| 51 message GestureTap { | |
| 52 optional int32 tap_count = 1; | |
| 53 optional float width = 2; | |
| 54 optional float height = 3; | |
| 55 } | |
| 56 | |
| 57 message GesturePinchUpdate { | |
| 58 optional bool zoom_disabled = 1; | |
| 59 optional float scale = 2; | |
| 26 } | 60 } |
| 27 | 61 |
| 28 message InputMessage { | 62 message InputMessage { |
| 29 enum Type { | 63 enum Type { |
| 30 CLICK = 1; | 64 UNKNOWN = 0; |
| 31 DRAG = 2; | 65 // This is a subset of WebGestureType events. We only support a small set |
| 66 // of these with the existing protocol. | |
| 67 Type_GestureScrollBegin = 1; | |
| 68 Type_GestureScrollEnd = 2; | |
| 69 Type_GestureScrollUpdate = 3; | |
| 70 Type_GestureFlingStart = 4; | |
| 71 Type_GestureFlingCancel = 5; | |
| 72 Type_GestureTap = 6; | |
| 73 Type_GesturePinchBegin = 7; | |
| 74 Type_GesturePinchEnd = 8; | |
| 75 Type_GesturePinchUpdate = 9; | |
| 32 } | 76 } |
| 77 | |
| 33 optional Type type = 1; | 78 optional Type type = 1; |
| 34 | 79 |
| 35 optional ClickArgs click = 1000; | 80 // Seconds since client platform start (boot) with millisecond resolution. |
| 36 optional DragArgs drag = 1001; | 81 // This is based off of the client's SystemClock#uptimeMillis(). |
|
nyquist
2015/11/24 20:33:28
Optional nit: I just realized this comment is now
David Trainor- moved to gerrit
2015/11/24 21:34:00
Done.
| |
| 82 optional double timestamp_seconds = 2; | |
| 83 | |
| 84 optional GestureCommon gesture_common = 3; | |
| 85 | |
| 86 // Input event specific messages follow. | |
| 87 // Only one of these fields may be set per InputMessage. | |
| 88 // TODO(dtrainor): use a 'oneof' union when it's supported in Chromium. | |
| 89 optional GestureScrollBegin gesture_scroll_begin = 4; | |
| 90 //optional GestureScrollEnd gesture_scroll_end = 4; | |
| 91 optional GestureScrollUpdate gesture_scroll_update = 5; | |
| 92 optional GestureFlingStart gesture_fling_start = 6; | |
| 93 optional GestureFlingCancel gesture_fling_cancel = 7; | |
| 94 optional GestureTap gesture_tap = 8; | |
| 95 //optional GesturePinchBegin gesture_pinch_begin = 9; | |
| 96 //optional GesturePinchEnd gesture_pinch_end = 10; | |
| 97 optional GesturePinchUpdate gesture_pinch_update = 9; | |
| 37 } | 98 } |
| 38 | 99 |
| OLD | NEW |