• Julie Jeongeun Kim's avatar
    [ozone/wayland] Implement 'Drag and Drop' on Wayland · e3a08235
    Julie Jeongeun Kim authored
    This CL is a part of changes for 'Drag and Drop' on wayland and
    extends WaylandDataDevice, WaylandDataSource and WaylandDataOffer.
    
    WaylandDataDevice registers event listeners for 'drag and drop',
    has 'StartDrag' API connected with 'wl_data_device_start_drag' and
    includes reading the data from Wayland.
    
    WaylandDataSource registers event listeners for 'drag and drop' to
    handle at a source side and writes the data to the fd delivered
    from Wayland when it gets 'OnSend' event.
    
    WaylandDataOffer gets the operation decided by Wayland and requests
    the offered data by Wayland.
    
    FakeServer is also extended to support the various compositor side
    functionalities needed so that tests 'drag-and-drop' in
    wayland_data_device_unittest.cc run. MockDataDevice, MockDataOffer
    and MockDataSource classes are extended, implementing the respective
    Wayland compositor hooks to communicate with Wayland clients
    (eg Ozone/Wayland).
    
    Flow:
    1) Sending dragging
    'WaylandDataDevice::StartDrag' triggers the drag action to Wayland,
    Wayland requests the data through 'WaylandDataSource::OnSend' and
    'WaylandDataSource' listens the status through 'OnCancel' or
    'OnDnDDropPerformed'.
    
    2) Getting dragging
    'WaylandDataDevice' listens drag-and-drop status such as entered/
    moved/dropped/left. When the drop action is performed,
    'WaylandDataDevice' reads the data using 'WaylandDataOffer'.
    
    BUG=875164
    TEST=ozone_unittests
    
    Change-Id: Ic1ad80fce4ac396385f3ba6780839ef31d717683
    Reviewed-on: https://chromium-review.googlesource.com/1176891Reviewed-by: default avatarRobert Kroeger <rjkroege@chromium.org>
    Reviewed-by: default avatarSadrul Chowdhury <sadrul@chromium.org>
    Reviewed-by: default avatarAntonio Gomes <tonikitoo@igalia.com>
    Reviewed-by: default avatarMaksim Sisov <msisov@igalia.com>
    Commit-Queue: Julie Jeongeun Kim <jkim@igalia.com>
    Cr-Commit-Position: refs/heads/master@{#589375}
    e3a08235
wayland_data_source.h 2.75 KB