• Sidney San Martín's avatar
    Fix system hotkeys like cmd+` in app shims. · 68442b1e
    Sidney San Martín authored
    SystemHotkeyHelperMac, which just managed a SystemHotkeyMap, was never
    initialized in app shim processes, and I didn't see a good place to
    initialize it because it's private to /content. This change replaces
    that class with a function that lazily constructs a SystemHotkeyMap.
    
    The SystemHotkeyMap is now created synchronously on first use instead of
    on a background thread ten seconds after startup. This gets rid of the
    time after startup where system hotkeys aren't respected and simplifies
    the code a bunch, but could jank the main thread if loading from disk is
    slow. I'd favor janking the main thread during the first keyboard
    shortcut instead of mis-routing it.
    
    Bug: 919579
    Change-Id: I78ab8dfaf7b9115ce32e1d2d3e1c27abb7f6a9b5
    Reviewed-on: https://chromium-review.googlesource.com/c/1446847Reviewed-by: default avatarElly Fong-Jones <ellyjones@chromium.org>
    Reviewed-by: default avatarAvi Drissman <avi@chromium.org>
    Commit-Queue: Avi Drissman <avi@chromium.org>
    Auto-Submit: Sidney San Martín <sdy@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#629626}
    68442b1e
system_hotkey_map.mm 5.23 KB