[Merge to M-73] Fix the bug that toggle CapsLock shortcut does not work after using
handwriting input

Handwriting/voice input or emoji generates fake pressing/releasing
key events. But pressing/releasing key events use different key code.
As result, the accelerator history fails to remove the fake pressing
event after receiving the fake releasing event.

In fact, key events with key code of ui::VKEY_PROCESSKEY have no effect
on accelerator processing. So in this CL, stop tracking those key events
in the accelerator history. Meanwhile, refactor the accelerator history


Test: ash_unittests
Bug: 918317
Change-Id: Iafdc5658c93fc029942dbdc20571558ed84a3eb3
Reviewed-on: https://chromium-review.googlesource.com/c/1427439
Commit-Queue: Andrew Xu <andrewxu@chromium.org>
Reviewed-by: Scott Violet <sky@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#626832}(cherry picked from commit e1c534a395a54afc1ea6aa50a18531a80781b6ab)
Reviewed-on: https://chromium-review.googlesource.com/c/1443715
Reviewed-by: Ahmed Fakhry <afakhry@chromium.org>
Cr-Commit-Position: refs/branch-heads/3683@{#101}
Cr-Branched-From: e51029943e0a38dd794b73caaf6373d5496ae783-refs/heads/master@{#625896}
4 files changed