Reland "wait properly for the keyboard bounds change"

Instead of RunUntilIdle, it should wait for OnKeyboardOccludedBoundsChange.
This CL also allows to resize the window which remotely hosts the VK
web-contents based on window.resizeTo().

This is a reland of crrev.com/c/1394595 with an addition of waiting
the processing of SetBounds in MockEnableIMEInDifferentExtension().

TBR=stevenjb@chromium.org, xiyuan@chromium.org

Bug: 916177, 920073
Test: browser_tests
Change-Id: Ib353f5193ab4f7bb907a6c02ece6429b42408919
Reviewed-on: https://chromium-review.googlesource.com/c/1403923
Reviewed-by: Jun Mukai <mukai@chromium.org>
Commit-Queue: Jun Mukai <mukai@chromium.org>
Cr-Commit-Position: refs/heads/master@{#621343}
2 files changed