Convert GetPasswordForm to work with FormData

GetPasswordForm parses web forms into PasswordForms. So far, it takes as
input the DOM elements directly. This makes it necessary to run the
parsing in renderer.

In the future, parsing should be run in browser, for various reasons.
The browser process can only work with an abstraction of the DOM
elements, captured in FormData and FormFieldData. This abstraction is
already computed at the time GetPasswordForm is run, and contains enough
information to replace the direct access to DOM elements.

The only exception is the HTML-based username detector, which may
require richer information in the future and should thus stay in the
renderer process.

Therefore this CL translates the code of GetPasswordForm to deal with
FormData instead of DOM elements, with the notable exception of the
HTML-based username detector.

Bug: 833838
Change-Id: I75c1dcc932511539d84559d6813ef53f4ee210c2
Reviewed-on: https://chromium-review.googlesource.com/1032789
Commit-Queue: Vaclav Brozek <vabr@chromium.org>
Reviewed-by: Vadym Doroshenko <dvadym@chromium.org>
Cr-Commit-Position: refs/heads/master@{#562846}
2 files changed