• Sammie Quon's avatar
    capture_mode: Initial land of capture region feature. · e8381eff
    Sammie Quon authored
    See screen cast in bug comment 1 for a video of what is included and not
    included in this CL.
    
    Included:
      - Dragging to select a region
      - After first drag, fine tuning via affordance circles
      - Button to capture region (can be reused for fullscreen and window
        capture)
      - Switching to and from capture region source
    Not included:
      - Nudge for tablet mode (see specs)
      - Motion/animations
      - Styling for buttons
      - Drop shadow for border and affordance circles
      - Partial magnifier for affordance circle presses
      - Cursor changes
    
    The basics of this CL is to provide a UI to select a region. The
    selection has two phases, a quick selection phase to quickly grab a
    region, then a fine tuning phase where users can resize/reposition the
    region with some drag affordances.
    
    For a capture region session, we add two widgets to have supporting
    text and buttons, and a struct that holds data needed to draw the rest
    of the UI onto the layer. The layer is updated when the selection
    region has been updated from drag events.
    
    For phase two, we use a simple formula to determine which affordance
    has been pressed down on, if any. If an affordance was pressed on, we
    allow resizing, but one or two points stay the same. These are stored
    in the struct as anchor points, and used to compute the new selection
    region when there is a drag event.
    
    Test: manual
    Bug: 1120132
    Change-Id: If9c461d82306666cbfa9be7fcd521bd6caeec331
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2404945Reviewed-by: default avatarAhmed Fakhry <afakhry@chromium.org>
    Commit-Queue: Sammie Quon <sammiequon@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#807318}
    e8381eff
capture_mode_session.cc 21.1 KB