[Clank IME] Make keyCode detection sensitive to autocomplete=on|off.

Fixing Stable blocker for Clank IME.

The old keyCode detection heuristics would emit KEYCODE_DEL when the last
character of composition is deleted by backspace. This causes the bug where
the composition gets reset (Japanese keyboard). We fix the the problem by
emitting keyCode 229 when composition is updated, if autocomplete=on. If
autocomplete=off then we can can emit the keyCode, provided that we have
single-character commits. Due to unfortunate collision with
https://codereview.chromium.org/834133004 , we have to to define constant
textInputFlagAutocompleteOff for compatibility with trunk and Beta.

The companion WebKit CL is https://codereview.chromium.org/797243003/

BUG=422685

Review URL: https://codereview.chromium.org/842493004

Cr-Commit-Position: refs/heads/master@{#311245}
2 files changed