diff options
Diffstat (limited to 'chromium/content/common/input/input_handler.mojom')
-rw-r--r-- | chromium/content/common/input/input_handler.mojom | 90 |
1 files changed, 32 insertions, 58 deletions
diff --git a/chromium/content/common/input/input_handler.mojom b/chromium/content/common/input/input_handler.mojom index a7853e55a0b..6ae8d0bf969 100644 --- a/chromium/content/common/input/input_handler.mojom +++ b/chromium/content/common/input/input_handler.mojom @@ -9,7 +9,13 @@ import "content/common/input/synchronous_compositor.mojom"; import "content/common/native_types.mojom"; import "mojo/public/mojom/base/string16.mojom"; import "mojo/public/mojom/base/time.mojom"; +import "third_party/blink/public/mojom/input/gesture_event.mojom"; +import "third_party/blink/public/mojom/input/input_event.mojom"; +import "third_party/blink/public/mojom/input/input_handler.mojom"; +import "third_party/blink/public/mojom/input/input_event_result.mojom"; import "third_party/blink/public/mojom/input/pointer_lock_result.mojom"; +import "third_party/blink/public/mojom/input/touch_event.mojom"; +import "third_party/blink/public/mojom/input/pointer_lock_context.mojom"; import "third_party/blink/public/mojom/selection_menu/selection_menu_behavior.mojom"; import "ui/base/ime/mojom/ime_types.mojom"; import "ui/events/mojom/event.mojom"; @@ -46,8 +52,8 @@ struct PointerData { int32 tilt_y; float tangential_pressure; int32 twist; - Button button; - PointerType pointer_type; + blink.mojom.Button button; + ui.mojom.EventPointerType pointer_type; int32 movement_x; int32 movement_y; bool is_raw_movement_event; @@ -65,7 +71,7 @@ struct WheelData { float acceleration_ratio_y; uint8 phase; uint8 momentum_phase; - Cancelability cancelable; + blink.mojom.DispatchType cancelable; uint8 event_action; uint8 delta_units; }; @@ -85,7 +91,7 @@ struct ScrollData { float delta_y; ui.mojom.ScrollGranularity delta_units; bool target_viewport; - InertialPhaseState inertial_phase; + blink.mojom.InertialPhaseState inertial_phase; bool synthetic; int32 pointer_count; ScrollUpdate? update_details; @@ -120,9 +126,9 @@ struct TapData { struct GestureData { gfx.mojom.PointF screen_position; gfx.mojom.PointF widget_position; - GestureDevice source_device; + blink.mojom.GestureDevice source_device; bool is_source_touch_event_set_non_blocking; - PointerType primary_pointer_type; + ui.mojom.EventPointerType primary_pointer_type; int32 unique_touch_event_id; gfx.mojom.Size? contact_size; ScrollData? scroll_data; @@ -134,7 +140,7 @@ struct GestureData { }; struct TouchPoint { - TouchState state; + blink.mojom.TouchState state; float radius_x; float radius_y; float rotation_angle; @@ -142,7 +148,7 @@ struct TouchPoint { }; struct TouchData { - Cancelability cancelable; + blink.mojom.DispatchType cancelable; bool moved_beyond_slop_region; bool touch_start_or_first_move; bool hovering; @@ -151,7 +157,7 @@ struct TouchData { }; struct Event { - EventType type; + blink.mojom.EventType type; int32 modifiers; mojo_base.mojom.TimeTicks timestamp; ui.mojom.LatencyInfo latency; @@ -161,35 +167,15 @@ struct Event { TouchData? touch_data; }; -struct TouchActionOptional { - cc.mojom.TouchAction touch_action; -}; - // Interface exposed by the browser to the renderer. interface WidgetInputHandlerHost { - // Call platform Fallback Cursor Mode APIs. - [EnableIf=is_android] - FallbackCursorModeLockCursor(bool left, bool right, bool up, bool down); - [EnableIf=is_android] - FallbackCursorModeSetCursorVisibility(bool visible); - // When the renderer's main thread computes the touch action, send this to the // browser. SetTouchActionFromMain(cc.mojom.TouchAction touch_action); - // The whitelisted touch action and the associated unique touch event id - // for a new touch point sent by the compositor. The unique touch event id is - // only needed to verify that the whitelisted touch action is being associated - // with the correct touch event. The input event ack state is needed when - // the touchstart message was not sent to the renderer and the touch - // actions need to be reset and the touch ack timeout needs to be started. - SetWhiteListedTouchAction(cc.mojom.TouchAction touch_action, - uint32 unique_touch_event_id, - InputEventAckState state); - // Sent by the compositor when input scroll events are dropped due to bounds // restrictions on the root scroll offset. - DidOverscroll(DidOverscrollParams params); + DidOverscroll(blink.mojom.DidOverscrollParams params); // Sent by the compositor when a GSB has started scrolling the viewport. DidStartScrollingViewport(); @@ -223,23 +209,15 @@ interface WidgetInputHandlerHost { // |unadjusted_movement| indicates whether the request asked for raw mouse // movement data or just what the operating system returns (often accelerated // mouse movement). - // TODO(jameshollyer-https://crbug.com/1056036): Add a context to this call - // so that both sides have a shared state telling them if the mouse is - // locked. + // |result| kSuccess if the mouse has been locked or the appropriate error + // reason if not. + // |context| is one end of a mojo pipe that will stay connected as long as + // the mouse is locked. Is a NullRemote if |result| is not kSuccess. RequestMouseLock(bool from_user_gesture, bool privileged, bool unadjusted_movement) - => (blink.mojom.PointerLockResult result); - - // A request to change the current mouse lock to have the given unadjusted - // movement. - RequestMouseLockChange(bool unadjusted_movement) - => (blink.mojom.PointerLockResult result); - - // Unlocks the mouse back to its default behavior. This will also returns - // mouse movement back to the platform's adjusted movement if unadjusted - // movement was true while locking. - UnlockMouse(); + => (blink.mojom.PointerLockResult result, + pending_remote<blink.mojom.PointerLockContext>? context); }; // Interface exposed by the renderer to the browser. This class represents @@ -252,29 +230,23 @@ interface WidgetInputHandler { // Tells widget mouse capture has been lost. MouseCaptureLost(); - // Tells the render side that the mouse has been unlocked. - MouseLockLost(); - // This message notifies the renderer that the next key event is bound to one // or more pre-defined edit commands. If the next key event is not handled - // by webkit, the specified edit commands shall be executed against current + // by blink, the specified edit commands shall be executed against current // focused frame. // Parameters - // * edit_commands (see chrome/common/edit_command_types.h) + // * edit_commands + // See t_p/b/renderer/core/editing/commands/editing_command_type.h // Contains one or more edit commands. - // See third_party/WebKit/Source/WebCore/editing/EditorCommand.cpp for + // See t_p/b/renderer/core/editing/commands/editor_command.cc for // detailed definition of webkit edit commands. // // This message must be sent just before sending a key event. - - SetEditCommandsForNextKeyEvent(array<content.mojom.EditCommand> commands); + SetEditCommandsForNextKeyEvent(array<blink.mojom.EditCommand> edit_commands); // Sends the cursor visibility state to the render widget. CursorVisibilityChanged(bool visible); - // Notifies the RenderWidget when toggle fallback cursor mode on/off. - FallbackCursorModeToggled(bool is_on); - // This message sends a string being composed with an input method. ImeSetComposition(mojo_base.mojom.String16 text, array<ui.mojom.ImeTextSpan> ime_text_spans, @@ -306,9 +278,11 @@ interface WidgetInputHandler { // the main thread so DispatchNonBlockingEvent is always preferred if // you don't require notification. DispatchEvent(Event event) - => (InputEventAckSource source, ui.mojom.LatencyInfo updated_latency, - InputEventAckState state, DidOverscrollParams? overscroll, - TouchActionOptional? touch_action); + => (blink.mojom.InputEventResultSource source, + ui.mojom.LatencyInfo updated_latency, + blink.mojom.InputEventResultState state, + blink.mojom.DidOverscrollParams? overscroll, + blink.mojom.TouchActionOptional? touch_action); // Sends a non-blocking input event to the render widget. The behaviour // of this API is the same as DispatchEvent just that there is no callback |