• Bruce Long's avatar
    Adding core caret browsing functionality (renderer side only) · 015d96fa
    Bruce Long authored
    This change implements native caret browsing. In caret
    browsing, a moveable cursor is placed on a web page, allowing a user
    to select and navigate through non-editable text with just a keyboard.
    
    The changes on the renderer process side are those
    needed to make the caret visible and moveable in non-editable
    text when caret browsing is enabled, move the focus when the caret moves
    into a focusable element such as an anchor, and move the caret to the
    active element on initiating navigation if not already there.
    
    For the initial landing of caret browsing, no UX is exposed to the user for
    toggling caret browsing on and off (using F7 as in other browsers e.g.),
    nor are there any means exposed on about:flags to enable the feature. Instead
    caret browsing is enabled on browser launch via a command line parameter,
    similar to the current behavior of the spatial navigation feature:
    
        chrome --enable-caret-browsing
    
    All new tabs created during the browser session will have caret
    browsing turned on.
    
    To fully land the feature in a later CL would require implementing the
    following UX elements as well:
    
    1) Adding the F7 (or other appropriate key) as an accelerator to toggle
       caret browsing on and off.
    
    2) Creating a caret browsing dialog confirming with the user that
       caret browsing should be toggled on or off.
    
    3) Adding two new browser settings: one indicating if caret browsing is
       currently enabled, and another that indicates if pressing F7 should trigger
       a confirmation dialog or just enable/disable caret browsing without confirmation.
    
    4) Plumbing a mechanism for passing the "caret browsing is enabled" setting from
       the browser process to renderer processes.
    
    5) Adding a flag for this feature to "about:flags", exposing a means for
       the user to enable or disable the feature without a command line flag.
    
    Note that these UX elements were already implemented in earlier patchsets
    of this CL--see patchset 18 as the last patch before their removal. Separating
    the feature implementation into multiple CLs allows early experimentation
    of the renderer side changes and accounts for the possibility that
    different browsers may opt for a different UX.
    
    Bug: 977390
    Change-Id: I1906165037c96079d7bec70683f3cc446580f56e
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1666567
    Commit-Queue: Bruce Long <brlong@microsoft.com>
    Reviewed-by: default avatarDaniel Cheng <dcheng@chromium.org>
    Reviewed-by: default avatarKen Buchanan <kenrb@chromium.org>
    Reviewed-by: default avatarCharlie Reis <creis@chromium.org>
    Reviewed-by: default avatarYoshifumi Inoue <yosin@chromium.org>
    Reviewed-by: default avatarNektarios Paisios <nektar@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#677097}
    015d96fa
content_switches.h 16.2 KB