Make generation available again after field is cleared via JavaScript

Clearing the field via JavaScript (on eg. m.imdb.com) only seems to
trigger an event that FocusedNodeChanged event. If the cleared field
contained a password generated through an automatic generation prompt,
then the prompt should be shown again.

Note that clearing the field deletes the provisionally saved password
from the password store, which is a data update, which in turn
dismisses the autofill popup. This has the side effect that the newly
prompted password generation popup is also dismissed. In order to avoid
unintended hides like this one, we decouple the hiding logic for the
password generation popup from the autofill popup.

Since the events that prompt the hiding of the popup have been updated,
this CL also solves the floating popup issue on Android.

Bug:943121, 839280

Change-Id: I21f5610b6a805293844cd6941e2ba6b30540c983
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1525930
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Reviewed-by: Vasilii Sukhanov <vasilii@chromium.org>
Commit-Queue: Ioana Pandele <ioanap@chromium.org>
Cr-Commit-Position: refs/heads/master@{#643301}
11 files changed