• mlcui's avatar
    Shortcut viewer: Determine string to use based on shortcut · 6f245b1e
    mlcui authored
    Most shortcuts in the shortcut viewer use one of four strings,
    representing a single key with 0-3 modifiers. This is currently
    hard-coded with the shortcuts. This CL refactors that to automatically
    determine the correct string based on the number of modifiers,
    eliminating the need to specify the shortcut string for most shortcuts.
    
    This refactor is intended to make way for having a runtime-determined
    number of modifiers for a given shortcut, as #new-shortcut-mapping
    changes shortcuts involving Shift - for those shortcuts, we need to
    display the shifted key instead of Shift + unshifted key.
    
    Bug: 1139080
    Change-Id: I8bb2c71a31fb1eb546aee88d6690990afd6c2f92
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2494205
    Commit-Queue: Michael Cui <mlcui@google.com>
    Reviewed-by: default avatarTao Wu <wutao@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#820643}
    6f245b1e
keyboard_shortcut_item.cc 1.17 KB